Test 2 machines, 3 nodes per machine (Redis cluster requires a minimum of 6 nodes)
1.2 Machines to install Redis, installation directory/usr/local/
2. Create 3 nodes, respectively
1). Create cluster directory: cd/usr/local
mkdir Redis_cluster
mkdir 7000 7001 7002
CP Redis/redis.config./redis_cluster/7000/
CP Redis/redis.config./redis_cluster/7001/
CP Redis/redis.config./redis_cluster/7002/
2). Modify the corresponding configuration, there are several parameters to note,
Daemonize Yes//redis background run
Pidfile/var/run/redis_7000.pid//pidfile file corresponds to 7000,7001, 7002
Port 7000//Ports 7000,7001, 7002
cluster-enabled Yes//turn on cluster to remove comment #
Cluster-config-file nodes_7000.conf//cluster configuration 7000,7001, 7002
Protected-mode No
Bind is commented out or set to 0.0.0.0
Requirepass Comment out
Other configurations There's not much to say.
3). Start
Verify that all nodes are started successfully and that the ports are open
3. Create a cluster
1) All the nodes are ready to install Ruby
Yum-y install ruby Ruby-devel rubygems rpm-build
Gem Install Redis
There is a low version of the error, install a higher version of the Can, can refer to https://www.cnblogs.com/PatrickLiu/p/8454579.html thank bloggers
2) Next Run the REDIS-TRIB.RB
4. Create a cluster
/USR/LOCAL/REDIS/SRC/REDIS-TRID.RB Create--replicas 1 0.0.0.0:7000 0.0.0.0:7001 0.0.0.0:7002 0.0.0.1:7003 0.0.0.1:70 04 0.0.0.1:7005
Here's a place to watch.
1.redis cluster port, need to correspond to release plus 10000 port, for example: 7000 port, also need to release 17000, 7001 corresponds to 17001
2. The cluster meet command is required when the waiting for the cluster to join appears. Log on to a client of a node, execute cluster meet 0.0.0.0 7000
Can see has been successful, so far, the cluster is built to complete
Redis Cluster Setup