Master-Slave concept
- View the IP address of the current host
Ifconfig
- Modify the Etc/redis/redis.conf file
sudo vim redis.conf
Bind 192.168.26.128
sudo service Redis stop
Redis-server redis.conf
- Configuration from
-
Copy the etc/redis/redis.conf file
sudo cp redis.conf./slave.conf
-
Modify the Redis/slave.conf file
sudo vi slave.conf
-
Edit Content
Bind 192.168.26.128
Slaveof 192.168.26.128 6379
Port 6378
-
Redis Service
sudo redis-server slave.conf
-
View Master-Slave relationships
Redis-cli-h 192.168.26.128 Info Replication
Data manipulation
-
In master and slave, separate the? Info command to view the output information into the master client
Redis-cli-h 192.168.26.128-p 6379
-
Go to the client from
Redis-cli-h 192.168.26.128-p 6378
-
Write Data on Master
Set AA AA
-
Read the data on the slave
Get AA
Linux Next server Redis master-slave Replication (master-slave) configuration