集群信息
Syntax
CLUSTER INFO
- Available since:
- 3.0.0
- Time complexity:
- O(1)
- ACL categories:
-
@slow
,
CLUSTER INFO
提供关于 Redis 集群关键参数的 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标志),或者如果该节点无法访问大多数主节点,则状态为fail
。cluster_slots_assigned
: 与某些节点关联的槽数(未绑定)。为了使节点正常工作,这个数字应该是16384,这意味着每个哈希槽都应该映射到一个节点。cluster_slots_ok
: 映射到未处于FAIL
或PFAIL
状态的节点的哈希槽数量。cluster_slots_pfail
: 映射到处于PFAIL
状态的节点的哈希槽数量。请注意,只要PFAIL
状态没有被故障检测算法提升为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_sent
和cluster_stats_messages_ping_received
: 集群总线 PING(不要与客户端命令PING
混淆)。cluster_stats_messages_pong_sent
和cluster_stats_messages_pong_received
: PONG(对PING的回复)。cluster_stats_messages_meet_sent
和cluster_stats_messages_meet_received
: 发送给新节点的握手消息,通过 gossip 或CLUSTER MEET
。cluster_stats_messages_fail_sent
和cluster_stats_messages_fail_received
: 将节点 xxx 标记为失败。cluster_stats_messages_publish_sent
和cluster_stats_messages_publish_received
: Pub/Sub 发布传播,参见 Pubsub。cluster_stats_messages_auth-req_sent
和cluster_stats_messages_auth-req_received
: 副本启动了领导者选举以替换其主节点。cluster_stats_messages_auth-ack_sent
和cluster_stats_messages_auth-ack_received
: 表示在领导者选举期间投票的消息。cluster_stats_messages_update_sent
和cluster_stats_messages_update_received
: 另一个节点的槽位配置。cluster_stats_messages_mfstart_sent
和cluster_stats_messages_mfstart_received
: 暂停客户端以进行手动故障转移。cluster_stats_messages_module_sent
和cluster_stats_messages_module_received
: 模块集群 API 消息。cluster_stats_messages_publishshard_sent
和cluster_stats_messages_publishshard_received
: Pub/Sub 发布分片传播,参见 Sharded Pubsub。
有关当前纪元(Current Epoch)和配置纪元(Config Epoch)变量的更多信息,请参阅Redis集群规范文档。
RESP2 回复
Bulk string reply: A map between named fields and values in the form of<field>:<value>
lines separated by newlines composed by the two bytes CRLF
.