redis cluster creation process
node primary node not less than three.
1. Configure redis environment, ruby environment (trib.rb environment dependent).
2. The cluster configuration file is required to install redis src in the trib tools, depending on the installation directory, copy the file to trib.rb, / usr / local / bin, allowed all tool paths can call the command
sudo cp / redis installation directory /src/redis-trib.rb / usr / local / bin /
sudo cp / usr / local / redis / src / redis-trib.rb / usr / local / bin /
3. create a unified format redis instance config file:
Example:
Port 6379
the bind 127.0.0.1
daemonize yes # allow the guard to run in the background mode
pidfile 6379.pid # pidfile filename
cluster-enabled switch yes # clusters
cluster-config-file 6379_node.conf # conf the instance document
cluster-node-timeout 15000 # cluster link timeout, generally disposed 15s
appendOnly yes # AOF of mode switch, the data whether appended to the disk
4. use the config file to create an instance
sudo redis-server / storage configuration directory / file configuration instance of an object 1
sudo redis-server / storage configuration directory / file configuration instance objects 2
...
5. Create a cluster using trib tool
redis-trib.rb create --replicas 1 instance of an object 1 where ip: port where the instance of the object belongs 2 ip: belongs port ...
Redis-trib.rb Create --replicas 127.0.0.1:6380 127.0.0.1:6381. 1 ...
6. the access cluster
redis-cli -h any one instance of an object instance of the object that ip -c -p port
redis-cli -h 127.0.0.1 -c -p 6380
Redis cluster creation process
Guess you like
Origin www.cnblogs.com/jrri/p/11488993.html
Recommended
Ranking