【Zookeeper】常用监控“四字命令”

Four-Letter Words

Now that we have our server configured and up and running, we need to monitor it.
That is where four-letter words come in. We have already seen some examples of fourletter words when we used telnet to see the system status Four-letter words provide a simple way to do various checks on
the system. The main goal with four-letter words is to provide a very simple protocol
that can be used with simple tools, such as telnet and nc, to check system health and
diagnose problems. To keep things simple, the output of a four-letter word will be human

readable. This makes the words easy to experiment with and use.

ruok

Provides (limited) information about the status of the server. If the server is run‐
ning, it will respond with imok. It turns out that “OK” is a relative concept, though.
For example, the server might be running but unable to communicate with the other
servers in the ensemble, yet still report that it is “OK.” For a more detailed and
reliable health check, use the stat word.


stat

Provides information about the status of the server and the connections that are
currently active. The status includes some basic statistics and whether the server is
currently active, if it is a leader or follower, and the last zxid the server has seen.
Some of the statistics are cumulative and can be reset using the srst word.


srvr

Provides the same information as stat, except the connection information, which
it omits.

dump

Provides session information, listing the currently active sessions and when they
will expire. This word can be used only on a server that is acting as the leader.

conf

Lists the basic server configuration parameters that the server was started with.

envi

Lists various Java environment parameters.

mntr

Offers more detailed statistics than stat about the server. Each line of output has
the format key<tab>value. (The leader will list some additional parameters that
apply only to leaders.)

wchs

Lists a brief summary of the watches tracked by the server.

wchc

Lists detailed information on the watches tracked by the server, grouped by session.

wchp

Lists detailed information on the watches tracked by the server, grouped by the
znode path being watched.

cons, crst

cons lists detailed statistics for each connection on a server and crst resets all the
connection counters to zero.(((“cons”))


命令格式:

echo 四字命令 | nc zkIP zkPort

例子:

echo conf | nc 127.0.0.1 2181

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值