服务器信息:centos7
安装redis版本:7.0.4(最新版)
1.下载redis.conf(主从服务器都执行)
# 如果没有安装yum,需要先安装yum
yum -y install wget
# 下载redis.conf,下载路径为/root/redis.conf
wget http://download.redis.io/redis-stable/redis.conf
# 在服务器的/root目录下创建redis.log文件
touch redis.log
# 给redis.log赋予权限
chmod 777 redis.log
2.配置
2.1配置主的redis.conf
(1)注释 # bind 127.0.0.1
(2)关闭保护模式 protected-mode no
(3)允许在后台执行 daemonize yes
(4)(可选)设定密码 requirepass yourp