Under centos 7 build Redis5.x version cluster

Second, start Cluster Setup

redis clusters require at least three master node, we are here to build three master node, and then set up a master to each slave node, redis total of six nodes, where one machine (can deploy multiple machines, modify ip address can be a) deploy 6 redis example, three leading and three from the step of building a cluster as follows:

Step 1: Create a folder redis-cluster at a first machine / usr / local, and then create the six clip files thereunder as follows:

mkdir /usr/local/redis-cluster

cd /usr/local/redis-cluster

mkdir 8001 8002 8003 8004 8005 8006

Step two: before redis.conf configuration file copy to 8001, the following modifications:

1)daemonize yes

2) port 8001 (port number are set for each machine)

3) dir / usr / local / redis-cluster / 8001 / (specify the data file location, you must specify a different directory location, or you'll lose data)

4) cluster-enabled yes (to enable the cluster mode)

5) cluster-config-file nodes-8001.conf (cluster node information file, and the port where the corresponding best 800x)

6)cluster-node-timeout 5000

1. bind 127.0.0.1 (ip remove bind bound access information)

2. protected-mode no (protection mode off)

9)appendonly yes

10) Set pidfile stored in the run directory of the file name pidfile /var/run/redis_8001.pid

11)dbfilename dump_8001.rdb

Guess you like

Origin www.cnblogs.com/sunBinary/p/12391235.html