安装配置CMAK(kafka manager)
安装配置CMAK(kafka manager)
CMAK (Cluster Manager for Apache Kafka, previously known as Kafka Manager)
从releases下载最新的二进制版本,从3.0.0.2版,提供编译好的二进制版本
wget https://github.com/yahoo/CMAK/releases/download/3.0.0.5/cmak-3.0.0.5.zip
Requirements
- Kafka
- Java 11+
1. 添加系统账号
groupadd cmak
useradd -M -s /sbin/nologin -g cmak -d /usr/local/cmak cmak
2. 解包安装
unzip cmak-3.0.0.5.zip -d /usr/local/
cd /usr/local
ln -s cmak-3.0.0.5 cmak
chown -R cmak:cmak cmak cmak-3.0.0.5
3. 编辑配置 conf/application.conf 并且新建 application.ini
cmak.zkhosts="zk1:2181,zk2:2181,zk3:2181"
basicAuthentication.enabled=true
basicAuthentication.username="admin"
basicAuthentication.password="password"
-Dapplication.home=/usr/local/cmak
-Dpidfile.path=/usr/local/cmak/cmak.pid
-Dhttp.port=9000
4. 使用systemd管理进程
vim /usr/lib/systemd/system/cmak.service
[Unit]
Description=Kafka Manager ( CMAK )
Requires=network.target
After=network.target
[Service]
Type=simple
User=cmak
Group=cmak
WorkingDirectory=/usr/local/cmak
ExecStart=/usr/local/cmak/bin/cmak -java-home /usr/java/jdk-11.0.10
ExecStop=kill $(cat /usr/local/cmak/cmak.pid)
Restart=always
[Install]
WantedBy=multi-user.target
如果kafka未使用systemd管理,请注释掉[Unit]部分
5. systemctl管理命令
# 开机自启动
systemctl enable cmak
# 重启服务
systemctl restart cmak
6. 使用浏览器访问
http://ip:9000/
帐号和密码见conf/application.conf