docker redis Master-slave replication

1, using three start docker redis instance, the container names are:. Myredis-master-6379, myredis-slave-6380, myredis-slave-6381 can see the container to three ip address redis example of the configuration command.

  

 2, into the interior redis, docker exec -it myredis-master-6379 / bin / bash, then redis-cli using redis client enters the command-line mode.

  

  You can see, the characters are all current redis role: master

3, it can be seen from the name, we want to set the master copy from the structure 2 from the main, we enter myredis-slave-6380 and myredis-slave-6381 provided inside

  

4, set up, we can test

  

  1) First, we can set the value of the key-value from the authentication node can be known by the view from the node read only.

  

  2) We then verify value set key-value on the primary node, whether the node can obtain from.

  

  

Guess you like

Origin www.cnblogs.com/az4215/p/11923635.html