redis cluster 4.0.9 叢集安裝搭建

haoge0205發表於2019-12-04

Redis Cluster 4.0.9叢集搭建步驟:

yum install -y gcc g++ gcc-c++ make openssl


cd redis-4.0.9


make


mkdir -p /usr/local/redis-4.0.9


make install PREFIX=/usr/local/redis-4.0.9


mkdir -p /usr/local/ruby-2.4.0


cd ruby-2.4.0


./configure -prefix=/usr/local/ruby-2.4.0


make && make install


yum install rubygems



gem install -l redis-3.3.3.gem


gem list -- check redis gem



vi /etc/profile

source /etc/profile

export PATH=/usr/local/ruby-2.4.0/bin/:$PATH


配置password

vi /usr/local/ruby-2.4.0/lib/ruby/gems/2.4.0/gems/redis-3.3.3/lib/redis/client.rb


在每臺伺服器啟動redis:

/usr/local/redis-4.0.9/bin/redis-server /u01/redis/2002/conf/redis_2002.conf

/usr/local/redis-4.0.9/bin/redis-server /u01/redis/3003/conf/redis_3003.conf


redis-trib.rb create --replicas 1 192.168.11.11:2002 192.168.11.11:3003 192.168.11.12:2002 192.168.11.12:3003 192.168.11.13:2002 192.168.11.13:3003


檢視叢集關係

redis-cli -h 192.168.11.11 -p 2002 -c -a "yoon" cluster nodes



檢視redis-cluster叢集關係

redis-cli -h 192.168.11.11 -p 2002 -c cluster slots | xargs  -n8 | awk '{print $3":"$4"->"$6":"$7}' | sort -nk2 -t ':' | uniq


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28939273/viewspace-2666817/,如需轉載,請註明出處,否則將追究法律責任。

相關文章