CentOS7安装redis环境
CentOS7安装redis环境
下载
在/home/newland/program
中执行
shell
1 | wget https://download.redis.io/releases/redis-5.0.14.tar.gz |
解压
shell
1 | tar -zxvf redis-5.0.14.tar.gz |
编译
shell
1 | cd /home/newland/program/redis-5.0.14 |
配置
修改redis.conf配置文件
shell
1 | vim /home/newland/program/redis-5.0.14/redis.conf |
拷贝redis.conf配置文件至/etc/redis
下,重命名为6379.conf
shell
1 | mkdir /etc/redis |
修改redis_init_script脚本
shell
1 | vim /home/newland/program/redis-5.0.14/utils/redis_init_script |
创建redis系统服务
shell
1 | vim /etc/systemd/system/redis.service |
启动服务并加入开机自启
shell
1 | systemctl start redis |
主从同步
修改从机redis.conf配置文件
shell
1 | 添加以下内容后保存 |
重启服务,使主从模式生效
shell
1 | systemctl restart redis |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 西瓜蓬蓬的静谧庭院!