Configure master-slave replication for redis, and configure master-slave for redis
Configure master-slave replication for redis master-slave Replication
./Redis-server command. If no parameter is appended, it starts the redis service according to the default configuration. In fact, it can also be appended with a configuration file path parameter. There is a redis. conf file under the redis root directory, which can be used directly to configure the startup server
./redis-server ./redis.conf
Windows corresponds
redis-server.exe redis.windows.conf
Start the server
Master
Slave-1
Slave-2
Start the client
Configure the master-slave relationship
The master Address is 127.0.0.1, and the port number is 6379.
Run the following command under two slave clients:
SLAVEOF 127.0.0.1 6379
Some log information that can be viewed
Master
Slave-01
Slave-02
Test
Set some test values on the master node.
set weixuan hello set testkey testvalue
Test on slave to see if data can be obtained
Slave-01 logs
Slave-02 logs
Principle Error
An error occurred while obtaining data from slave due to insufficient disk space, but no reason was found and no other error message was reported.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.