Test results of Redis multi-master-one-slave Configuration

Source: Internet
Author: User
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.