Project: HertzBeat (Observability and Analysis / Observability)
File: zookeeper.md

id: zookeeper title: Monitoring Zookeeper sidebar_label: Zookeeper Monitor keywords: [open source monitoring tool, open source zookeeper monitoring tool, monitoring zookeeper metrics] Collect and monitor the general performance Metrics of Zookeeper. The current implementation scheme uses the four word command provided by zookeeper to collect Metrics. Users need to add the four word command of zookeeper to the white list by themselves. Steps 1.Find our zookeeper configuration file, which is usually zoo.cfg. 2.Add the following commands to the configuration file ```shell 4lw.commands.whitelist=stat, ruok, conf, isro 4lw.commands.whitelist=* ``` 3.Restart service ```shell zkServer.sh restart ``` The current implementation scheme requires us to deploy the Linux server of zookeeper Command environment for installing netcat netcat installation steps ```shell yum install -y nc ``` If the terminal displays the following information, the installation is successful ```shell Complete! ``` | Parameter name | Parameter help description | | -- | -- | | Monitoring Host | Monitored IPV4, IPV6 or domain name. NoteWithout protocol header (eg: https://, http://) | | Monitoring name | Identify the name of this monitoring. The name needs to be unique | | Port | Port provided by Zookeeper. The default is 2181 | | Query timeout | Set the timeout of Zookeeper connection, unit: ms, default: 3000ms | | Username | User name of the Linux connection where Zookeeper is located | | Password | Password of the Linux connection where Zookeeper is located | | Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds | | Whether to detect | Whether to detect and check the availability of monitoring before adding

Adding and modifying operations will continue only after the detection is successful | | Description remarks | For more information about identifying and describing this monitoring, users can note information here | | Metric name | Metric unit | Metric help description | | -- | -- | -- | | clientPort | none | Port | | dataDir | none | Data snapshot file directory. By default, 100000 operations generate a snapshot | | dataDirSize | kb | Data snapshot file size | | dataLogDir | none | Transaction log file directory, production environment on a separate disk | | dataLogSize | kb | Transaction log file size | | tickTime | ms | Time interval between servers or between clients and servers to maintain heartbeat | | minSessionTimeout | ms | Minimum session timeout. Heartbeat timex2. The specified time is less than this time, which is used by default | | maxSessionTimeout | ms | Maximum session timeout. Heartbeat timex20. The specified time is greater than this time, which is used by default | | serverId | none | Server id | | Metric name | Metric unit | Metric help description | | -- | -- | -- | | zk_version | none | Server version | | zkserverstate | none | Server role | | zknumalive_connections | number | Number of connections | | zkavglatency | ms | Average latency | | zkoutstandingrequests | number | Number of outstanding requests | | zkznodecount | number | Number of znode | | zkpacketssent | number | Number of packets sent | | zkpacketsreceived | number | Number of packets received | | zkwatchcount | number | Number of watch | | zkmaxfiledescriptorcount | number | Maximum number of file descriptors | | zkapproximatedata_size | kb | data size | | zkopenfiledescriptorcount | number | Number of open file descriptors | | zkmaxlatency | ms | Max latency | | zkephemeralscount | number | Number of ephemeral nodes | | zkminlatency | ms | Min latency |