The main memory configuration redis

1, three copies of the same as shown in FIG redis:

      

2, redis-6379 Fixed configuration. The redis-6380 and redis-6381's configuration file redis.windows.conf following parameters:

          redis-6380:port 6380 和slaveof   127.0.0.1  6379 

          redis-6380:port 6381 和slaveof   127.0.0.1  6379 

3, convenience create three Windows batch file xxxx.bat

     bat file contains:

@echo off
redis-server.exe redis.windows.conf
@pause

4, Start redis-6379 master node. Nothing happens.

5, start redis-6380 and redis-6381 slave node.

     redis-6379 mast display information, as shown in FIG.

      

 Redis-6379 starts in the client, input info replication, information is displayed as shown below

  

Look redis-6380 from node (redis-6381 and redis-6380 identical, to see a line)

Look at server side, start the display case.

Look redis-6380 client.

6, redis hosting service is separate read and write. The main mast is responsible for writing, reading from the slave is responsible.

  Server memory write error, as shown below:

7, the master node after the shutdown, the state of the node from the node [-readable, the node does not update the master node]

After the error has been stopped 6380 and 6381, as shown:

Display redis-6380 in master down out, and there is no switching master, or 6379. as shown:

Redis-6380 using the client slaveof no one, so that it becomes the master node, but not its redis-6381 from the node, as shown in FIG.

  

After the restart redis-6379, has resumed.

Guess you like

Origin www.cnblogs.com/swfzzz/p/12051849.html