Redis has a very powerful master-slave replication feature, and it also supports a master that can have multiple slave, while a slave can have multiple slave to form a powerful multi-level server cluster architecture. Three Redis instances are currently installed under the same window,
Where primary service port 6379, from service slave1 to 6380, slave2 from service to 6381.
1. The primary server is currently installed and started, and the extracted directories of two primary services are named Redis-salve1 and Redis-salve2, respectively.
2. Configure the slave server
Configure two profiles separately (two files need to be configured with the same content, take redis.windows.conf as an example):
The current configuration of both from the service is the same as the primary server's configuration file:
Among them, redis-slave1 should read:
Among them, Redis-slave2 should read:
3. Start the two slave services
Switch to the respective directory, enter the command: Redis-server--service-install redis.windows.conf--loglevel verbose--service-name service Name
4. Open the service, launch two slave services and set to start automatically
5. Testing
Under Main service, enter set a test with SERVER-CLI, carriage return.
Using the Redisdesktopmanager visualizer to view results validation, three servers were successfully synchronized.
(ii) master-slave replication of Redis under Windows