master和slave都是一个redis实例(redis服务)
配置主
ifconfig
sudo vi redis.conf
bind 192.168.26.128
sudo service redis stop
redis-server redis.conf
配置从
sudo cp redis.conf ./slave.conf
sudo vi slave.conf
bind 192.168.26.128
slaveof 192.168.26.128 6379
port 6378
sudo redis-server slave.conf
redis-cli -h 192.168.26.128 info Replication
数据操作
redis-cli -h 192.168.26.128 -p 6379
redis-cli -h 192.168.26.128 -p 6378
set aa aa
get aa