./redis-cli -h 192.168.106.128 -p 6379
say again
1、ping
2、set str1 abc
get str1
3、
mkdir ../redis-cluster
cp redis/bin redis-cluster/redis06 -r
rm -f dump.rdb
port number port 7001
cluster: cluster-enabled yes
batch start radis
vim start-all.sh
context:
cd redis01
./redis-server redis.conf
cd ..
cd redis02
./redis-server redis.conf
cd ..
cd redis03
./redis-server redis.conf
cd ..
cd redis04
./redis-server redis.conf
cd ..
cd redis05
./redis-server redis.conf
cd ..
cd redis06
./redis-server redis.conf
cd ..
Grant permissions to batch
chmod u+x start-all.sh
linux View redis running process:
ps aux|grep redis
Do a service cluster to connect 6 nodes:
find the path
cd redis-3.0.0
cd src
ll *.rb
display the redis-trib.rb script file
Copy this file to /usr/local/redis-cluster/
1. Use ruby script to build a cluster. Requires a ruby runtime environment.
install ruby
yum install ruby
yum install rubygems
2. Install the packages used by the ruby script to run.
[root@localhost ~]# gem install redis-3.0.0.gem
Successfully installed redis-3.0.0
1 gem installed
Installing ri documentation for redis-3.0.0...
Installing RDoc documentation for redis-3.0.0...
[root@localhost ~]#
[root@localhost ~]# cd redis-3.0.0/src
[root@localhost src]# ll *.rb
-rwxrwxr-x. 1 root root 48141 Apr 1 2015 redis-trib.rb
cp redis-trib.rb /usr/local/redis-cluster/
backup machine
./redis-trib.rb create --replicas 1 192.168.106.128:7001 192.168.106.128:7002 192.168.106.128:7003 192.168.106.128:7004 192.168 .106.128:7005 192.168.106.128:7006
Client connection:
redis01/redis-cli -p 7002 -c