Exhibitor监控监视zookeeper节点状态和数据变化
Windows环境下Exhibitor监控监视zookeeper节点状态和数据变化
监控监视zookeeper节点数据变化,原生的做法在通过zkCli连接zookeeper服务器,然后通过敲命令查看zookeeper集群中的状态变化。这种方法比较麻烦,效率比较低,更关键的是不直观和形象。
现在通过开源的Exhibitor监控zookeeper状态变化。Exhibitor是github上的开源项目:
https://github.com/soabase/exhibitor
把Exhibitor的项目源代码拉下来,然后用maven编译。
1,从github上下载Exhibitor,解压文件。得到:
2,用maven编译Exhibitor源代码。如果当前环境下没有配置maven,需要搭建maven编译环境。从maven的官网下载maven的二进制包:https://archive.apache.org/dist/maven/maven-3/3.6.1/binaries/
本文基于maven-3.6.1。解压apache-maven-3.6.1-bin.zip文件。设置maven的编译环境,我简单写一个Windows下的bat文件设置而非修改Windows操作系统的环境变量。
set JAVA_HOME=D:\Java
set MAVEN_HOME=E:\code\apache-maven-3.6.1
set path=C:\Windows\System32;%JAVA_HOME%\bin;%MAVEN_HOME%\bin;
start cls
将以上设置保存为.bat文件。
3,点击第2步的.bat文件,一步一步cd命令进入到第1步下载的Exhibitor代码包里面的路径 \exhibitor-master\exhibitor-master\exhibitor-standalone\src\main\resources\buildscripts\standalone\maven
或者直接把第2步的bat文件放到该目录(\exhibitor-master\exhibitor-master\exhibitor-standalone\src\main\resources\buildscripts\standalone\maven)下,然后点击运行该bat文件,开始执行具体的maven编译,输入命令:
mvn clean package
如图:
若编译成功,会在maven下一级形成一个target目录文件夹:
其中exhibitor-1.6.0.jar既是我们想要的最终可执行jar文件,运行该exhibitor-1.6.0.jar文件:
java -jar exhibitor-1.6.0.jar -c file
如图:
启动exhibitor-1.6.0.jar成功后,即可在浏览器输入地址:127.0.0.1:8080监视监控zookeeper:
还没有评论,来说两句吧...