ZooKeeper Monitoring (Zabbix)

I have been monitoring, these middleware Zookeeper, Kafka…, usually only know a little bit of fur, they have been built and deployed, and have not been used. , Generally it is used by big data students. As an operation and maintenance personnel, I need to monitor him. Because I don’t know the basics for him, what indicators to monitor is really a big shot. After continuous collection on the Internet to see how others did it, the following basic monitoring was done.

I. Renderings

Share pictures

Share a picture

< /div>

Second. Indicators

The most important thing in monitoring is data. Everything is data. If you have data, you can monitor how you want How to monitor. So what data is important? How to obtain this data? Monitoring indicators are especially important.
Zookeeper monitoring indicators (collected on the Internet, and add them when you encounter special ones in actual situations)
< img alt="Share a picture" src="/wp-content/uploads/images/opensource/zookeeper/1626812899399.png">

Three. Implementation

I implemented these monitoring indicators through Zabbix’s custom script, the script address: https://github.com/Lemon-le /Zookeeper-Monitor-Zabbix
The four-character command of Zookeeper is used to obtain related indicators, and the two scripts zookeeper_mntr.sh and zookeeper_ruok.sh are placed in the Zookeeper service respectively. On the machine, my path is: /etc/zabbix/zabbix_agentd.d/shell-script directory, put zookeeper.conf in /etc/zabbix/zabbix_agentd.d/ directory, and then restart zabbix- on the Zookeeper server agent
Share a picturet.

Four. Add to Zabbix

Import the template on Zabbix and add the above Import the Zookeeper_template.xml file, and then connect the template to the Zookeeper server
Share pictures
You can see the monitoring items are:
Share a picture
Trigger:
Share a picture

< /p>

V. Precautions

When monitoring Zookeeper, I found the following problems, use ps Check that the zookeeper process exists, and the port also exists, but its status is wrong, and the four-character command is also wrong
[[emailprotected]10- 10-1-2 bin]# ./zkServer.sh status

ZooKeeper JMX enabled by default
Using config:
/data/zookeeper-3.4.13/bin/../conf/zoo.cfg
Error contacting service. It is probably not running.

The above error is 2888 of Zookeeper through troubleshooting. The security group on port 3888 and port 3888 were not opened, but I don’t know why only one reported an error, and two elected leaders and followers
[[emailprotected]< span style="color: #800080;">172-30-36 span>-157 bin]# echo mntr|nc 10.10.1.2 2181

This ZooKeeper instance is not currently serving requests

Note: When monitoring Zookeeper, you can’t just use the monitoring port to keep it out of existence, you have to pass status monitoring to truly know whether it’s normal
span>

Six. Summary

There is a saying that quantitative change produces qualitative change It makes sense that knowledge is also a big problem. I have been collecting and collecting monitoring indicators, but I just don’t know which ones are important. No matter how much you look at, no matter how much you check, you still have to do it yourself.
The monitoring above is only a very basic part. Record it. One is a summary of your own mental journey, but a small thing has been completed, and it has been completed with results. There will be a little sense of accomplishment and will increase your confidence.

I have been monitoring, these middleware Zookeeper, Kafka…, I usually only know a little bit about it, so I built and deployed it. I haven’t really used it, and it’s usually used by big data students. As an operation and maintenance personnel, I need to monitor him. Because I don’t know the basics for him, what indicators to monitor is really a big shot. After continuous collection on the Internet to see how others did it, the following basic monitoring was done.

Share a picture

Share a picture

The most important thing to monitor is data. Everything is data. You can monitor whatever you want with data. So what data is important? How to obtain this data? Monitoring indicators are especially important.

Monitoring indicators of Zookeeper (collected on the Internet, and add them when you encounter special ones in actual situations)

< img alt="Share pictures" src="/wp-content/uploads/images/opensource/zookeeper/1626812899403.png">

I realize these monitoring indicators It is implemented through Zabbix’s custom script, the script address: https://github.com/Lemon-le/Zookeeper-Monitor-Zabbix

The fourth version of Zookeeper is used. Use the word command to obtain the relevant indicators. Put the zookeeper_mntr.sh and zookeeper_ruok.sh scripts on the machine with the Zookeeper service respectively. My path is: /etc/zabbix/zabbix_agentd.d/shell-script directory, put zookeeper .conf is placed in the /etc/zabbix/zabbix_agentd.d/ directory, and then restart zabbix-agent on the Zookeeper server

share picturet.

Import the template on Zabbix, import the Zookeeper_template.xml file above, and then connect the template to the Zookeeper server

Share a picture

You can see the monitoring items are:

share picture

Trigger:

share picture

When doing Zookeeper monitoring, the following problems were found. Use ps to check if the zookeeper process exists Yes, the port also exists, but its status is wrong, and the use of four-character commands is also wrong

[[emailprotected]10-10-1-< span style="color: #800080;">2 bin]# ./zkServer.sh status

ZooKeeper JMX enabled by default
Using config:
/data/zookeeper-3.4.13/bin/../conf/zoo.cfg
Error contacting service. It is probably not running.

[[emailprotected]10-10-1-2 bin]# ./zkServer.sh status

ZooKeeper JMX enabled by default
Using config:
/data/zookeeper-3.4.13/bin/../conf/zoo.cfg
Error contacting service. It is probably not running.

The above error is verified by Zookeeper’s 2888 and 3888 port security The group is not opened, but I don’t know why only one reported an error, and two elected leaders and followers

[[emailprotected]172-30-36-< span style="color: #800080;">157 bin]# echo mntr|nc 10.10.1.2 2181

This ZooKeeper instance is not currently serving requests

[[emailprotected]172-30-36-157 bin]# echo mntr|nc 10.10 .1.2 2181

This ZooKeeper instance is not currently serving requests

Note: When monitoring Zookeeper, you can’t just use the monitoring port to keep it out of existence, you have to monitor the status to truly know whether it’s normal
p>

The saying that quantitative changes produce qualitative changes is justified. Knowledge is also a big problem. We have been collecting and collecting monitoring indicators, but I just don’t know which ones are important. No matter how much you look at, no matter how much you check, you still have to do it.

The above monitoring is only a very basic part. Record it. One is a summary of your own mental journey, but a small thing has been completed, and it has been completed with results. There will be a little sense of accomplishment and will increase your confidence.

Leave a Comment

Your email address will not be published.