Redis集群使用记录

1、查看集群状态和节点信息

root@redis-node1:/data# redis-cli -h 127.0.0.1 -p 47001   #登录redis节点
127.0.0.1:47001> AUTH AhspHJ2l0ychcves       #输入redis密码进行验证
OK
127.0.0.1:47001> CLUSTER INFO                #查看redis-cluster的信息  
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:8
cluster_my_epoch:7
cluster_stats_messages_ping_sent:161253
cluster_stats_messages_pong_sent:165138
cluster_stats_messages_sent:326391
cluster_stats_messages_ping_received:165138
cluster_stats_messages_pong_received:161252
cluster_stats_messages_publish_received:12
cluster_stats_messages_received:326402

127.0.0.1:47001> cluster nodes              #查看redis-cluster的nodes信息
039cfd197e016479799e2904bbc134d8dbd532c9 10.4.1.3:47003@57003 slave e9ffc35cea03e402d5a4bf6cfe7feff442217b88 0 1586524490000 8 connected
8dbea4a8a8fa634497659edf73253921b15275f5 10.4.1.3:47001@57001 myself,slave b54fc2b348d5c64c985b4ae91c705492f4d13379 0 1586524489000 1 connected
e9ffc35cea03e402d5a4bf6cfe7feff442217b88 10.4.1.3:47006@57006 master - 0 1586524490509 8 connected 10923-16383
e1f07f84c5c01b6e72d1e3b7804e8490a1191384 10.4.1.3:47005@57005 slave 492c5b65517c232f22b46cdcfe57b14ac4217142 0 1586524490710 5 connected
b54fc2b348d5c64c985b4ae91c705492f4d13379 10.4.1.3:47004@57004 master - 0 1586524489507 7 connected 0-5460
492c5b65517c232f22b46cdcfe57b14ac4217142 10.4.1.3:47002@57002 master - 0 1586524490000 2 connected 5461-10922

2、查看redis存储keys值

redis-cli -c -h 10.4.2.54 -p 47001  #登录redis
 KEYS *41521005*     #模糊匹配key值
 KEYS 41521005*      #匹配以41521004开头

你可能感兴趣的:(Redis-Cluster)