首先去官網下載redis安裝包:下載redisredis
tar zxvf redis-3.0.4.tar.gz
cd redis-3.0.4
make
[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服務器
[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命令,爲 make MALLOC=libc
ui
安裝完成後,執行make install,執行文件被複制到了/usr/local/bin中,
須要手動複製配置文件'code
cp redis.conf /usr/local/bin
./redis-server redis.conf
./redis-cli