[英]How can i get cluster info just like on the terminal, but on my c# client (stackexchange)?
I'm trying to get cluster info of my cluster in Redis on C# with stackexchange library. 我正在尝试使用stackexchange库在C#上的Redis中获取我的集群的集群信息。
I just can't find info about it. 我只是找不到有关它的信息。
The output I'm trying to get is just on the image . 我想要获得的输出仅在图像上 。
Example: 例:
127.0.0.1:7005>
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:7
cluster_my_epoch:1
cluster_stats_messages_ping_sent:8420
cluster_stats_messages_pong_sent:6418
cluster_stats_messages_sent:14838
it is actually pretty simple. 这实际上很简单。 Use the
Info
method on IServer
as follows. 在
IServer
上使用Info
方法,如下所示。
ConnectionMultiplexer pool = ConnectionMultiplexer.Connect("127.0.0.1:6379, allowAdmin=true");
var infoResult = pool.GetServer("127.0.0.1:6379").Info();
Keep in mind that you need to allow adminMode
in order to be allowed to call the Info
API. 请记住,您需要允许
adminMode
才能被调用Info
API。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.