1. 环境配置
Linux系统版本
2. 下载解压
tar -xzf redis-4.0.11.tar.gz
3. 修改配置文件
修改master文件名
mv redis-4.0.11 redis-master
cd redis-master
make
修改master配置文件redis.conf
bind 0.0.0.0
requirepass 1qaz@WSX
复制出salve1
cp -rf redis-master/ redis-slave1
mv redis.conf 6380.conf
cd redis-slave1
make
修改6380.conf
slaveof 127.0.0.1 6379
masterauth 1qaz@WSX
requirepass 1qaz@WSX
pidfile /opt/redis-slave1/6380.pid
port 6380
复制出slave2
cp -rf redis-master/ redis-slave2
mv redis.conf 6381.conf
cd redis-slave2
make
修改6381.conf
slaveof 127.0.0.1 6379
masterauth 1qaz@WSX
requirepass 1qaz@WSX
pidfile /opt/redis-slave2/6381.pid
port 6381
4. 启动
/opt/redis-master/src/redis-server /opt/redis-master/redis.conf
/opt/redis-slave1/src/redis-server /opt/redis-slave1/6380.conf
/opt/redis-slave2/src/redis-server /opt/redis-slave2/6381.conf
查看master节点状态
查看slave节点状态