I. modify the configuration file
#Process ID file storage location
#Log ID file storage location
#Data file storage location
#Cluster node timeout
II. Start all node services
There is only one example in this article
3. Create a cluster
$ redis-cli --cluster create 192.168.8.196:5001 \
IV. use and view cluster status
#Mode of client entering cluster
-c Enable cluster mode Turn on cluster mode
-h <hostname> Server hostname (default: 127.0.0.1).
-p <port> Server port (default: 6379).
$ redis-cli -c -h 192.168.8.196 -p 5001
192.168.8.196:5001> set name zhangsan
-> Redirected to slot  located at 192.168.8.196:5002
192.168.8.196:5002> get name
#View cluster status
#clusterstate: ok indicates that the cluster can normally accept query requests. The fail state indicates that at least one hash slot is not bound (indicating that there is a hash slot that is not bound to any node), or in the wrong state (the node can provide services but has a fail flag), or the node cannot contact most master nodes.
#Cluster? Slots? Assigned: number of hash slots allocated to cluster nodes (not unbound). 16384 hash slots are all allocated to the cluster nodes, which is the necessary condition for the normal operation of the cluster.
#Cluster? Slots? OK: hash slot status is not the number of FAIL and PFAIL
#Hash slot status is the number of PFAIL. As long as the hash slots are not upgraded to FAIL, they can still be processed normally. The PFAIL state means that we cannot interact with the node at present, but this state is only a temporary error state.
#Hash slot status is the number of failures. If the value is not 0, the cluster node will not be able to provide query service unless cluster require full coverage is set to no
#The number of nodes in the cluster, including those in handshake state that have not become formal members of the cluster
#The number of master nodes that contain at least one hash slot and can provide services
#View cluster nodes
Through this information, you can view the master-slave relationship before each node
b3363a81c3c59d57143cd3323481259c044e66d2 192.168.8.196:5006@15006 slave 1b7aa419065c5477c0def9d5e25106963fbdda76 0 1572917132045 6 connected 9dc870942555447543694e42e40061823ed91271 192.168.8.196:5004@15004 slave d1a4b1aa3e924a5917efc240cdb2e3ada39e01c2 0 1572917130038 4 connected 1b7aa419065c5477c0def9d5e25106963fbdda76 192.168.8.196:5003@15003 master - 0 1572917131041 3 connected 10923-16383 b1b67d4e554e29605bdbe40deab6670a42dd8836 192.168.8.196:5002@15002 master - 0 1572917130000 2 connected 5461-10922 fbf9f23ecf0fea399debf7db42c73fece04b98fd 192.168.8.196:5005@15005 slave b1b67d4e554e29605bdbe40deab6670a42dd8836 0 1572917131000 5 connected d1a4b1aa3e924a5917efc240cdb2e3ada39e01c2 192.168.8.196:5001@15001 myself,master - 0 1572917127000 1 connected 0-5460