centos6.x redis-cluster Cluster Offline installation

Source: Internet
Author: User
Tags pkill redis cluster


First, the Environment preparation:




System OS: CentOS6.8
Cluster environment: three hosts and nine nodes
Software version: redis-4.0.11.tar.gz

Redis cluster node information:
redis01
172.16.8.13:7000
172.16.8.13:7001
172.16.8.13:7002
redis02
172.16.8.14:7003
172.16.8.14:7004
172.16.8.14:7005
redis03
172.16.8.15:7006
172.16.8.15:7007
172.16.8.15:7008


Second, Redis installation and configuration
Install the required packages
#yum install-y gcc g++ make gcc-c++ kernel-devel automake autoconf libtool make wget tcl vim Ruby RubyGems Unzip
Yum-y install zlib zlib-devel OpenSSL openssl-devel gcc gcc-c++



Baidu Cloud Link: https://pan.baidu.com/s/1L9KdpWieYlr5K1qPRMuK_w Password: t8ru
Install ruby offline
Download ruby-2.4.4 and upload to server
Https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.gz
Put the bag in the directory.
TAR-XVF ruby-2.4.4.tar.gz?
CD ruby-2.4.4
./configure--prefix=/usr/local/ruby
echo $?
Make && make install
echo "path= $PATH:/usr/local/ruby/bin" >>/etc/profile
Source/etc/profile
which Ruby
/usr/bin/ruby
Rm-rf/usr/bin/ruby
Ln-s/usr/local/ruby/bin/ruby/usr/bin/ruby



[Email protected] ruby-2.4.4]# ruby-v
Ruby 2.4.4p296 (2018-03-28 revision 63013) [X86_64-linux]



Offline Installation RubyGems
Download rubygems-2.7.6.tgz and upload to server
Https://rubygems.org/rubygems/rubygems-2.7.6.tgz
TAR-XVF rubygems-2.7.6.tgz
Chown-r Root.root rubygems-2.7.6
MV rubygems-2.7.6/usr/local/
cd/usr/local/rubygems-2.7.6/
Ruby setup.rb?
echo "path= $PATH:/usr/local/rubygems-2.7.6" >>/etc/profile
Source/etc/profile
View current version


[[email protected] tools]# gem -v
2.7.6
-------------------------------------------------------------------------------------------------------------------


Offline configuration of RubyGems Redisapi
Download the Redis gem and upload it to the server
Https://rubygems.org/downloads/redis-3.3.0.gem
Download the new version
Https://rubygems.org/downloads/redis-4.0.2.gem



Gem Install-l Redis-3.3.0.gem


[[email protected] tools] # gem list redis

*** LOCAL GEMS ***

redis (3.3.0)
If the installation is an older version
Uninstall
gem uninstal redis


Installation


gem install -l redis-4.0.2.gem
[[email protected] tools]# gem list redis

*** LOCAL GEMS ***

redis (4.0.2)


Installing TCL offline


Download tcl8 and upload it to the server
https://sourceforge.net/projects/tcl/files/Tcl/8.6.0/
unzip tcl868-src.zip?
cd tcl8.6.8 / unix /
./configure --prefix = / usr / local / tcl
echo $?
make
echo $?
make install
echo $?
make install-private-headers
ln -v -sf tclsh8.6 / usr / local / tcl / bin / tclsh
chmod -v 755 /usr/local/tcl/lib/libtcl8.6.so
echo "PATH = $ PATH: / usr / local / tcl / bin" >> / etc / profile
source / etc / profile


Create user


useradd qasuserecho devops | passwd --stdin qasuser


Download the Redis installation package
Http://download.redis.io/releases/redis-4.0.11.tar.gz



Installation and Configuration


tar -xvf redis-4.0.11.tar.gz -C / app
chown -R qasuser.qasuser /app/redis-4.0.11
cd /app/redis-4.0.11
-------------------------------------------------- -------------------------------------------------- --------
If there are residual files because the last compilation failed, the method is as follows:
[[email protected] redis-4.0.11] $ make distclean
-------------------------------------------------- -------------------------------------------------- --------
[[email protected] redis-4.0.11]$ make


See if compilation is successful


[[email protected] redis-4.0.11]$ echo $?0


Execution on Node 1 (172.16.8.13)


su - qasuser
mkdir /app/redis-4.0.11/redis-cluster
cd /app/redis-4.0.11/redis-cluster
mkdir {7000,7001,7002}

cat <<EOF>./7000/redis.conf
port 7000
bind 172.16.8.13
daemonize yes
pidfile /var/run/redis_7000.pid
cluster-enabled yes
cluster-config-file nodes_7000.conf
cluster-node-timeout 10100
appendonly yes
EOF

cat <<EOF>./7001/redis.conf
port 7001
bind 172.16.8.13
daemonize yes
pidfile /var/run/redis_7001.pid
cluster-enabled yes
cluster-config-file nodes_7001.conf
cluster-node-timeout 10100
appendonly yes
EOF

cat <<EOF>./7002/redis.conf
port 7002
bind 172.16.8.13
daemonize yes
pidfile /var/run/redis_7002.pid
cluster-enabled yes
cluster-config-file nodes_7002.conf
cluster-node-timeout 10100
appendonly yes
EOF
for((i=0;i<=2;i++)); do /app/redis-4.0.11/src/redis-server /app/redis-4.0.11/redis-cluster/700$i/redis.conf; done

[email protected] redis-cluster]$ ps -ef | grep redis-server
qasuser ? ?9742 ? ? ?1 ?0 Sep04 ? ? ? ? ?00:02:51 /app/redis-4.0.11/src/redis-server 172.16.8.13:7000 [cluster] ? ? ? ? ? ? ? ? ? ??
qasuser ? ?9747 ? ? ?1 ?0 Sep04 ? ? ? ? ?00:02:51 /app/redis-4.0.11/src/redis-server 172.16.8.13:7001 [cluster] ? ? ? ? ? ? ? ? ? ??
qasuser ? ?9749 ? ? ?1 ?0 Sep04 ? ? ? ? ?00:02:51 /app/redis-4.0.11/src/redis-server 172.16.8.13:7002 [cluster] ? ? ? ? ? ? ? ? ? ??
qasuser ?104976 104464 ?0 13:54 pts/1 ? ?00:00:00 grep redis-server


Execution on Node 2 (172.16.8.14)


su - qasuser
mkdir /app/redis-4.0.11/redis-cluster
cd /app/redis-4.0.11/redis-cluster
mkdir {7003,7004,7005}

cat <<EOF>./7003/redis.conf
port 7003
bind 172.16.8.14
daemonize yes
pidfile /var/run/redis_7003.pid
cluster-enabled yes
cluster-config-file nodes_7003.conf
cluster-node-timeout 10100
appendonly yes
EOF

cat <<EOF>./7004/redis.conf
port 7004
bind 172.16.8.14
daemonize yes
pidfile /var/run/redis_7004.pid
cluster-enabled yes
cluster-config-file nodes_7004.conf
cluster-node-timeout 10100
appendonly yes
EOF

cat <<EOF>./7005/redis.conf
port 7005
bind 172.16.8.14
daemonize yes
pidfile /var/run/redis_7005.pid
cluster-enabled yes
cluster-config-file nodes_7005.conf
cluster-node-timeout 10100
appendonly yes
EOF
for((i=3;i<=5;i++)); do /app/redis-4.0.11/src/redis-server /app/redis-4.0.11/redis-cluster/700$i/redis.conf; done

[[email protected]t redis-cluster]$ ps -ef | grep redis-server
qasuser ? 48130 ? ? ?1 ?0 11:20 ? ? ? ? ?00:00:18 /app/redis-4.0.11/src/redis-server 172.16.8.14:7003 [cluster] ? ? ? ? ? ? ? ? ? ??
qasuser ? 48132 ? ? ?1 ?0 11:20 ? ? ? ? ?00:00:18 /app/redis-4.0.11/src/redis-server 172.16.8.14:7004 [cluster] ? ? ? ? ? ? ? ? ? ??
qasuser ? 48134 ? ? ?1 ?0 11:20 ? ? ? ? ?00:00:18 /app/redis-4.0.11/src/redis-server 172.16.8.14:7005 [cluster] ? ? ? ? ? ? ? ? ? ??
qasuser ? 48768 ?48593 ?0 13:56 pts/0 ? ?00:00:00 grep redis-server


Execution on Node 3 (172.16.8.15)


su-qasuser
mkdir /app/redis-4.0.11/redis-cluster
cd /app/redis-4.0.11/redis-cluster
mkdir {7006,7007,7008}
cat << EOF> ./ 7006 / redis.conf
port 7006
bind 172.16.8.15
daemonize yes
pidfile /var/run/redis_7006.pid
cluster-enabled yes
cluster-config-file nodes_7006.conf
cluster-node-timeout 10100
appendonly yes
EOF

cat << EOF> ./ 7007 / redis.conf
port 7007
bind 172.16.8.15
daemonize yes
pidfile /var/run/redis_7007.pid
cluster-enabled yes
cluster-config-file nodes_7007.conf
cluster-node-timeout 10100
appendonly yes
EOF

cat << EOF> ./ 7008 / redis.conf
port 7008
bind 172.16.8.15
daemonize yes
pidfile /var/run/redis_7008.pid
cluster-enabled yes
cluster-config-file nodes_7008.conf
cluster-node-timeout 10100
appendonly yes
EOF
for ((i = 6; i <= 8; i ++)); do /app/redis-4.0.11/src/redis-server /app/redis-4.0.11/redis-cluster/700$i/redis. conf; done

[[email protected] redis-cluster] $ ps -ef | grep redis-server
qasuser? 48101??? 1? 0 11:24???? 00:00:18 /app/redis-4.0.11/src/redis-server 172.16.8.15:7006 [cluster]????? ??? ??
qasuser? 48103??? 1? 0 11:24???? 00:00:18 /app/redis-4.0.11/src/redis-server 172.16.8.15:7007 [cluster]????? ??? ??
qasuser? 48105??? 1? 0 11:24???? 00:00:18 /app/redis-4.0.11/src/redis-server 172.16.8.15:7008 [cluster]????? ??? ??
qasuser? 48548? 48361? 0 13:57 pts / 0?? 00:00:00 grep redis-server
Redis.conf configuration instructions:
port 7000????? Configure the ports of the cluster, the first group 7000, 7001, 7002, the first group 7003, 7004, 7005, the first group 7006, 7007, 7008.
bind the IP of this machine??????? The default configuration here is 127.0.0.1 changed to the intranet ip.
daemonsize yes??????????? Allow redis to run in the background
pidfile? /var/run/redis_7000.pid?? Change to the same port
cluster-enabled? yes????????
cluster-config-file node_7000.conf? cluster configuration, consistent with port
cluster-node-timeout? 15000????? Request timeout, default is 15 seconds
appendonly? yes???? ??


Create a cluster


/APP/REDIS-4.0.11/SRC/REDIS-T
/app/redis-4.0.11/src/redis-trib.rb create --replicas 1 172.16.8.13:7000 172.16.8.13:7001 172.16.8.13:7002 172.16.8.14:7003 172.16.8.14:7004 172.16.8.14:7005 172.16.8.15:7006 172.16.8.15:7007 172.16.8.15:7008

[[email protected] redis-cluster]$ /app/redis-4.0.11/src/redis-trib.rb create --replicas 1 172.16.8.13:7000 172.16.8.13:7001 172.16.8.13:7002 172.16.8.14:7003 172.16.8.14:7004 172.16.8.14:7005 172.16.8.15:7006 172.16.8.15:7007 172.16.8.15:7008
>>> Creating cluster
/usr/local/ruby/lib/ruby/gems/2.4.0/gems/redis-3.3.0/lib/redis/client.rb:459: warning: constant ::Fixnum is deprecated
>>> Performing hash slots allocation on 9 nodes...
Using 4 masters:
172.16.8.13:7000
172.16.8.14:7003
172.16.8.15:7006
172.16.8.13:7001
Adding replica 172.16.8.15:7007 to 172.16.8.13:7000
Adding replica 172.16.8.13:7002 to 172.16.8.14:7003
Adding replica 172.16.8.14:7005 to 172.16.8.15:7006
Adding replica 172.16.8.15:7008 to 172.16.8.13:7001
Adding replica 172.16.8.14:7004 to 172.16.8.13:7000
M: 6a4175a51250ed6a88b6caaf1667d055c6f226cd 172.16.8.13:7000
? ?slots:0-4095 (4096 slots) master
M: 3eeeb535acd80c239a09797cad611cb51ef76845 172.16.8.13:7001
? ?slots:12288-16383 (4096 slots) master
S: a63a2751d14ff5ba19bdb2ace3eab3a2617f0b87 172.16.8.13:7002
? ?replicates ecd312c581df995c352c67fc89f8a72993109df4
M: ecd312c581df995c352c67fc89f8a72993109df4 172.16.8.14:7003
? ?slots:4096-8191 (4096 slots) master
S: b7e4c7cf7da64114967a8a69acaa3aa4f809173f 172.16.8.14:7004
? ?replicates 6a4175a51250ed6a88b6caaf1667d055c6f226cd
S: 9a5700fd232689579cb48f810162ed0a27c28948 172.16.8.14:7005
? ?replicates 3f9239d43ad592947c7c842de7cce1814ab159d5
M: 3f9239d43ad592947c7c842de7cce1814ab159d5 172.16.8.15:7006
? ?slots:8192-12287 (4096 slots) master
S: a5ec006d814acce1bf18b77a767291f407fbb7fe 172.16.8.15:7007
? ?replicates 6a4175a51250ed6a88b6caaf1667d055c6f226cd
S: 95016481a4df1c9fbbc3c34e1e434627b266d144 172.16.8.15:7008
? ?replicates 3eeeb535acd80c239a09797cad611cb51ef76845
Can 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 cluster
Waiting for the cluster to join........
>>> Performing Cluster Check (using node 172.16.8.13:7000)
M: 6a4175a51250ed6a88b6caaf1667d055c6f226cd 172.16.8.13:7000
? ?slots:0-4095 (4096 slots) master
? ?2 additional replica(s)
M: 3f9239d43ad592947c7c842de7cce1814ab159d5 172.16.8.15:7006
? ?slots:8192-12287 (4096 slots) master
? ?1 additional replica(s)
S: a63a2751d14ff5ba19bdb2ace3eab3a2617f0b87 172.16.8.13:7002
? ?slots: (0 slots) slave
? ?replicates ecd312c581df995c352c67fc89f8a72993109df4
M: 3eeeb535acd80c239a09797cad611cb51ef76845 172.16.8.13:7001
? ?slots:12288-16383 (4096 slots) master
? ?1 additional replica(s)
S: 95016481a4df1c9fbbc3c34e1e434627b266d144 172.16.8.15:7008
? ?slots: (0 slots) slave
? ?replicates 3eeeb535acd80c239a09797cad611cb51ef76845
S: 9a5700fd232689579cb48f810162ed0a27c28948 172.16.8.14:7005
? ?slots: (0 slots) slave
? ?replicates 3f9239d43ad592947c7c842de7cce1814ab159d5
S: b7e4c7cf7da64114967a8a69acaa3aa4f809173f 172.16.8.14:7004
? ?slots: (0 slots) slave
? ?replicates 6a4175a51250ed6a88b6caaf1667d055c6f226cd
M: ecd312c581df995c352c67fc89f8a72993109df4 172.16.8.14:7003
? ?slots:4096-8191 (4096 slots) master
? ?1 additional replica(s)
S: a5ec006d814acce1bf18b77a767291f407fbb7fe 172.16.8.15:7007
? ?slots: (0 slots) slave
? ?replicates 6a4175a51250ed6a88b6caaf1667d055c6f226cd
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
RIB.RB Create--replicas 1 172.16.8.13:7000 172.16.8.13:7001 172.16.8.13:7002 172.16.8.14:7003 172.16.8.14:7004 172.16.8.14:7005 172.16.8.15:7006 172.16.8.15:7007 172.16.8.15:7008[[email  Protected] redis-cluster]$/app/redis-4.0.11/src/redis-trib.rb create--replicas 1 172.16.8.13:7000 172.16.8.13:7001 172.16.8.13:7002 172.16.8.14:7003 172.16.8.14:7004 172.16.8.14:7005 172.16.8.15:7006 172.16.8.15:7007 172.16.8.15:7008>>> Creating cluster/usr/local/ruby/lib/ruby/gems/2.4.0/gems/redis-3.3.0/lib/redis/ Client.rb:459:warning:constant:: Fixnum is deprecated>>> performing hash slots allocation on 9 nodes ... Using 4 masters:172.16.8.13:7000172.16.8.14:7003172.16.8.15:7006172.16.8.13:7001adding Replica 172.16.8.15:7007 to 172.16.8.13:7000adding replica 172.16.8.13:7002 to 172.16.8.14:7003adding replica 172.16.8.14:7005 to 172.16.8.15:7006adding replica 172.16.8.15:7008 to 172.16.8.13:7001adding replica 172.16.8.14:7004 to 172.16.8.13:7000m:6A4175A51250ED6A88B6CAAF1667D055C6F226CD 172.16.8.13:7000?? slots:0-4095 (4096 slots) Masterm: 3eeeb535acd80c239a09797cad611cb51ef76845 172.16.8.13:7001?? slots:12288-16383 (4096 slots) MasterS: A63a2751d14ff5ba19bdb2ace3eab3a2617f0b87 172.16.8.13:7002?? replicates ecd312c581df995c352c67fc89f8a72993109df4m: Ecd312c581df995c352c67fc89f8a72993109df4 172.16.8.14:7003?? slots:4096-8191 (4096 slots) MasterS: b7e4c7cf7da64114967a8a69acaa3aa4f809173f 172.16.8.14:7004?? replicates 6a4175a51250ed6a88b6caaf1667d055c6f226cds: 9a5700fd232689579cb48f810162ed0a27c28948 172.16.8.14:7005?? replicates 3f9239d43ad592947c7c842de7cce1814ab159d5m: 3f9239d43ad592947c7c842de7cce1814ab159d5 172.16.8.15:7006?? slots:8192-12287 (4096 slots) MasterS: A5ec006d814acce1bf18b77a767291f407fbb7fe 172.16.8.15:7007?? replicates 6a4175a51250ed6a88b6caaf1667d055c6f226cds: 95016481a4df1c9fbbc3c34e1e434627b266d144 172.16.8.15:7008?? replicates 3eeeb535acd80c239a09797cad611cb51ef76845can 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 C Luster Check (using node 172.16.8.13:7000) m:6a4175a51250ed6a88b6caaf1667d055c6f226cd 172.16.8.13:7000?? slots:0-4095 (4096 Slots) Master 2 additional replica (s) m:3f9239d43ad592947c7c842de7cce1814ab159d5 172.16.8.15:7006?? slots : 8192-12287 (4096 slots) Master?? 1 additional replica (s) s:a63a2751d14ff5ba19bdb2ace3eab3a2617f0b87 172.16.8.13:7002?? Slots: (0 slots) slave?? replicates ecd312c581df995c352c67fc89f8a72993109df4m: 3eeeb535acd80c239a09797cad611cb51ef76845 172.16.8.13:7001?? slots:12288-16383 (4096 slots) Master?? 1 additional Replica (s) s:95016481a4df1c9fbbc3c34e1e434627b266d144 172.16.8.15:7008?? Slots: (0 slots) slave?? replicates 3eeeb535acd80c239a09797cad611cb51ef76845s:9a5700fd232689579cb48f810162ed0a27c28948 172.16.8.14:7005?? sLots: (0 slots) slave?? replicates 3f9239d43ad592947c7c842de7cce1814ab159d5s: b7e4c7cf7da64114967a8a69acaa3aa4f809173f 172.16.8.14:7004?? Slots: (0 slots) slave?? replicates 6a4175a51250ed6a88b6caaf1667d055c6f226cdm:ecd312c581df995c352c67fc89f8a72993109df4 172.16.8.14:7003?? slots : 4096-8191 (4096 slots) Master?? 1 additional replica (s) s:a5ec006d814acce1bf18b77a767291f407fbb7fe 172.16.8.15:7007?? Slots: (0 slots) slave?? replicates 6a4175a51250ed6a88b6caaf1667d055c6f226cd[ok] All nodes agree about slots Configuratio n.>>> Check for open slots...>>> Check slots coverage ... [OK] All 16384 slots covered.


Cluster validation


/app/redis-4.0.11/src/redis-cli -h 172.16.8.13 -c -p 7000
[[email protected] ~]$ /app/redis-4.0.11/src/redis-cli -h 172.16.8.13 -c -p 7000
172.16.8.14:7003> set name qas?
OK
172.16.8.14:7003> get name
"qas"

/app/redis-4.0.11/src/redis-cli -h 172.16.8.14 -c -p 7004
[[email protected] redis-cluster]$ /app/redis-4.0.11/src/redis-cli -h 172.16.8.14 -c -p 7004
172.16.8.14:7004> get name
-> Redirected to slot [5798] located at 172.16.8.14:7003
"qas"
/app/redis-4.0.11/src/redis-cli -h 172.16.8.15 -c -p 7008

[[email protected] redis-cluster]$ /app/redis-4.0.11/src/redis-cli -h 172.16.8.15 -c -p 7008
172.16.8.15:7008> get name
-> Redirected to slot [5798] located at 172.16.8.14:7003
"qas"
----------------------------------------------------------------------------------------------------------------------------
/app/redis-4.0.11/src/redis-trib.rb check 172.16.8.13:7000
[[email protected] ~]$ /app/redis-4.0.11/src/redis-trib.rb check 172.16.8.13:7000
/usr/local/ruby/lib/ruby/gems/2.4.0/gems/redis-3.3.0/lib/redis/client.rb:459: warning: constant ::Fixnum is deprecated
>>> Performing Cluster Check (using node 172.16.8.13:7000)
M: 6a4175a51250ed6a88b6caaf1667d055c6f226cd 172.16.8.13:7000
? ?slots:0-4095 (4096 slots) master
? ?2 additional replica(s)
M: 3f9239d43ad592947c7c842de7cce1814ab159d5 172.16.8.15:7006
? ?slots:8192-12287 (4096 slots) master
? ?1 additional replica(s)
S: a63a2751d14ff5ba19bdb2ace3eab3a2617f0b87 172.16.8.13:7002
? ?slots: (0 slots) slave
? ?replicates ecd312c581df995c352c67fc89f8a72993109df4
M: 3eeeb535acd80c239a09797cad611cb51ef76845 172.16.8.13:7001
? ?slots:12288-16383 (4096 slots) master
? ?1 additional replica(s)
S: 95016481a4df1c9fbbc3c34e1e434627b266d144 172.16.8.15:7008
? ?slots: (0 slots) slave
? ?replicates 3eeeb535acd80c239a09797cad611cb51ef76845
S: 9a5700fd232689579cb48f810162ed0a27c28948 172.16.8.14:7005
? ?slots: (0 slots) slave
? ?replicates 3f9239d43ad592947c7c842de7cce1814ab159d5
S: b7e4c7cf7da64114967a8a69acaa3aa4f809173f 172.16.8.14:7004
? ?slots: (0 slots) slave
? ?replicates 6a4175a51250ed6a88b6caaf1667d055c6f226cd
M: ecd312c581df995c352c67fc89f8a72993109df4 172.16.8.14:7003
? ?slots:4096-8191 (4096 slots) master
? ?1 additional replica(s)
S: a5ec006d814acce1bf18b77a767291f407fbb7fe 172.16.8.15:7007
? ?slots: (0 slots) slave
? ?replicates 6a4175a51250ed6a88b6caaf1667d055c6f226cd
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.


List cluster Nodes


/app/redis-4.0.11/src/redis-cli -h 172.16.8.13 -c -p 7000
[[email protected] ~]$ /app/redis-4.0.11/src/redis-cli -h 172.16.8.13 -c -p 7000
172.16.8.13:7000> cluster nodes
3f9239d43ad592947c7c842de7cce1814ab159d5 172.16.8.15:[email protected] master - 0 1536205999000 7 connected 8192-12287
a63a2751d14ff5ba19bdb2ace3eab3a2617f0b87 172.16.8.13:[email protected] slave ecd312c581df995c352c67fc89f8a72993109df4 0 1536205998105 4 connected
3eeeb535acd80c239a09797cad611cb51ef76845 172.16.8.13:[email protected] master - 0 1536205999000 2 connected 12288-16383
95016481a4df1c9fbbc3c34e1e434627b266d144 172.16.8.15:[email protected] slave 3eeeb535acd80c239a09797cad611cb51ef76845 0 1536205999000 9 connected
9a5700fd232689579cb48f810162ed0a27c28948 172.16.8.14:[email protected] slave 3f9239d43ad592947c7c842de7cce1814ab159d5 0 1536206000136 7 connected
6a4175a51250ed6a88b6caaf1667d055c6f226cd 172.16.8.13:[email protected] myself,master - 0 1536205997000 1 connected 0-4095
b7e4c7cf7da64114967a8a69acaa3aa4f809173f 172.16.8.14:[email protected] slave 6a4175a51250ed6a88b6caaf1667d055c6f226cd 0 1536205999121 5 connected
ecd312c581df995c352c67fc89f8a72993109df4 172.16.8.14:[email protected] master - 0 1536205997000 4 connected 4096-8191
a5ec006d814acce1bf18b77a767291f407fbb7fe 172.16.8.15:[email protected] slave 6a4175a51250ed6a88b6caaf1667d055c6f226cd 0 1536206001139 8 connected


Cluster information


172.16.8.13:7000> ?cluster info
cluster_state:ok
cluster_slots_assigned:16384
cluster_slots_ok:16384
cluster_slots_pfail:0
cluster_slots_fail:0
cluster_known_nodes:9
cluster_size:4
cluster_current_epoch:9
cluster_my_epoch:1
cluster_stats_messages_ping_sent:1443
cluster_stats_messages_pong_sent:1494
cluster_stats_messages_sent:2937
cluster_stats_messages_ping_received:1486
cluster_stats_messages_pong_received:1443
cluster_stats_messages_meet_received:8
cluster_stats_messages_received:2937


Shutting down the cluster
Recommended Practice:


[[email protected] redis-cluster]$ pkill redis
[[email protected] redis-cluster]$ pkill redis
[[email protected] redis-cluster]$ pkill redis


??
Or the Loop node is closed individually


[[email protected] redis-cluster]$ for((i=0;i<=2;i++)); do /app/redis-4.0.11/src/redis-cli -c -h 172.16.8.13 -p 700$i shutdown; done
[[email protected] redis-cluster]$ for((i=3;i<=5;i++)); do /app/redis-4.0.11/src/redis-cli -c -h 172.16.8.14 -p 700$i shutdown; done
[[email protected] redis-cluster]$ for((i=6;i<=8;i++)); do /app/redis-4.0.11/src/redis-cli -c -h 172.16.8.15 -p 700$i shutdown; done


Problem solving:


/usr/local/ruby/lib/ruby/gems/2.4.0/gems/redis-3.3.0/lib/redis/client.rb:459: warning: constant :: Fixnum is deprecated
It is because the version is too low that? Gem upgrades redis-4.0.2.gem
Proceed as follows:
gem uninstal redis
gem install -l redis-4.0.2.gem 


centos6.x redis-cluster Cluster Offline installation


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.