02.安装redis问题

make 是编译;make install 是安装

1.make所遇问题:

[zzg@linux redis4.0]$ make 
cd src && make all
make[1]: Entering directory `/usr/local/redis4.0/src'
    CC adlist.o
在包含自 adlist.c:34 的文件中:
zmalloc.h:50:31: 错误:jemalloc/jemalloc.h:没有那个文件或目录
zmalloc.h:55:2: 错误:#error "Newer version of jemalloc required"
make[1]: *** [adlist.o] 错误 1
make[1]: Leaving directory `/usr/local/redis4.0/src'
make: *** [all] 错误 2

解决1:使用 make MALLOC=libc 。
解决2:使用 make distclean 之后再make

2.make 之后在当前文件夹继续执行以下命令

make install PREFIX=/usr/local/redis

3.复制一份自己的配置文件redis.conf 并编辑后台启动

[zzg@linux redis-4.0.1]$ cp redis.conf /usr/local/redis/bin
[zzg@linux redis-4.0.1]$ vi /usr/local/redis/bin/redis.conf
redis.conf 中修改daemonize为yes

启动redis

[zzg@linux bin]$ ./redis-server redis.conf

关闭redis

127.0.0.1:6379> config get dir
1) "dir"
2) "/usr/local/redis/bin"
127.0.0.1:6379> shutdown 
not connected> exit

猜你喜欢

转载自blog.csdn.net/waei08/article/details/78770831