博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
07【在线日志分析】之kafka-manager监控工具的搭建(sbt安装与编译)
阅读量:5737 次
发布时间:2019-06-18

本文共 4087 字,大约阅读时间需要 13 分钟。

1.下载sbt

[root@sht-sgmhadoopnn-01 app]# rz

rz waiting to receive.
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring sbt-0.13.13.tgz...
  100%    1025 KB    1025 KB/sec    00:00:01       0 Errors 

2.解压

[root@sht-sgmhadoopnn-01 app]# tar -zxvf sbt-0.13.13.tgz
sbt-launcher-packaging-0.13.13/
sbt-launcher-packaging-0.13.13/conf/
sbt-launcher-packaging-0.13.13/conf/sbtconfig.txt
sbt-launcher-packaging-0.13.13/conf/sbtopts
sbt-launcher-packaging-0.13.13/bin/
sbt-launcher-packaging-0.13.13/bin/sbt.bat
sbt-launcher-packaging-0.13.13/bin/sbt
sbt-launcher-packaging-0.13.13/bin/sbt-launch.jar
sbt-launcher-packaging-0.13.13/bin/sbt-launch-lib.bash
[root@sht-sgmhadoopnn-01 app]# mv sbt-launcher-packaging-0.13.13 sbt

3.添加脚本文件

[root@sht-sgmhadoopnn-01 bin]# vi sbt
#!/usr/bin/env bash

BT_OPTS="-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M"

java $SBT_OPTS -jar /root/learnproject/app/sbt/bin/sbt-launch.jar "$@"

4.修改权限和环境变量
[root@sht-sgmhadoopnn-01 bin]# chmod u+x sbt

[root@sht-sgmhadoopnn-01 bin]# vi /etc/profile

export SBT_HOME=/root/learnproject/app/sbt

export PATH=$SBT_HOME/bin:$SPARK_HOME/bin:$SCALA_HOME/bin:$HADOOP_HOME/bin:$MAVEN_HOME/bin:$JAVA_HOME/bin:$PATH

"/etc/profile" 94L, 2265C written
[root@sht-sgmhadoopnn-01 bin]# source /etc/profile

5.测试
/*第一次执行时,会下载一些文件包,然后才能正常使用,要确保联网了,安装成功后显示如下*/
[root@sht-sgmhadoopnn-01 bin]# sbt sbt-version
[info] Set current project to bin (in build file:/root/learnproject/app/sbt/bin/)
[info] 0.13.13
[info] Set current project to bin (in build file:/root/learnproject/app/sbt/bin/)
[info] 0.13.13
[root@sht-sgmhadoopnn-01 bin]#

 

---------------------------------------------------------------------------------------------

因为kafka-manager编译需要jdk1.8
 1.安装jdk1.8
[root@sht-sgmhadoopnn-01 app]# cd /usr/java
[root@sht-sgmhadoopnn-01 java]# ll
total 4
drwxr-xr-x 8 root root 4096 Nov 17  2015 jdk1.7.0_67-cloudera
[root@sht-sgmhadoopnn-01 java]# rz
rz waiting to receive.
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring jdk-8u102-linux-x64.tar.gz...
  100%  177183 KB     425 KB/sec    00:06:56       0 Errors 

[root@sht-sgmhadoopnn-01 java]# ll

total 177192
drwxr-xr-x 8 root root      4096 Nov 17  2015 jdk1.7.0_67-cloudera
-rw-r--r-- 1 root root 181435897 Jun 28 00:02 jdk-8u102-linux-x64.tar.gz
[root@sht-sgmhadoopnn-01 java]# tar -xzvf jdk-8u102-linux-x64.tar.gz

 

[root@sht-sgmhadoopnn-01 java]# vi /etc/profile

export PATH=/usr/java/jdk1.8.0_102/bin:$SBT_HOME/bin:$SPARK_HOME/bin:$SCALA_HOME/bin:$HADOOP_HOME/bin:$MAVEN_HOME/bin:$JAVA_HOME/bin:$PATH

[root@sht-sgmhadoopnn-01 java]# source /etc/profile

 

---------------------------------------------------------------------------------------------

Requirements:

 Kafka 0.8.1.1 or 0.8.2.* or 0.9.0.*
 Java 8+

1.下载,使用sbt编绎

[root@sht-sgmhadoopnn-01 ~]# cd /root/learnproject/compilesoft
[root@sht-sgmhadoopnn-01 compilesoft]# git clone
[root@sht-sgmhadoopnn-01 compilesoft]# cd kafka-manager/

[root@sht-sgmhadoopnn-01 kafka-manager]# sbt clean dist

[info] Your package is ready in /root/learnproject/compilesoft/kafka-manager/target/universal/kafka-manager-1.3.2.1.zip
[info]
[success] Total time: 126 s, completed Dec 26, 2016 2:44:17 PM

2.解压
[root@sht-sgmhadoopnn-01 kafka-manager]# mv /root/learnproject/compilesoft/kafka-manager/target/universal/kafka-manager-1.3.2.1.zip /root/learnproject/app/
[root@sht-sgmhadoopnn-01 kafka-manager]# cd ../

[root@sht-sgmhadoopnn-01 app]# unzip kafka-manager-1.3.2.1.zip

[root@sht-sgmhadoopnn-01 app]# cd kafka-manager-1.3.2.1/conf
[root@sht-sgmhadoopnn-01 conf]# vi application.conf
kafka-manager.zkhosts="172.16.101.58:2181,172.16.101.59:2181,172.16.101.60:2181/kafka"

3.后台运行

[root@sht-sgmhadoopnn-01 kafka-manager-1.3.2.1]# nohup ./bin/kafka-manager -Dconfig.file=./conf/application.conf -Dhttp.port=9999 -java-home /usr/java/jdk1.8.0_102 >kafka-manager.log 2>&1 &

4.添加Cluster

a.Add Cluster

   Cluster Name: onlinelog_analysis_kafkacluster
   Cluster Zookeeper Hosts: 172.16.101.58:2181,172.16.101.59:2181,172.16.101.60:2181/kafka
   勾选上 Enable JMX Polling (Set JMX_PORT env variable before starting kafka server)
   再勾选下方的指标信息(参考截图)

   单击Save按钮

 b.Brokers

 

 

转载地址:http://hbwzx.baihongyu.com/

你可能感兴趣的文章
Linux的netstat命令使用
查看>>
shell实例100例《五》
查看>>
lvm讲解,磁盘故障小案例
查看>>
24.5 saltstack远程执行命令
查看>>
大快网站:如何选择正确的hadoop版本
查看>>
经过这5大阶段,你离Java程序员就不远了!
查看>>
Nginx配置文件相关操作
查看>>
IntelliJ IDEA 连接数据库详细过程
查看>>
thymeleaf 学习笔记-基础篇
查看>>
分享话题列表
查看>>
PHP-X开发扩展
查看>>
android学习笔记——onSaveInstanceState的使用
查看>>
Windows Server 2003下cwRsyncServer服务端与cwRsync客户端数据
查看>>
iOS 打包上传没有用到日历,但是提示需要在info.plist文件中加入NSCalendarsUsageDescription...
查看>>
工作中如何做好技术积累
查看>>
怎么用sysLinux做U盘双PE+DOS??
查看>>
Spring Transactional
查看>>
shell脚本实例
查看>>
我的友情链接
查看>>
Windows Phone 7 隔离存储空间资源管理器
查看>>