Zookeeper界面管理神器——zkui

Zookeeper的应用场景很丰富,要查看zk中的数据,一般是通过Zookeeper命令行进行,如下操作,用过的朋友应该比较熟悉,不够直观,特别是面向业务人员操作的一些功能,完全不可行。
appledeMacBook-Air:zkui apple$ cd ../zookeeper-3.4.10/bin
appledeMacBook-Air:bin apple$ ./zkCli.sh
[zk: localhost:2181(CONNECTED) 0] ls
[zk: localhost:2181(CONNECTED) 1] ls /
[dubbo, zookeeper, test, node1, foo]
[zk: localhost:2181(CONNECTED) 2] 
[zk: localhost:2181(CONNECTED) 2] create -s /node2 node2val
Created /node20000000004
[zk: localhost:2181(CONNECTED) 3] ls /
[dubbo, zookeeper, test, node1, node20000000004, foo]
[zk: localhost:2181(CONNECTED) 4]

本文主角登场——zkui,一个允许针对zookeeper进行增删查改操作的管理界面。

运行要求

Java 7+

安装过程

确保git及maven已提前配置完毕,否则先完成这两个的环境配置。 1、Clone到本地

appledeMacBook-Air:software apple$ git clone https://github.com/DeemOpen/zkui.git
Cloning into 'zkui'...
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 527 (delta 0), reused 0 (delta 0), pack-reused 526
Receiving objects: 100% (527/527), 480.75 KiB | 336.00 KiB/s, done.
Resolving deltas: 100% (217/217), done.

2、mvn构建

appledeMacBook-Air:software apple$ cd zkui/
appledeMacBook-Air:zkui apple$ mvn clean install
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building zkui 2.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
.
.
.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 50.372 s
[INFO] Finished at: 2018-11-21T10:29:24+08:00
[INFO] Final Memory: 31M/277M
[INFO] ------------------------------------------------------------------------

3、复制config.cfg到jar同级目录下,修改zk链接等信息

4、运行jar包

nohup java -jar zkui-2.0-SNAPSHOT-jar-with-dependencies.jar &

5、打开UI地址,默认为http://localhost:9090

提供2个账户,权限不同。 username: admin, pwd: manager (Admin privileges, CRUD operations supported) username: appconfig, pwd: appconfig (Readonly privileges, Read operations supported)

技术栈:

  • Embedded Jetty Server.
  • Freemarker template.
  • H2 DB.
  • Active JDBC.
  • JSON.
  • SLF4J.
  • Zookeeper.
  • Apache Commons File upload.
  • Bootstrap.
  • Jquery.
  • Flyway DB migration.

特性

  • CRUD operation on zookeeper properties.
  • Export properties.
  • Import properties via call back url.
  • Import properties via file upload.
  • History of changes + Path specific history of changes.
  • Search feature.
  • Rest API for accessing Zookeeper properties.
  • Basic Role based authentication.
  • LDAP authentication supported.
  • Root node /zookeeper hidden for safety.
  • ACL supported global level.
  • Import File Format

操作界面截图

License & Contribution

ZKUI is released under the Apache 2.0 license. Comments, bugs, pull requests, and other contributions are all welcomed!

原文发布于微信公众号 - 歪脖贰点零(growithus)

原文发表时间:2018-11-28

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

扫码关注云+社区

领取腾讯云代金券