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 install redis cluster

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

Share

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

This article mainly introduces how to install redis cluster. It is very detailed and has a certain reference value. Friends who are interested must finish it!

1. Install redis

Tar xzf redis-3.0.1.tar.gz

Cd redis-3.0.1

Make

Mkdir cluster

Mkdir / etc/redismkdir-p / data/store/redis

Mkdir-p / data/outputs/logs/redis

Have to go on both sides

2, configure redis

[root@slave2 redis-3.0.0] # vim redis.conf / / extracted root directory There is redis.conf. Make the following modifications to port 6379pidfile redis-6379.piddbfilename dump-6379.rdb appendfilename "appendonly-6379.aof" cluster-config-file nodes-6379.conf cluster-enabled yes cluster-node-timeout 5000 appendonly yesdir / data/store/redis/cp redis.conf / etc/redis/redis-6379.confcp redis.conf / etc/redis/redis-6380.confcp redis.conf / etc/redis/redis-6381.confsed-I "port 6379pidfile redis-6379.piddbfilename dump-6379.rdb appendfilename 6379Accord 6380Compact g" / etc/redis/redis-6380.confsed-I "s / 6379Universe 6381Compact g "/ etc/redis/redis-6381.conf

Scp / etc/redis/redis-6379.conf 10.1.10.223:/etc/redis/redis-6379.conf scp / etc/redis/redis-6380.conf 10.1.10.223:/etc/redis/redis-6380.confscp / etc/redis/redis-6381.conf 10.1.10.223:/etc/redis/redis-6381.conf3 start. / redis-server / etc/redis/redis-6379.conf > / data/outputs/logs/redis/redis-6379.log 2 > & 1 &. / redis-server / etc/redis/redis-6380.conf > / data/outputs/logs/redis/redis-6380.log 2 > & 1 &. / redis-server / etc/redis/redis-6381.conf > / data/outputs/logs/redis/redis-6381.log 2 > & 1 & launch netstat-tpnl on both sides | grep redistcp 0 0 0.0 0 data/outputs/logs/redis/redis-6380.log 6379 0 0 0 * LISTEN 18201/./redis-serve tcp 0 0 0 3 380 0.0.0.0LISTEN 18201/./redis-serve tcp * LISTEN 18204/./redis-serve tcp 000.0.0.0VOV 6381 0.0.0.0LISTEN 18201/./redis-serve tcp 000.0.0.0VOV 16379 0.0.0.0LISTEN 18201/./redis-serve tcp 000.0.0.0.0VOV 163800.0.0.0VOV 000.0.0.0VOV 16381 0.0. 0.0LISTEN 18201/./redis-serve tcp * LISTEN 18207/./redis-serve tcp 00: 6379:: * LISTEN 18201/./redis-serve tcp 00: 6380:: * LISTEN 18204/./redis-serve tcp 00: 6381: * LISTEN 18207/./redis-serve tcp 00: 16379: * LISTEN 18201/./redis-serve tcp 00: 16380:: * LISTEN 18204/./redis-serve tcp 00: 16381:: * LISTEN 18207/./redis-servell / data/store/redis/4 install ruby Rubygem yum-y install gcc openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-d yum-y install ruby rubygems replaces the source gem source-l gem sources-- remove gem sources-a gem install redis--version 3.0.15 to establish clusterredis-trib.rb create-- replicas 1 10.1.10.90 y install ruby rubygems 6379 10.10.90 y install ruby rubygems 6380 10.10.90 y install ruby rubygems 6381 10.1.10.223 y install ruby rubygems 6379 10.10.223 1.10.223OKConnecting to node > Creating clusterConnecting to node 10.1.10.90: OKConnecting to node 10.1.10.223: OK > Performing hash slots allocation on 6 nodes...Using 3 masters:10.1.10.223:637910.1.10.90:637910.1 .10.223: 6380Adding replica 10.1.10.90 365b339b2585ca27fd5ba4383e626bf1ffa14bff 6380 to 10.1.10.223:6379Adding replica 10.1.10.223 replicates e0063b5583add6b18b7c2d93cae070fcf5f9e176M 6381 to 10.1.10.90:6379Adding replica 10.1.10.90 to 10.1.10.223 6380 M: 365b339b2585ca27fd5ba4383e626bf1ffa14bff 10.1.10.90 365b339b2585ca27fd5ba4383e626bf1ffa14bff 6379 slots:5461-10922 (5462 slots) replicates 7b0ea5f49bb33a74cdb956febed94bda260c1ad9S: ac87e0b7fee4d54c0cf5af6b579f9256f66cd35d 10.1.10.90 replicates e0063b5583add6b18b7c2d93cae070fcf5f9e176M 6381 replicates e0063b5583add6b18b7c2d93cae070fcf5f9e176M: 7b0ea5f49bb33a74cdb956febed94bda260c1ad9 10.1.10 .223 slots:0 6379 slots:0-5460 (5461 slots) masterM: e0063b5583add6b18b7c2d93cae070fcf5f9e176 10.1.10.223 masterM 6380 slots:10923-16383 (5461 slots) masterS: a64d338f828698b207835a5a3a83c78ffd44a101 10.1.10.223 masterM 6381 replicates 365b339b2585ca27fd5ba4383e626bf1ffa14bffCan I set the above configuration? (type 'yes' to accept): yes > > Nodes configuration updated > > Assign a different config epoch to each node > > Sending CLUSTER MEET messages to join the clusterWaiting for the cluster to join... > > Performing Cluster Check (using node 10.1.10.90 Assign a different config epoch to each node 6379) M: 365b339b2585ca27fd5ba4383e626bf1ffa14bff 10.1.10.90 slots 6379 slots:5461-10922 (5462 slots) masterM: cecc5521194616ce1175000de91a40d514993250 10.1.10.90 6380 slots: (0 slots) master replicates 7b0ea5f49bb33a74cdb956febed94bda260c1ad9M: ac87e0b7fee4d54c0cf5af6b579f9256f66cd35d 10.1.10.90 ac87e0b7fee4d54c0cf5af6b579f9256f66cd35d 6381 slots: (0 slots) master replicates e0063b5583add6b18b7c2d93cae070fcf5f9e176M: 7b0ea5f49bb33a74cdb956febed94bda260c1ad9 10.1.10.223 slots:0 6379 slots:0-5460 (5461 slots) masterM: e0063b5583add6b18b7c2d93cae070fcf5f9e176 10.1.10.223 masterM 6380 slots:10923-16383 (5461 slots) masterM: a64d338f828698b207835a5a3a83c78ffd44a101 10.1.10.223 OK 6381 slots: (0 slots) master replicates 365b339b2585ca27fd5ba4383e626bf1ffa14bff [OK] All nodes agree about slots configuration. > > Check for open slots... > > Check slots coverage... [OK] All 16384slots covered These are all the contents of the article "how to install redis cluster". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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