Cent OS 7安装redis

在Cent OS 7安装redis时

1、出现错误:make[3]: 进入目录“/usr/enc/redis-4.0.6/deps/hiredis”

gcc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  net.c
make[3]: gcc:命令未找到

原因是gcc未安装

执行命令:yum install gcc 

   yum install gcc-c++



2、出现错误:make[1]: 进入目录“/usr/enc/redis-4.0.6/src”
    CC adlist.o
In file included from adlist.c:34:0:
zmalloc.h:50:31: 致命错误:jemalloc/jemalloc.h:没有那个文件或目录
 #include <jemalloc/jemalloc.h>
                               ^
编译中断。

执行命令:make MALLOC=libc

3:$make test出现问题:

cd src && make test
make[1]: 进入目录“/usr/enc/redis-4.0.6/src”
    CC Makefile.dep
make[1]: 离开目录“/usr/enc/redis-4.0.6/src”
make[1]: 进入目录“/usr/enc/redis-4.0.6/src”
You need tcl 8.5 or newer in order to run the Redis test
make[1]: *** [test] 错误 1
make[1]: 离开目录“/usr/enc/redis-4.0.6/src”
make: *** [test] 错误 2

解决:wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz

sudo tar xzvf tcl8.6.1-src.tar.gz -C /usr/local/

cd /usr/local/tcl8.6.1/unix/

sudo ./configure

sudo make sudo make install


4、权限问题

出现错误:

Can't open the log file: Is a directory

如:[root@10-19-147-112 bin]# ls -l /usr/enc/redis-4.0.6/log/redis.log
-rw-r--r--. 1 root root 0 2月   2 18:52 /usr/enc/redis-4.0.6/log/redis.log

执行命令:chmod 777 /usr/enc/redis-4.0.6/log/redis.log

结果变成:-rwxrwxrwx. 1 root root 0 2月   2 18:52 /usr/enc/redis-4.0.6/log/redis.log


5、查看redis是否启动

ps -ef | grep redis







猜你喜欢

转载自blog.csdn.net/mubin_/article/details/79235533