Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to build Redis cluster to realize three masters and three slaves

Shulou Source: shulou.com Published: 2022-06-01 00:43:02 09月22日 Update

This article is about how to build a Redis cluster to achieve three masters and three slaves. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Installation needs to be carried out on each node

1. Download the decompression installation package

Cd / usr/local/

Wget http://download.redis.io/releases/redis-3.2.1.tar.gz

Tar-zxvf / redis-3.2.1.tar.gz

2. Compile and install redis

Cd redis-3.2.1

Make & & make install

-configure one of the nodes, copy it to other nodes after the configuration is completed, and then modify the bind to native IP.

3. Modify the configuration file

Bind 192.168.86.207

Port 8899

Pidfile / var/run/redis/redis-server.pid

Appendonly yes

Cluster-enabled yes

Cluster-config-file nodes-8899.conf

Cluster-require-full-coverage no # is critical, otherwise when one of the primary nodes in the cluster goes down, it will cause the entire cluster to fail.

Cluster-node-timeout 1000

4. Execute on each station.

Yum-y install ruby ruby-devel rubygems rpm-build gcc

Gem install redis

5. Execute on one of the stations

/ usr/local/redis-3.2.1/src/redis-trib.rb create-- replicas 1 192.168.86.207purl 8899 192.168.86.208purl 8899 192.168.86.209purl 8899 192.168.86.210purl 8899 192.168.86.211purl 8899 192.168.86.212Ze8899

6. Verify the cluster

Redis-cli-h 192.168.86.207-c-p 8899

Cluster nodes

Thank you for reading! On "how to build a Redis cluster to achieve three masters and three followers" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, you can share it out for more people to see it!

Tags: Clusters nodes configuration content more articles good practical key files articles look knowledge or native reference help related compilation verification Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno NVidia Shulou Technology macOS Docker