Test results of Redis multi-master and One-slave configuration. One of my systems is to deploy redis on each machine. In this way, horizontal scaling is achieved. The problem is that it is very inconvenient for statistics.
Test results of Redis multi-master and One-slave configuration. One of my systems is to deploy redis on each machine. In this way, horizontal scaling is achieved. The problem is that it is very inconvenient for statistics.
One of my systems is to deploy redis on various machines, so as to achieve horizontal scaling, the problem is that it is very inconvenient for statistics.
To configure multiple master nodes and one slave node, I added
Slaveof 1.1.1.1 6379
Slaveof 1.1.1.2 6379
Run 1.1.1.1 on the first primary database.
[Root @ AY120428114541e5148f0] # redis-cli
Redis 127.0.0.1: 6379> set a 1
OK
Redis 127.0.0.1: 6379> get
"1"
Redis 127.0.0.1: 6379>
But the results are not displayed on the slave server.
[Root @ localhost ~] # Redis-cli-h 127.0.0.1-p 6380
Redis 127.0.0.1: 6380> get
(Nil)
Run 1.1.1.2 on the first primary database.
Redis 127.0.0.1: 6379>
Redis 127.0.0.1: 6379> set a 2
OK
Redis 127.0.0.1: 6379> get
"2"
The result is displayed on the server.
Redis 127.0.0.1: 6380> get
"2"
Therefore, redis cannot be configured with multiple hosts. If multiple hosts are configured, the last one prevails.