准备安装
运行命令:
1 | tar zxvf redis-3.0.4. tar .gz |
进入解压后的文件夹:
编译源码:
出错
如果出现下面错误:
1 2 3 4 五 6 7 | [root@localhost redis-3.0.4]# make cd src && make all make[1]: Entering directory `/root/redis-3.0.4/src‘ CC adlist.o /bin/sh: cc: command not found make[1]: *** [adlist.o] Error 127make[1]: Leaving directory `/root/redis-3.0.4/src‘ make: *** [all] Error 2 |
则需要安装GCC
如果出现下面错误:
1 2 3 4 五 6 7 8 9 | [root@localhost redis-3.0.4]# make cd src&& make all make[1]: Entering directory `/root/redis-3.0.4/src‘ CC adlist.o In file included from adlist.c:34: zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory zmalloc.h:55:2: error: #error "Newer version of jemalloc required" make[1]: *** [adlist.o] Error 1make[1]: Leaving directory `/root/redis-3.0.4/src‘ make: *** [all] Error 2 |
则更改作出命令,为 make MALLOC=libc
安装
安装完成后,执行make install,执行文件被复制到了/ usr / local / bin中,
需要手动复制配置文件 '
1 | cp redis.conf /usr/local/bin |
启动服务器:
1 | . /redis-server redis.conf |
启动客户端: