Linux redis安装
安装依赖
1 | yum install -y gcc |
下载压缩包
1 | wget http://download.redis.io/releases/redis-5.0.3.tar.gz |
编译
1 | cd redis-5.0.3 |
指定目录安装
1 | make install PREFIX=/usr/local/redis |
启动服务
1 | cd /usr/local/redis/bin/ |
后台启动
cp /usr/local/redis-5.0.3/redis.conf /usr/local/redis/bin/
修改 redis.conf
文件 daemonize no
改为 daemonize yes
执行启动命令./redis-server redis.conf
配置
运行外部服务器访问,修改redis.conf
bind 127.0.0.1
为bind 0.0.0.0
或者启动命令加上--protected-mode no
设置开机启动
参考其他教程