Installation environment: six centos7.4 PCS

  1. In each node to download website release package, can go to our website to find: wget download. Redis. IO/releases/re…

  2. Decompress: tar -zxvf redis-5.0.5.tar.gz

  3. Go to the directory: CD redis-5.0.5. You need to specify another directory if you have customized the decompression directory

  4. Compile: make, compile can, will generate binary file in SRC directory, can run Redis

  5. Jemalloc /jemalloc.h: No such file or directory re-install using make MALLOC=libc

  6. Complete compilation can run standalone

  7. To modify the redis.conf configuration, use a minimal configuration: You can make a copy of the original, A new port 6379 cluster-enabled yes cluster-config-file nodes.conf // Cluster-node-timeout 5000 is generated and managed by Redis during startup Appendonly yes daemonize yes // Run the background bind 10.99.32.16 // need to bind its own IP, otherwise external access cannot be accessed, each node needs to modify the configuration do not add // contents inside

  8. Run instance for each node: SRC/redis – server. / redis. Conf, 1467:C 28 Jun 2019 20:22:30.943 # oO0OoO0OoO0Oo Redis is starting oo0ooo0ooo0ooo0oo 1467:C 28 Jun 2019 20:22:30.943 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=1467, Just started 1467:C 28 Jun 2019 20:22:30.943 # Configuration loaded

  9. Startup script: (Previous versions required a Ruby script that required a little more manipulation, For 5.0, run the redis-cli command) SRC /redis-cli –cluster create 10.99.32.3:6379 10.99.32.31:6379 10.99.32.10:6379 10.99.32.13 10.99.32.12:6379:6379 – cluster – replicas of 1

  10. [OK] All Nodes agree about slots configuration. >>> Check for Open slots… >>> Check slots coverage… [OK] All 16384 slots covered. A copy of six nodes is 3M3S

  11. Connect to the cluster SRC /redis-cli -h 10.99.32.3 -c. If no -c is used, the key will be reported: redis (error) MOVED 7638

  12. After the cache is set, only one M and its Slave have this data, the other nodes do not have this data

Additional nodes

SRC /redis-cli --cluster add-node 10.99.32.32.32:6379 10.99.32.3:6379

Look at the node

SRC /redis-cli -h 10.99.32.9 -c cluster nodes

Remove nodes

SRC/redis – cli – cluster del -node 10.99.32.9:6379 08859612 fdf824fd07c538c65073a86ca7d522cb need to access node node – id first