赞
踩
1、环境说明
操作系统:centos 7.9
JDK版本:11.0.12
JDK下载地址:
https://www.oracle.com/java/technologies/javase-jdk11-downloads.html
CMAK版本:3.0.0.5
CMAK下载地址:
https://github.com/yahoo/CMAK/releases/tag/3.0.0.5
2、jdk安装
参考
https://blog.csdn.net/zyj81092211/article/details/118055068
3、配置kafka集群
搭建部分参考:
kafka集群搭建
https://blog.csdn.net/zyj81092211/article/details/119326105
kafka connect 分布式部署
https://blog.csdn.net/zyj81092211/article/details/119647591
在原有配置文件上添加如下配置
(1)kafka开启JMX(CMKA监控用)
所有节点,在kafka bin目录下,修改kafka-server-start.sh 文件,最上方添加如下:
if [ "x$JMX_PORT" = "x" ]; then
export JMX_PORT="9999"
fi
重新启动kafka
kafka-server-stop.sh
kafka-server-start.sh -daemon /data/kafka/config/server.properties
(2)kafka添加删除topic参数
在所有节点 conf目录下,修改server.properties,添加如下:
delete.topic.enable=true
auto.create.topics.enable=true
重新启动kafka
kafka-server-stop.sh
kafka-server-start.sh -daemon /data/kafka/config/server.properties
4、上传CMAK软件包,并重名cmak,路径/usr/local下
5、配置CMAK环境变量
vi /etc/profile
添加如下:
# cmak environment
export CMAK_HOME=/data/kafka-connect
export PATH=$PATH:$CMAK_HOME/bin
重新加载环境变量:
source /etc/profile
6、更改cmak配置文件
conf/application.conf
内容如下:
# Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0 # See accompanying LICENSE file. # This is the main configuration file for the application. # ~~~~~ # Secret key # ~~~~~ # The secret key is used to secure cryptographics functions. # If you deploy your application to several instances be sure to use the same key! play.crypto.secret="^<csmm5Fx4d=r2HEX8pelM3iBkFVv?k[mc;IZE<_Qoq8EkX_/7@Zt6dP05Pzea3U" play.crypto.secret=${?APPLICATION_SECRET} play.http.session.maxAge="1h" # The application languages # ~~~~~ play.i18n.langs=["en"] play.http.requestHandler = "play.http.DefaultHttpRequestHandler" play.http.context = "/" play.application.loader=loader.KafkaManagerLoader # Settings prefixed with 'kafka-manager.' will be deprecated, use 'cmak.' instead. # https://github.com/yahoo/CMAK/issues/713 kafka-manager.zkhosts="zk01.wtown.com:2181,zk02.wtown.com:2181,zk03.wtown.com:2181" kafka-manager.zkhosts=${?ZK_HOSTS} cmak.zkhosts="zk01.wtown.com:2181,zk02.wtown.com:2181,zk03.wtown.com:2181" cmak.zkhosts=${?ZK_HOSTS} pinned-dispatcher.type="PinnedDispatcher" pinned-dispatcher.executor="thread-pool-executor" application.features=["KMClusterManagerFeature","KMTopicManagerFeature","KMPreferredReplicaElectionFeature","KMReassignPartitionsFeature", "KMScheduleLeaderElectionFeature"] akka { loggers = ["akka.event.slf4j.Slf4jLogger"] loglevel = "INFO" } akka.logger-startup-timeout = 60s basicAuthentication.enabled=true basicAuthentication.enabled=${?KAFKA_MANAGER_AUTH_ENABLED} basicAuthentication.ldap.enabled=false basicAuthentication.ldap.enabled=${?KAFKA_MANAGER_LDAP_ENABLED} basicAuthentication.ldap.server="" basicAuthentication.ldap.server=${?KAFKA_MANAGER_LDAP_SERVER} basicAuthentication.ldap.port=389 basicAuthentication.ldap.port=${?KAFKA_MANAGER_LDAP_PORT} basicAuthentication.ldap.username="" basicAuthentication.ldap.username=${?KAFKA_MANAGER_LDAP_USERNAME} basicAuthentication.ldap.password="" basicAuthentication.ldap.password=${?KAFKA_MANAGER_LDAP_PASSWORD} basicAuthentication.ldap.search-base-dn="" basicAuthentication.ldap.search-base-dn=${?KAFKA_MANAGER_LDAP_SEARCH_BASE_DN} basicAuthentication.ldap.search-filter="(uid=$capturedLogin$)" basicAuthentication.ldap.search-filter=${?KAFKA_MANAGER_LDAP_SEARCH_FILTER} basicAuthentication.ldap.group-filter="" basicAuthentication.ldap.group-filter=${?KAFKA_MANAGER_LDAP_GROUP_FILTER} basicAuthentication.ldap.connection-pool-size=10 basicAuthentication.ldap.connection-pool-size=${?KAFKA_MANAGER_LDAP_CONNECTION_POOL_SIZE} basicAuthentication.ldap.ssl=false basicAuthentication.ldap.ssl=${?KAFKA_MANAGER_LDAP_SSL} basicAuthentication.ldap.ssl-trust-all=false basicAuthentication.ldap.ssl-trust-all=${?KAFKA_MANAGER_LDAP_SSL_TRUST_ALL} basicAuthentication.username="admin" basicAuthentication.username=${?KAFKA_MANAGER_USERNAME} basicAuthentication.password="Smtgbk_123" basicAuthentication.password=${?KAFKA_MANAGER_PASSWORD} basicAuthentication.realm="Kafka-Manager" basicAuthentication.excluded=["/api/health"] # ping the health of your instance without authentification kafka-manager.consumer.properties.file=${?CONSUMER_PROPERTIES_FILE}
7、启动cmak
cmak -Dconfig.file=/usr/local/cmak/conf/application.conf -Dapplication.home=/usr/local/cmak -Dhttp.port=9000 >> /dev/null 2>&1 &
启动报错参考:
https://github.com/yahoo/CMAK/issues/298
8、访问服务器9000端口
输入配置文件的用户名密码
9、添加集群
显示添加成功
10、界面介绍
topic页面
运行信息
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。