|
#安装ruby2.2 (只需要一台机器上运行)
yum -y groupinstall "Development Tools"
yum -y install gdbm-devel libdb4-devel libffi-devel libyaml libyaml-devel ncurses-devel openssl-devel readline-devel tcl-devel
cd /root/
mkdir -p rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
wget http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.3.tar.gz -P rpmbuild/SOURCES
wget https://raw.githubusercontent.com/tjinjin/automate-ruby-rpm/master/ruby22x.spec -P rpmbuild/SPECS
rpmbuild -bb rpmbuild/SPECS/ruby22x.spec
yum -y localinstall rpmbuild/RPMS/x86_64/ruby-2.2.3-1.el7.centos.x86_64.rpm
gem install redis
cp /usr/local/src/redis-4.0.1/src/redis-trib.rb /usr/bin/
redis-trib.rb create --replicas 1 192.88.29.250:7000 192.88.29.250:7002 192.88.29.250:7004 192.88.29.200:7001 192.88.29.200:7003 192.88.29.200:7005
#创建redis cluster
# redis-trib.rb create --replicas 1 192.88.29.250:7000 192.88.29.250:7002 192.88.29.250:7004 192.88.29.200:7001 192.88.29.200:7003 192.88.29.200:7005
>>> Creating cluster
>>> Performing hash slots allocation on 6 nodes...
Using 3 masters:
192.88.29.250:7000
192.88.29.200:7001
192.88.29.250:7002
Adding replica 192.88.29.200:7003 to 192.88.29.250:7000
Adding replica 192.88.29.250:7004 to 192.88.29.200:7001
Adding replica 192.88.29.200:7005 to 192.88.29.250:7002
M: fd815645707134eb8b83a0e7514ab9024ed7b6da 192.88.29.250:7000
slots:0-5460 (5461 slots) master
M: eafad428987282d9abc2764b11f599f5e7bbe0c8 192.88.29.250:7002
slots:10923-16383 (5461 slots) master
S: fa1d015f3f72fe7b0d8ec9c54dd3e8b874009725 192.88.29.250:7004
replicates aaea373f41c98067e7783e452cecd9d9d145a273
M: aaea373f41c98067e7783e452cecd9d9d145a273 192.88.29.200:7001
slots:5461-10922 (5462 slots) master
S: cad78846d6e8d3a47c3adeee2409b1433207b559 192.88.29.200:7003
replicates fd815645707134eb8b83a0e7514ab9024ed7b6da
S: b95c0e5ad24f3cf707d3ffc71bf9e3686e3e4b93 192.88.29.200:7005
replicates eafad428987282d9abc2764b11f599f5e7bbe0c8
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 192.88.29.250:7000)
M: fd815645707134eb8b83a0e7514ab9024ed7b6da 192.88.29.250:7000
slots:0-5460 (5461 slots) master
1 additional replica(s)
S: fa1d015f3f72fe7b0d8ec9c54dd3e8b874009725 192.88.29.250:7004
slots: (0 slots) slave
replicates aaea373f41c98067e7783e452cecd9d9d145a273
S: b95c0e5ad24f3cf707d3ffc71bf9e3686e3e4b93 192.88.29.200:7005
slots: (0 slots) slave
replicates eafad428987282d9abc2764b11f599f5e7bbe0c8
M: aaea373f41c98067e7783e452cecd9d9d145a273 192.88.29.200:7001
slots:5461-10922 (5462 slots) master
1 additional replica(s)
M: eafad428987282d9abc2764b11f599f5e7bbe0c8 192.88.29.250:7002
slots:10923-16383 (5461 slots) master
1 additional replica(s)
S: cad78846d6e8d3a47c3adeee2409b1433207b559 192.88.29.200:7003
slots: (0 slots) slave
replicates fd815645707134eb8b83a0e7514ab9024ed7b6da
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
|
|
|