集群信息

语法
CLUSTER INFO
从以下位置开始可用:
3.0.0
时间复杂度:
O(1)
ACL 类别:
@slow,

CLUSTER INFO提供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:2
cluster_stats_messages_sent:1483972
cluster_stats_messages_received:1483968
total_cluster_links_buffer_limit_exceeded:0
  • cluster_state:状态为ok如果节点能够接收查询。fail如果至少有一个哈希槽未绑定(没有关联节点)、处于 ERROR 状态(为其提供服务的节点标有 FAIL 标志),或者此节点无法访问大多数主节点。
  • cluster_slots_assigned:与某个节点关联的插槽数(未绑定)。此数字应为 16384 才能使节点正常工作,这意味着每个哈希槽都应映射到一个节点。
  • cluster_slots_ok:映射到不在 中的节点的哈希槽数FAILPFAIL州。
  • cluster_slots_pfail:映射到 中的节点的哈希槽数PFAIL州。请注意,这些哈希槽仍然可以正常工作,只要PFAILstate 未提升为FAIL通过故障检测算法。PFAIL仅表示我们目前无法与节点通信,可能只是一个瞬态错误。
  • cluster_slots_fail:映射到 中的节点的哈希槽数FAIL州。如果此数字不为零,则节点无法提供查询,除非cluster-require-full-coverage设置为no在配置中。
  • cluster_known_nodes:集群中已知节点的总数,包括HANDSHAKE状态,该状态当前可能不是群集的适当成员。
  • cluster_size:在集群中至少为一个哈希槽提供服务的主节点数。
  • cluster_current_epoch: 本地Current Epoch变量。这用于在故障转移期间创建唯一的递增版本号。
  • cluster_my_epoch:这Config Epoch的节点。这是分配给此节点的当前配置版本。
  • cluster_stats_messages_sent:通过集群节点到节点二进制总线发送的消息数。
  • cluster_stats_messages_received:通过集群节点到节点二进制总线接收的消息数。
  • total_cluster_links_buffer_limit_exceeded:由于超出cluster-link-sendbuf-limit配置。

如果值不为 0,则回复中可能包含以下与消息相关的字段: 每种消息类型都包含有关发送和接收的消息数的统计信息。 以下是这些字段的说明:

  • cluster_stats_messages_ping_sentcluster_stats_messages_ping_received:群集总线 PING(不要与 client 命令混淆PING).
  • cluster_stats_messages_pong_sentcluster_stats_messages_pong_received: PONG (回复 PING)。
  • cluster_stats_messages_meet_sentcluster_stats_messages_meet_received:通过 gossip 或CLUSTER MEET.
  • cluster_stats_messages_fail_sentcluster_stats_messages_fail_received:将节点 xxx 标记为失败。
  • cluster_stats_messages_publish_sentcluster_stats_messages_publish_received:Pub/Sub 发布传播,请参阅 Pubsub
  • cluster_stats_messages_auth-req_sentcluster_stats_messages_auth-req_received:Replica 发起了 leader 选举以替换其 master。
  • cluster_stats_messages_auth-ack_sentcluster_stats_messages_auth-ack_received:指示在领导选举期间进行投票的消息。
  • cluster_stats_messages_update_sentcluster_stats_messages_update_received:另一个节点插槽配置。
  • cluster_stats_messages_mfstart_sentcluster_stats_messages_mfstart_received:暂停客户端以进行手动故障转移。
  • cluster_stats_messages_module_sentcluster_stats_messages_module_received:模块集群 API 消息。
  • cluster_stats_messages_publishshard_sentcluster_stats_messages_publishshard_received:Pub/Sub 发布分片传播,请参见 Sharded Pubsub

有关 Current Epoch 和 Config Epoch 变量的更多信息,请参阅 Redis 集群规范文档

RESP2 回复

批量字符串回复:命名字段和值之间的映射,采用<field>:<value>由两个字节组成的换行符分隔的行CRLF.

RESP3 回复

批量字符串回复:命名字段和值之间的映射,采用:由两个字节 CRLF 组成的换行符分隔的行