Centos7 linux 安装 redis 遇到的几个问题

环境:centos7 + redis 5.0

解决方案仅供参考,如不能解决问题,请查找请他方案。

1、不能编译没有GCC 编译工具

make报错:

make[1]: [persist-settings] Error 2 (ignored)

CC adlist.o

/bin/sh: cc: command not found

make[1]: *** [adlist.o] Error 127

make[1]: Leaving directory `/usr/local/redis-5.0.0/src'

make: *** [all] Error 2

解决方法:安装gcc

命令如下:yum install gcc

2、os版本

make报错:

cd src && make all

make[1]: Entering directory `/usr/local/redis-5.0.0/src'

CC adlist.o

In file included from adlist.c:34:0:

zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory

#include <jemalloc/jemalloc.h>

^

compilation terminated.

make[1]: *** [adlist.o] Error 1

make[1]: Leaving directory `/usr/local/redis-5.0.0/src'

make: *** [all] Error 2

解决办法:

编辑src/.make-settings里的OPT,改为OPT=-O2 -march=x86-64

3、文件缺失

make报错:

In file included from adlist.c:34:0:

zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory

#include <jemalloc/jemalloc.h>

^

compilation terminated.

make[1]: *** [adlist.o] Error 1

make[1]: Leaving directory `/usr/local/redis-5.0.0/src'

make: *** [all] Error 2

解决方案:

分别进入redis-stable下的deps下的hiredis、lua 运行make

cd /usr/local/redis-stable/deps

make

cd lua

make

cd /usr/local/redis-stable

make

我也是在遇到问题,站在别人的高度上,解决自己遇到的问题。

报错提示和解决方案均是正式环境,已经测试无误可以完美解决。

还是那句老话,环境不同可能遇到的情况不同,如果不能解决还请继续搜索。

评论

暂无评论