redis-cli -h 192.168.10.71 -p 6379 -a 86a1b907d54bf7010394bf316e183e67 cluster nodes
[root@node71 mysqld_exporter]# redis-cli -h 192.168.10.71 -p 6379 -a 86a1b907d54bf7010394bf316e183e67 cluster nodes Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe. ab5b9040aa84704aa44e977b410ecd9f86227987 :6379 myself,master - 0 0 0 connected
[root@node71 mysqld_exporter]# redis-cli --cluster create 192.168.10.71:6379 192.168.10.72:6379 192.168.10.73:6379 192.168.10.91:6379 192.168.10.92:6379 192.168.10.93:6379 --cluster-replicas 1 -a 86a1b907d54bf7010394bf316e183e67 Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe. >>> Performing hash slots allocation on 6 nodes... Master[0] -> Slots 0 - 5460 Master[1] -> Slots 5461 - 10922 Master[2] -> Slots 10923 - 16383 Adding replica 192.168.10.92:6379 to 192.168.10.71:6379 Adding replica 192.168.10.93:6379 to 192.168.10.72:6379 Adding replica 192.168.10.91:6379 to 192.168.10.73:6379 M: ab5b9040aa84704aa44e977b410ecd9f86227987 192.168.10.71:6379 slots:[0-5460] (5461 slots) master M: d9a7b832cb43346df9406b640dc1590cbce35dbb 192.168.10.72:6379 slots:[5461-10922] (5462 slots) master M: cf991d4a6fb1ed70764fa9d46c25b3f07e070bdb 192.168.10.73:6379 slots:[10923-16383] (5461 slots) master S: 00d82af292410901b8afda616188c5d706cf7aa1 192.168.10.91:6379 replicates cf991d4a6fb1ed70764fa9d46c25b3f07e070bdb S: 781262f783c114a27b12db5fb563ea4a2e74d4e2 192.168.10.92:6379 replicates ab5b9040aa84704aa44e977b410ecd9f86227987 S: c53e8ac7858b8892f6e8aafc7d4334ef3f451f94 192.168.10.93:6379 replicates d9a7b832cb43346df9406b640dc1590cbce35dbb Can I set the above configuration? (type 'yes' to accept): yes >>> Nodes configuration updated >>> Assign a different config epoch to each node >>> Sending CLUSTER MEET messages to join the cluster Waiting for the cluster to join ..... >>> Performing Cluster Check (using node 192.168.10.71:6379) M: ab5b9040aa84704aa44e977b410ecd9f86227987 192.168.10.71:6379 slots:[0-5460] (5461 slots) master 1 additional replica(s) S: 781262f783c114a27b12db5fb563ea4a2e74d4e2 192.168.10.92:6379 slots: (0 slots) slave replicates ab5b9040aa84704aa44e977b410ecd9f86227987 M: d9a7b832cb43346df9406b640dc1590cbce35dbb 192.168.10.72:6379 slots:[5461-10922] (5462 slots) master 1 additional replica(s) S: 00d82af292410901b8afda616188c5d706cf7aa1 192.168.10.91:6379 slots: (0 slots) slave replicates cf991d4a6fb1ed70764fa9d46c25b3f07e070bdb M: cf991d4a6fb1ed70764fa9d46c25b3f07e070bdb 192.168.10.73:6379 slots:[10923-16383] (5461 slots) master 1 additional replica(s) S: c53e8ac7858b8892f6e8aafc7d4334ef3f451f94 192.168.10.93:6379 slots: (0 slots) slave replicates d9a7b832cb43346df9406b640dc1590cbce35dbb [OK] All nodes agree about slots configuration. >>> Check for open slots... >>> Check slots coverage... [OK] All 16384 slots covered.
[root@node71 mysqld_exporter]# redis-cli -h 192.168.10.71 -p 6379 -a 86a1b907d54bf7010394bf316e183e67 -c Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe. 192.168.10.71:6379> cluster info cluster_state:ok cluster_slots_assigned:16384 cluster_slots_ok:16384 cluster_slots_pfail:0 cluster_slots_fail:0 cluster_known_nodes:6 cluster_size:3 cluster_current_epoch:6 cluster_my_epoch:1 cluster_stats_messages_sent:1753 cluster_stats_messages_received:1753