doina

一个小菜鸟运维工程师.

Zookeeper界面管理工具ZKUI部署

部署zk

安装jdk环境

$ yum -y install java
$ java -version
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (build 25.232-b09, mixed mode)

$ vim /etc/profile
### JAVA ENV ###
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.x86_64/jre
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar 
export PATH=${PATH}:${JAVA_HOME}/jre/bin 

$ source /etc/profile

$ echo $JAVA_HOME       
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.x86_64

安装Zookeeper

$ wget http://mirrors.hust.edu.cn/apache/zookeeper/zookeeper-3.4.14/apache-zookeeper-3.4.14.tar.gz
$ tar zxf apache-zookeeper-3.4.14.tar.gz 
$ mv apache-zookeeper-3.4.14 /usr/local/zookeeper
$ mkdir -p /data/zookeeper/{data,logs}

$ cd /usr/local/zookeeper/conf
$ cat > zoo.cfg  << EOF
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/data/zookeeper/data
dataLogDir=/data/zookeeper/logs
clientPort=2181
EOF

$ vim /etc/profile
### Zookeeper ENV ###
export ZOOKEEPER_HOME=/usr/local/zookeeper
export PATH=${PATH}:${ZOOKEEPER_HOME}/bin


$ source /etc/profile  

$ /usr/local/zookeeper/bin/zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

启动停止命令

/usr/local/zookeeper/bin/zkServer.sh start

/usr/local/zookeeper/bin/zkServer.sh status

/usr/local/zookeeper/bin/zkServer.sh stop

测试Zookeeper

$ telnet 192.168.109.128 2181
Trying 192.168.109.128...
Connected to 192.168.109.128.
Escape character is '^]'.
stat    //stat为输入的命令
Zookeeper version: 3.4.14-4c25d480e66aadd371de8bd2fd8da255ac140bcf, built on 03/06/2019 16:18 GMT
Clients:
 /192.168.109.128:59868[0](queued=0,recved=1,sent=0)

Latency min/avg/max: 0/0/0
Received: 2
Sent: 1
Connections: 1
Outstanding: 0
Zxid: 0x0
Mode: standalone
Node count: 4
Connection closed by foreign host.

部署zk ui

  • github地址: https://github.com/DeemOpen/zkui

安装maven

$ wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
$ yum -y install git apache-maven

$ mvn -version
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T15:58:13+08:00)
Maven home: /usr/share/apache-maven
Java version: 1.8.0_232, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-1062.el7.x86_64", arch: "amd64", family: "unix"

下载源码并编译

$ git clone https://github.com/DeemOpen/zkui.git
$ cd zkui
$ mvn clean install
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:45 min
[INFO] Finished at: 2019-11-16T13:55:01+08:00
[INFO] Final Memory: 28M/182M
[INFO] ------------------------------------------------------------------------

修改配置并启动

$ vim config.cfg
zkServer=192.168.109.128:2181

$ nohup java -jar target/zkui-2.0-SNAPSHOT-jar-with-dependencies.jar &
$ ps -ef|grep zkui
root  49353  20674 38 14:01 pts/0  00:00:04 java -jar target/zkui-2.0-SNAPSHOT-jar-with-dependencies.jar

登录账号
– username:admin
– password:manager

《Zookeeper界面管理工具ZKUI部署》

《Zookeeper界面管理工具ZKUI部署》

点赞

发表评论

电子邮件地址不会被公开。

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据