CLUSTER INFO
语法
CLUSTER INFO
- 可用版本
- Redis 开源版 3.0.0
- 时间复杂度
- O(1)
- ACL 类别
-
@slow
,
CLUSTER INFO
提供了关于 Redis 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: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)。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
:发布/订阅 分片发布传播,参见 分片发布订阅 (Sharded Pub/Sub)。
关于 Current Epoch 和 Config Epoch 变量的更多信息可在 Redis Cluster 规范文档中找到。
RESP2 回复
批量字符串回复:一个命名字段和值之间的映射,格式为<field>:<value>
行,通过两个字节 CRLF
组成的新行分隔。