$ wget http://download.redis.io/releases/redis-2.8.9.tar.gz $ tar xzf redis-2.8.9.tar.gz $ cd redis-2.8.9 $ make
修改redis.conf配置文件
- vim /etc/redis.conf
- 以守护进程方式运行
- daemonize no改为 daemonize yes
- 修改dir ./为绝对路径,
./ redis #改为/usr/local/
- 修改appendonly为yes
- 指定是否在每次更新操作后进行日志记录,
appendonly no 改为 appendonly yes
启动redis
/usr/local/redis-2.8.9/src/redis-server /etc/redis.conf
1.3 查看redis是否己启动
- ps -ef | grep redis
- netstat -tnlp |grep redis
1.4 将redis添加到自启动中
- echo "/usr/local/redis-2.8.9/src/redis-server /etc/redis.conf " >> /etc/rc.local
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 1 make[1]: Leaving directory `/data0/src/redis-2.6.2/src' make: *** [all] Error 2
解决办法是:
make MALLOC=libc