安装kafka manager

[root@emm-kafka01-10--174 ~]# cd /opt/ins/
[root@emm-kafka01-10--174 ins]# ll
total 292188
-rwxr-xr-x 1 root root 166044032 Mar 13 15:58 jdk-8u102-linux-x64.rpm
-rw-r--r-- 1 root root  50326212 Mar 13 16:14 kafka_2.12-1.1.0.tgz
-rw-r--r-- 1 root root  60561847 Mar 14 11:06 kafka-manager-1.3.3.7.zip
-rw-r--r-- 1 root root  22261552 Mar 13 16:14 zookeeper-3.4.8.tar.gz
[root@emm-kafka01-10--174 ins]# unzip kafka-manager-1.3.3.7.zip -d /usr/local/   
[root@emm-kafka01-10--174 local]# ln -s kafka-manager-1.3.3.7/ kafka-manager
[root@emm-kafka01-10--174 local]# ll
total 4
drwxr-xr-x.  2 root root    6 Apr 11  2018 bin
drwxr-xr-x.  2 root root    6 Apr 11  2018 etc
drwxr-xr-x.  2 root root    6 Apr 11  2018 games
drwxr-xr-x.  2 root root    6 Apr 11  2018 include
lrwxrwxrwx   1 root root   17 Mar 14 09:51 kafka -> kafka_2.12-1.1.0/
drwxr-xr-x   7 root root   94 Mar 14 10:12 kafka_2.12-1.1.0
lrwxrwxrwx   1 root root   22 Mar 14 11:08 kafka-manager -> kafka-manager-1.3.3.7/
drwxr-xr-x   6 root root   65 Mar 14 11:07 kafka-manager-1.3.3.7
drwxr-xr-x.  2 root root    6 Apr 11  2018 lib
drwxr-xr-x.  2 root root    6 Apr 11  2018 lib64
drwxr-xr-x.  2 root root    6 Apr 11  2018 libexec
drwxr-xr-x.  2 root root    6 Apr 11  2018 sbin
drwxr-xr-x.  5 root root   46 Apr 11  2018 share
drwxr-xr-x.  2 root root    6 Nov 12 13:03 src
lrwxrwxrwx   1 root root   15 Mar 13 18:20 zookeeper -> zookeeper-3.4.8
drwxr-xr-x  11 root root 4096 Mar 13 18:22 zookeeper-3.4.8
[root@emm-kafka01-10--174 conf]# pwd
/usr/local/kafka-manager/conf
[root@emm-kafka01-10--174 conf]# ll
total 24
-rw-r--r-- 1 root root 1381 Jun 18  2017 application.conf
-rw-r--r-- 1 root root   27 Jun  5  2017 consumer.properties
-rw-r--r-- 1 root root 2108 Jun  5  2017 logback.xml
-rw-r--r-- 1 root root 1367 Jun  5  2017 logger.xml
-rw-r--r-- 1 root root 7423 Jun  5  2017 routes
[root@emm-kafka01-10--174 conf]# vim application.conf
把kafka-manager.zkhosts="localhost:2181" 修改成如下:
kafka-manager.zkhosts="10.2.10.174:2181,10.2.10.175:2181,10.2.10.176:2181"
其他的不要动

启动kafka-manager
[root@emm-kafka01-10--174 kafka-manager]# nohup bin/kafka-manager -Dconfig.file=/usr/local/kafka-manager/conf/application.conf -Dhttp.port=8080 &
[3] 1600
[root@emm-kafka01-10--174 kafka-manager]# nohup: ignoring input and appending output to ‘nohup.out’

[root@emm-kafka01-10--174 kafka-manager]# netstat -lntup|grep 8080
tcp6       0      0 :::8080                 :::*                    LISTEN      1600/java 

设置环境变量

vim /etc/profile
添加如下内容
export PATH=/usr/local/kafka/bin:/usr/local/kafka-manager/bin:/usr/local/zookeeper/bin:$PATH
source /etc/profile
[root@emm-kafka01-10--174 bin]# which kafka-manager 
/usr/local/kafka-manager/bin/kafka-manager

kafka-manager的启动脚本

[root@emm-kafka01-10--174 scripts]# chmod +x kafkamanagerstart.sh 
[root@emm-kafka01-10--174 scripts]# cat kafkamanagerstart.sh 
#!/bin/bash
source /etc/profile

nohup /usr/local/kafka-manager/bin/kafka-manager -Dconfig.file=/usr/local/kafka-manager/conf/application.conf -Dhttp.port=8080 &

[root@emm-kafka01-10--174 scripts]# sh kafkamanagerstart.sh 
[root@emm-kafka01-10--174 scripts]# nohup: appending output to ‘nohup.out’
[root@emm-kafka01-10--174 scripts]# netstat -lntup|grep 8080
tcp6       0      0 :::8080                 :::*                    LISTEN      2727/java     

设置开机自启动

[root@emm-kafka01-10--174 scripts]# chmod +x /etc/rc.d/rc.local
[root@emm-kafka01-10--174 scripts]# echo "/usr/bin/sh /opt/scripts/kafkamanagerstart.sh" >>/etc/rc.d/rc.local 

启动后,从浏览器打开,显示如下 参考此链接: https://blog.csdn.net/isea533/article/details/73727485