Kafka Manager
博客专区 > China_OS 的博客 > 博客详情
Kafka Manager
China_OS 发表于3个月前
Kafka Manager
  • 发表于 3个月前
  • 阅读 44
  • 收藏 0
  • 点赞 0
  • 评论 0

腾讯云 新注册用户 域名抢购1元起>>>   

摘要: kafka manager

        kafka manager作为一款在kafka出世不久就被贡献出来的开源kakfa管理软件,相信使用者不在少数,不过这款软件更新总是有点慢,而且缺少安全认证模块,不过鉴于很多中小公司没人力自研kafka管理平台,这款软件还是可以凑合使用的。由于之前公司的kafka早已升级至0.10.0版本,而早起的kafka manager还不支持0.10.0版本,所以只能凑活使用,在kafka manager支持0.10.0版本后,立即更新了kafka manager,本文就是kafka manager的编译安装过程(支持0.10+)。

下载

cd /opt/programs
git clone https://github.com/yahoo/kafka-manager.git

设置环境

    kafka manager依赖java8,如果系统中存在多个java版本的话,先设置环境变量,部署本机的java home在/opt/programs/jdk1.8.0_77

export JAVA_HOME=/opt/programs/jdk1.8.0_77
export PATH=$JAVA_HOME/bin:$PATH

编译

cd /opt/programs/kafka-manager
./sbt rpm:packageBin

    ps:这是一个漫长的过程,因为sbt要越过GFW去拉取相关依赖库,不过可以设置sbt配置,采用国内的源,最终结果如下:

[info] Loading project definition from /opt/programs/kafka-manager/project
Missing bintray credentials /root/.bintray/.credentials. Some bintray features depend on this.
[info] Set current project to kafka-manager (in build file:/opt/programs/kafka-manager/)
Missing bintray credentials /root/.bintray/.credentials. Some bintray features depend on this.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/root/.ivy2/cache/org.slf4j/slf4j-nop/jars/slf4j-nop-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/root/.ivy2/cache/org.slf4j/slf4j-simple/jars/slf4j-simple-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.helpers.NOPLoggerFactory]
[warn] Credentials file /root/.bintray/.credentials does not exist
[info] Wrote /opt/programs/kafka-manager/target/scala-2.11/kafka-manager_2.11-1.3.3.13.pom
Warning: node.js detection failed, sbt will use the Rhino based Trireme JavaScript engine instead to run JavaScript assets compilation, which in some cases may be orders of magnitude slower than using node.js.
[info] Packaging /opt/programs/kafka-manager/target/scala-2.11/kafka-manager_2.11-1.3.3.13-web-assets.jar ...
[info] Done packaging.
[info] Building target platforms: noarch-yahoo-Linux
[info] Building for target noarch-yahoo-Linux
[info] Executing(%install): /bin/sh -e /tmp/sbt_cb7f4bde/rpm-tmp.biBqG2
[error] + umask 022
[error] + cd /opt/programs/kafka-manager/target/rpm/BUILD
[error] + '[' /opt/programs/kafka-manager/target/rpm/buildroot '!=' / ']'
[error] + rm -rf /opt/programs/kafka-manager/target/rpm/buildroot
[error] ++ dirname /opt/programs/kafka-manager/target/rpm/buildroot
[error] + mkdir -p /opt/programs/kafka-manager/target/rpm
[error] + mkdir /opt/programs/kafka-manager/target/rpm/buildroot
[error] + LANG=C
[error] + export LANG
[error] + unset DISPLAY
[error] + '[' -e /opt/programs/kafka-manager/target/rpm/buildroot ']'
[error] + mv /opt/programs/kafka-manager/target/rpm/tmp-buildroot/etc /opt/programs/kafka-manager/target/rpm/tmp-buildroot/usr /opt/programs/kafka-manager/target/rpm/tmp-buildroot/var /opt/programs/kafka-manager/target/rpm/buildroot
[error] + /usr/lib/rpm/check-buildroot
[error] + /usr/lib/rpm/brp-compress
[error] + /usr/lib/rpm/brp-strip /usr/bin/strip
[error] + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
[error] + /usr/lib/rpm/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
[info] Processing files: kafka-manager-1.3.3.13-1.noarch
[info] Provides: config(kafka-manager) = 1.3.3.13-1
[info] Requires(interp): /bin/sh /bin/sh /bin/sh /bin/sh
[info] Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
[info] Requires(pre): /bin/sh
[info] Requires(post): /bin/sh
[info] Requires(preun): /bin/sh
[info] Requires(postun): /bin/sh
[info] Checking for unpackaged file(s): /usr/lib/rpm/check-files /opt/programs/kafka-manager/target/rpm/buildroot
[info] Wrote: /opt/programs/kafka-manager/target/rpm/RPMS/noarch/kafka-manager-1.3.3.13-1.noarch.rpm
[info] Executing(%clean): /bin/sh -e /tmp/sbt_cb7f4bde/rpm-tmp.3qbHaE
[error] + umask 022
[error] + cd /opt/programs/kafka-manager/target/rpm/BUILD
[error] + /bin/rm -rf /opt/programs/kafka-manager/target/rpm/buildroot
[error] + exit 0
[success] Total time: 26 s, completed Aug 29, 2017 8:14:00 PM

    ps:编译好的rpm包在/opt/programs/kafka-manager/target/rpm/RPMS/noarch目录下(kafka-manager-1.3.3.13-1.noarch.rpm),把编译好的包上传到安装远程机器上。

部署

rpm -Uvh kafka-manager-1.3.3.13-1.noarch.rpm

    ps:因为本机上之前就有kafka manager的rpm包,不过版本较老,本次采用rpm升级命令。

调整配置

    创建etc配置目录

cd /etc
ln -s /usr/share/kafka-manager/conf kafka-manager

    修改kafka manager配置(/etc/kafka-manager/application.conf)

#Your kafka zk address
kafka-manager.zkhosts="ip:port,ip:port,ip:port"

    修改/etc/init.d/kafka-manager启动脚本

# add JAVA_HOME
export JAVA_HOME=/opt/programs/jdk1.8.0_77

    修改/etc/default/kafka-manager

# Setting JAVA_OPTS
# -----------------
JAVA_OPTS="-Dpidfile.path=/tmp/kafka-manager/kafka-manager.pid -Dconfig.file=/etc/kafka-manager/application.conf -Dlogger.file=/etc/kafka-manager/logger.xml $JAVA_OPTS -Dhttp.port=8000 -Dhttp.host=10.205.8.176"

# Setting PIDFILE
# ---------------
PIDFILE="/tmp/kafka-manager/kafka-manager.pid"

    创建临时目录

mkdir -p /tmp/kafka-manager
chown kafka-manager:kafka-manager /tmp/kafka-manager

    启动

/etc/init.d/kafka-manager start

查看

 

 

共有 人打赏支持
粉丝 392
博文 377
码字总数 482277
×
China_OS
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: