linux--bash: redis-server: 未找到命令

linux 安装redis过程中出现了异常,make不通过,异常如下:

[[email protected] redis-2.8.3]# make
cd src && make all
make[1]: 进入目录“/usr/local/services/redis/redis-2.8.3/src”
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-dump redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html
(cd ../deps && make distclean)
make[2]: 进入目录“/usr/local/services/redis/redis-2.8.3/deps”
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
make[2]: 离开目录“/usr/local/services/redis/redis-2.8.3/deps”
(rm -f .make-*)
echo STD=-std=c99 -pedantic >> .make-settings
echo WARN=-Wall >> .make-settings
echo OPT=-O2 >> .make-settings
echo MALLOC=jemalloc >> .make-settings
echo CFLAGS= >> .make-settings
echo LDFLAGS= >> .make-settings
echo REDIS_CFLAGS= >> .make-settings
echo REDIS_LDFLAGS= >> .make-settings
echo PREV_FINAL_CFLAGS=-std=c99 -pedantic -Wall -O2 -g -ggdb   -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -DUSE_JEMALLOC -I../deps/jemalloc/include >> .make-settings
echo PREV_FINAL_LDFLAGS=  -g -ggdb -rdynamic >> .make-settings
(cd ../deps && make hiredis linenoise lua jemalloc)
make[2]: 进入目录“/usr/local/services/redis/redis-2.8.3/deps”
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
(echo "" > .make-cflags)
(echo "" > .make-ldflags)
MAKE hiredis
cd hiredis && make static
make[3]: 进入目录“/usr/local/services/redis/redis-2.8.3/deps/hiredis”
gcc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  net.c
make[3]: gcc:命令未找到
make[3]: *** [net.o] 错误 127
make[3]: 离开目录“/usr/local/services/redis/redis-2.8.3/deps/hiredis”
make[2]: *** [hiredis] 错误 2
make[2]: 离开目录“/usr/local/services/redis/redis-2.8.3/deps”
make[1]: [persist-settings] 错误 2 (忽略)
    CC adlist.o
/bin/sh: cc: 未找到命令
make[1]: *** [adlist.o] 错误 127
make[1]: 离开目录“/usr/local/services/redis/redis-2.8.3/src”
make: *** [all] 错误 2

提示:gcc 命令未找到

使用命令安装一下就可以解决了:

yum install -y gcc g++ gcc-c++ make

解决了上面问题后,又出现如下问题:

[email protected] redis-2.8.3]# make
cd src && make all
make[1]: 进入目录“/usr/local/services/redis/redis-2.8.3/src”
    CC adlist.o
In file included from adlist.c:34:0:
zmalloc.h:50:31: 致命错误:jemalloc/jemalloc.h:没有那个文件或目录
 #include <jemalloc/jemalloc.h>
                               ^
编译中断。
make[1]: *** [adlist.o] 错误 1
make[1]: 离开目录“/usr/local/services/redis/redis-2.8.3/src”
make: *** [all] 错误 2

继续填坑,解决方案,如下:

[[email protected] redis-2.8.3]# make MALLOC=libc

最后,终于把redis服务启动起来了:

[[email protected] src]# ./redis-server
[4547] 22 Dec 13:28:14.636 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
[4547] 22 Dec 13:28:14.637 * Max number of open files set to 10032
                _._
           _.-``__ ‘‘-._
      _.-``    `.  `_.  ‘‘-._           Redis 2.8.3 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ‘‘-._
 (    ‘      ,       .-`  | `,    )     Running in stand alone mode
 |`-._`-...-` __...-.``-._|‘` _.-‘|     Port: 6379
 |    `-._   `._    /     _.-‘    |     PID: 4547
  `-._    `-._  `-./  _.-‘    _.-‘
 |`-._`-._    `-.__.-‘    _.-‘_.-‘|
 |    `-._`-._        _.-‘_.-‘    |           http://redis.io
  `-._    `-._`-.__.-‘_.-‘    _.-‘
 |`-._`-._    `-.__.-‘    _.-‘_.-‘|
 |    `-._`-._        _.-‘_.-‘    |
  `-._    `-._`-.__.-‘_.-‘    _.-‘
      `-._    `-.__.-‘    _.-‘
          `-._        _.-‘
              `-.__.-‘                                               

[4547] 22 Dec 13:28:14.640 # Server started, Redis version 2.8.3
[4547] 22 Dec 13:28:14.640 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1‘ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1‘ for this to take effect.
[4547] 22 Dec 13:28:14.640 * The server is now ready to accept connections on port 6379

原文地址:https://www.cnblogs.com/hujinshui/p/10160787.html

时间: 2024-11-05 16:32:35

linux--bash: redis-server: 未找到命令的相关文章

CentOS Linux 7 提示 lsof: 未找到命令

我们常使用 lsof -i:端口号 命令来查看某端口是否开放,如下图: 如,使用下面的命令,查看8080端口: lsof -i:8080 结果: 提示:lsof:未找到命令 解决办法 使用yum今天来安装lsof,命令如下: yum install lsof 结果: 输入y 安装完成,再次使用lsof -i:8080命令: 可以看到,8080端口已使用TCP协议开放. 继续使用lsof -i:3306命令: 发现没有任何输出,说明3306端口没有开放. 原文地址:https://www.cnbl

centos7卸载YUM后重装过程 -bash: yum: command not found / -bash: yum: 未找到命令

[[email protected] ~]# rpm -qa |grep yum yum-3.4.3-158.el7.centos.noarch yum-plugin-fastestmirror-1.1.31-45.el7.noarch yum-metadata-parser-1.1.4-10.el7.x86_64 [[email protected] ~]# rpm -qa |grep python python-libs-2.7.5-68.el7.x86_64 python-iniparse

日常工作中遇到“-bash: netstat: 未找到命令”的解决方法

1.遇到的问题如下: [[email protected] ~]# netstat -anptu | grep mysql -bash: netstat: 未找到命令 2.解决方法如下: [[email protected] ~]# yum -y install net-tools <!--安装依赖程序--> 已加载插件:fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * e

linux执行sh报错:$’\r’: 未找到命令的解决

背景 执行.sh脚本时出现$'\r': 未找到命令, 原因 是因为命令直接从windows 复制过来导致的 解决 yum install dos2unix dos2unix **.sh 进行转换 再次执行即可

CentOS7执行ifconfig Command not found 未找到命令

问题:刚学linux刚按照网络上安装的centos7装完之后登陆成功输入ifconfig,傻眼了[[email protected]~]# ifconfig  -bash: ifconfig: 未找到命令 解决方法: 这可是新安装的系统,怎么会没找到熟悉ifconfig命令呢?网上搜一下,一大堆人都在说是环境变量问题,但我确信我的/etc/profile设置是对的,于是终于找到一篇文章说是安装下net-tools就好 [[email protected]bogon~]# yum install

【CentOS】ntpdate: 未找到命令, crontab

// 收到 mail Date: Sat,  1 Aug 2015 13:25:17 +0800 (CST) Status: R /opt/script/ntp.date.sh:行8: hwclock: 未找到命令 & // 单独执行没有问题,在crontab里面,报找不到命令 // 查看路径 [[email protected] script]# whereis hwclock hwclock: /usr/sbin/hwclock /usr/share/man/man8/hwclock.8.g

semanage: 未找到命令

[[email protected] ~]# semanage port -l|grep ssh-bash: semanage: 未找到命令 yum -y install policycoreutils-python

解决方案:centos运行shell脚本时报“$&#39;\r&#39;: 未找到命令”

=============================================== 2018/9/12_第1次修改                       ccb_warlock =============================================== 问题: 将vs code里编写好的sh脚本(tmp.sh)上传到服务器(centos),运行时报"$'\r': 未找到命令". 解决方案: 查了资料后才知道,由于该脚本的命令在windows上编辑后

/bin/sh: cc: 未找到命令

redis 4安装出现 /bin/sh  cc:  未找到命令 解决: yum -y install gcc automake autoconf libtool make 原文地址:https://www.cnblogs.com/Ai-Hen-Jiao-zhi/p/10354988.html