1、分别在111、112、113三台服务器上安装redis,111为主机
2、修改112、113从机配置文件
cd /usr/local/redis/etc/
vim redis.conf
带配置文件启动redis
进入bin(cd ../bin/)
启动redis(./redis-server ../etc/redis.conf)
![](https://img2018.cnblogs.com/blog/997646/201906/997646-20190610153627544-201895035.png)
在主机控制台输入info
在主机中添加数据,从机会自动添加对应的数据
set username jeff