After a, simple to build Redis. First, install your Ruby environment under Linux. Create a clustered folder. Mkdir-p rediscluster/7000/replication 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 take note # to remove
cluster-config-file nodes.conf //Cluster configuration Profile first start automatic generation
cluster-node-timeout 5000 //Request Timeout set 5 seconds.
appendonly Yes //aof log open if necessary, it will record a log every time the write operation
I'm going to build 8 Services 4 main 4 from. Copy 7000, to 7001. 7007. and modify 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 properly, then you can build the cluster environment. Open the remaining six services in 7001--7007. Make sure all is turned on. Because the service can be clustered after it is opened. Run the following command (replace your own IP and port number)
(under 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 the newspaper: <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 indicates that your server lacks a ruby environment, install Apt-get install ruby also installs Apt-get Inst All rubygems-integration the 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 the 12th command. </span>";