机器IP:
192.168.1.10
主机配置:
protected-mode no
port 6379
pidfile /var/run/redis_6379.pid
requirepass foobared
slave端配置
protected-mode no
port 16379
pidfile /var/run/redis_16379.pid
requirepass foobared
slaveof 192.168.1.10 6379
masterauth foobared
启动主机redis:
redis-server /etc/redis/redis.conf &
启动slave端redis:
redis-server /etc/redis/redis_slave.conf &