Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report