Next, easy to build Redis. First, install your Ruby environment under Linux. Create a cluster folder. Mkdir-p rediscluster/7000/copy redis/redis.conf and redis/src/redis-server to 7000 directory to modify redis.conf configuration
Daemonize Yes //redis background run
pidfile /var/run/redis_7000.pid //pidfile file corresponds to 7000
port 7000 //Port 7000
cluster-enabled Yes //Open cluster Note # remove
cluster-config-file nodes.conf //Cluster configuration profile for the first time start auto
generate cluster-node-timeout //Request Timeout setting 5 seconds enough
appendonly Yes //aof log on when needed to open, it will log each write operation logs
I am going to build 8 Services 4 Master 4 from. Copy 7000, to 7001.. 7007. and modify whether the port test is valid. CD 7000 Redis-server redis.conf ps-ef | grep Redis If there is an interface stating that your configuration is successful if the discovery service is turned on correctly. Next you can build a clustered environment. Turn on the remaining six 7001--7007 services. Make sure all is on. The cluster will not be enabled until the service is turned on. Run the following command (switch to your own IP and port number)
(in the redis/src/directory)
. /REDIS.TRIB.RB Create--Replicas 1 192.168.xxx.130:7000 192.168.xxx.130:7001 192.168.xxx.130:7002 192.168. xxx.130:7003 192.168.xxx.130:7004 192.168.xxx.130:7005 192.168.xxx.130:7006 192.168.xxx.130:7007
If reported: <span style= "font-family: ' Times New Roman '; font-size:14px; line-height:26px; Background-color:rgb (255, 255, 255); " >/usr/bin/env:ruby:no such file or directory to indicate that your server lacks a ruby environment, install Apt-get installed ruby and install Apt-get Inst All rubygems-integration last gem install redis</span>
<span style= "font-family: ' Times New Roman '; font-size:14px; line-height:26px; Background-color: RGB (255, 255, 255); " > re-execute 12th order. </SPAN>