当前位置: 首页 > 腾讯云优惠>> Centos7下安装kafka-manager具体方法

Centos7下安装kafka-manager具体方法

Centos7下安装kafka-manager具体方法

Kafka-manager 是雅虎开源的apache-kafka管理工具,是用Scala写,所以在web页面进行操作即可,本篇文章重点为大家介绍一下Centos7下安装kafka-manager具体方法。

安装

当前版本已更新至3.0.0.1,本次安装最新版本。

下载源码包:https://github.com/yahoo/kafka-manager/releases (不同版本)

克隆源代码:git clone https://github.com/yahoo/CMAK.git (最新版本)

编译

根据README提示,新版本编译依赖java-11,所以首先要准备java-11环境(直接到官网下载解压即可)。

使用sbt编译

进入源码目录进行编译。

/path/to/cmak/sbt -java-home /path/to/java-11 clean dist  

-java-home:在系统环境java版本和当前需要java版本不一致时,使用该参数指定java家目录。

这是一个漫长的过程,耐心等待…

编译完成后会提示,编译好的文件保存到了:/path/to/cmak/target/universal/cmak-3.0.0.1.zip

配置

将上述cmak-3.0.0.1.zip文件拷贝到/path/to/kafka-manager 目录下,解压。修改配置文件 conf/application.conf:

kafka-manager.zkhosts="my.zookeeper.host.com:2181,other.zookeeper.host.com:2181"    cmak.zkhosts="my.zookeeper.host.com:2181,other.zookeeper.host.com:2181"  

kafka-manager支持ldap认证,这里不做详述。

启动

默认使用9000端口,如果端口占用,可以指定端口。

bin/cmak -Dconfig.file=conf/application.conf -java-home /path/to/jdk-11 -Dhttp.port=9001  

到浏览器访问 http://ip:9001 即可。

创建kafka集群

使用systemctl管理kafka-manager服务

创建文件 /usr/lib/systemd/system/kafka-manager.service :

[Unit]  Description=kafka-manager server service  After=network.target    [Service]  WorkingDirectory=/path/to/kafka-manager/cmak-3.0.0.1  ExecStart=/path/to/kafka-manager/cmak-3.0.0.1/bin/cmak -Dconfig.file=/path/to/kafka-manager/cmak-3.0.0.1/conf/application.conf -java-home /path/to/jdk-11.0.6 -Dhttp.port=9001  Restart=on-failure  RestartSec=60  User=work  Group=work    [Install]  WantedBy=multi-user.target  

完成上述配置后,执行 systemctl daemon-reload 。

启动、停止、重启

$ systemctl start kafka-manager  $ systemctl stop kafka-manager  $ systemctl restart kafka-manager  

# 加入开机启动

$ systemctl enable kafka-manager  

配置日志切割

/path/to/kafka-manager/cmak-3.0.0.1/logs/application.log {     daily     rotate 10     dateext     missingok     notifempty  }  

本文来源:www.lxlinux.net/4829.html,若引用不当,请联系修改。


服务器购买/咨询热线:1563700917115617636856

本文链接:http://43.134.181.216/tengxunyunfuwuqi/22405.html
tags:
腾讯云服务器特惠

  • 关注微信
是否收录:

猜你喜欢

热门标签

关注我们

微信公众号