安装
① wget http://download.redis.io/releases/redis-5.0.6.tar.gz
② tar xzf redis-5.0.6.tar.gz
③ cd redis-5.0.6
④ make
注意: 如果编译失败:make MALLOC=libc
⑤配置redis为后台启动:vi /usr/local/redis/redis.conf //将daemonize no 改成daemonize yes
⑥将redis加入到开机启动: vi /etc/rc.local //在里面添加内容:/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf (意思就是开机调用这段开启redis的命令)
⑦启动: ./usr/local/redis/src/redis-server /usr/local/redis/redis.conf
./usr/local/java/redis/redis-5.0.0/src/redis-server /usr/local/redis/redis.conf
⑧常用命令:
redis-server /usr/local/redis/etc/redis.conf //启动redis
pkill redis //停止redis
卸载redis:vi
rm -rf /usr/local/redis //删除安装目录
rm -rf /usr/bin/redis-* //删除所有redis相关命令脚本
rm -rf /root/download/redis-4.0.4 //删除redis解压文件夹
网友评论