为了能够方便的查看及管理Kafka集群,yahoo提供了一个基于Web的管理工具(Kafka-Manager)。

这个工具可以方便的查看集群中Kafka的Topic的状态(分区、副本及消息量等),支持管理多个集群、重新分配Partition及创建Topic等功能。

jdk、sbt自行安装吧

sbt源可参考:https://www.cnblogs.com/felixzh/p/10255145.html

Deployment

The command below will create a zip file which can be used to deploy the application.

./sbt clean dist

演示:
root@root:~/Downloads/kafka-manager-1.3.3.22# ./sbt clean dist
[info] Loading project definition from /root/Downloads/kafka-manager-1.3.3.22/project
[info] Updating {file:/root/Downloads/kafka-manager-1.3.3.22/project/}kafka-manager-1-3-3-22-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
Missing bintray credentials /root/.bintray/.credentials. Some bintray features depend on this.
[info] Set current project to kafka-manager (in build file:/root/Downloads/kafka-manager-1.3.3.22/)
Missing bintray credentials /root/.bintray/.credentials. Some bintray features depend on this.
[warn] Credentials file /root/.bintray/.credentials does not exist
[success] Total time: 0 s, completed Jan 11, 2019 2:26:32 PM
[warn] Credentials file /root/.bintray/.credentials does not exist
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]
[info] Packaging /root/Downloads/kafka-manager-1.3.3.22/target/scala-2.11/kafka-manager_2.11-1.3.3.22-sources.jar ...
[info] Done packaging.
[info] Updating {file:/root/Downloads/kafka-manager-1.3.3.22/}root...
[info] Resolving org.apache.curator#curator-framework;2.10.0 ...
Warning: node.js detection failed, sbt will use the Rhino based Trireme JavaScript engine instead to run JavaScript assets[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[warn] Scala version was updated by one of library dependencies:
[warn] * org.scala-lang:scala-library:(2.11.6, 2.11.8, 2.11.11, 2.11.7, 2.11.5, 2.11.0) -> 2.11.12
[warn] To force scalaVersion, add the following:
[warn] ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }
[warn] There may be incompatibilities among your library dependencies.
[warn] Here are some of the libraries that were evicted:
[warn] * org.webjars:jquery:1.11.1 -> 2.1.4
[warn] Run 'evicted' to see detailed eviction warnings
[info] Wrote /root/Downloads/kafka-manager-1.3.3.22/target/scala-2.11/kafka-manager_2.11-1.3.3.22.pom
[info] Main Scala API documentation to /root/Downloads/kafka-manager-1.3.3.22/target/scala-2.11/api...
[info] Compiling 127 Scala sources and 2 Java sources to /root/Downloads/kafka-manager-1.3.3.22/target/scala-2.11/classes...
[info] LESS compiling on 1 source(s)
[info] Packaging /root/Downloads/kafka-manager-1.3.3.22/target/scala-2.11/kafka-manager_2.11-1.3.3.22-web-assets.jar ...
[info] Done packaging.
model contains 709 documentable templates
[info] Main Scala API documentation successful.
[info] Packaging /root/Downloads/kafka-manager-1.3.3.22/target/scala-2.11/kafka-manager_2.11-1.3.3.22-javadoc.jar ...
[info] Done packaging.
[info] Packaging /root/Downloads/kafka-manager-1.3.3.22/target/scala-2.11/kafka-manager_2.11-1.3.3.22.jar ...
[info] Done packaging.
[info] Packaging /root/Downloads/kafka-manager-1.3.3.22/target/scala-2.11/kafka-manager_2.11-1.3.3.22-sans-externalized.jar ...
[info] Done packaging.
[info]
[info] Your package is ready in /root/Downloads/kafka-manager-1.3.3.22/target/universal/kafka-manager-1.3.3.22.zip
[info]
[success] Total time: 80 s, completed Jan 11, 2019 2:27:52 PM
root@root:~/Downloads/kafka-manager-1.3.3.22# cd /root/Downloads/kafka-manager-1.3.3.22/target/universal/
root@root:~/Downloads/kafka-manager-1.3.3.22/target/universal# ls
kafka-manager-1.3.3.22.zip scripts

Please refer to play framework documentation on production deployment/configuration.

配置

修改conf/application.conf文件中zk的地址以及启用Kafka-Manager使用账号登录和消费者的配置

修改conf/consumer.properties内容如下:

security.protocol=SASL_PLAINTEXT
key.deserializer=org.apache.kafka.common.serialization.ByteArrayDeserializer
value.deserializer=org.apache.kafka.common.serialization.ByteArrayDeserializer
sasl.mechanism=GSSAPI
sasl.kerberos.service.name=kafka

因为做了kerberos认证,所以需要jaas.conf文件指定到启动命令后面。

配置前要保证票据可用!

klist -l

kinit -kt /etc/security/keytabs/kafka.service.keytab kafka/你的主机

Starting the service

After extracting the produced zipfile, and changing the working directory to it, you can run the service like this:

$ bin/kafka-manager

By default, it will choose port 9000. This is overridable, as is the location of the configuration file. For example:

$ bin/kafka-manager -Dconfig.file=/path/to/application.conf -Dhttp.port=8080

Again, if java is not in your path, or you need to run against a different version of java, add the -java-home option as follows:

$ bin/kafka-manager -java-home /usr/local/oracle-java-8

Starting the service with Security

To add JAAS configuration for SASL, add the config file location at start:

$ bin/kafka-manager -Djava.security.auth.login.config=/path/to/my-jaas.conf
如:bin/kafka-manager -Djava.security.auth.login.config=/etc/kafka/conf/kafka_jaas.conf 注意:
kafka-manager-1.3.3.22之前的版本启动会有问题,异常log如下:
java.util.NoSuchElementException: key not found: PLAINTEXT
详见github issue:https://github.com/yahoo/kafka-manager/issues/502
已经在https://github.com/yahoo/kafka-manager/pull/532修复

NOTE: Make sure the user running kafka manager has read permissions on the jaas config file

Packaging(可以打RPM包)

If you'd like to create a Debian or RPM package instead, you can run one of:

sbt debian:packageBin

sbt rpm:packageBin

Credits

Logo/favicon used is from Apache Kafka.

Most of the utils code has been adapted to work with Apache Curator from Apache Kafka.

License

Apache Licensed. See accompanying LICENSE file.

https://github.com/yahoo/kafka-manager

https://blog.csdn.net/weixin_35852328/article/details/83656002

KafkaManager编译安装使用(支持kerberos认证)的更多相关文章

  1. 1-18 编译安装内核支持ntfs文件系统

    大纲: 源码编译Linux内核 使用Linux内核模块 实战:编译一个NTFS内核模块,实现Linux挂载NTFS文件系统并实现读写功能 =============================== ...

  2. 重新编译安装swoole支持OpenSSL

    1.下载:wget http://pecl.php.net/get/swoole-1.9.22.tgz 2.解压:tar zxvf swoole-1.9.22.tgz 3.扩展模块:cd swoole ...

  3. Kafka监控系统Kafka Eagle:支持kerberos认证

    在线文档:https://ke.smartloli.org/ 作者博客:https://www.cnblogs.com/smartloli/p/9371904.html 源码地址:https://gi ...

  4. llvm+clang编译安装

    最近一段时间在llvm+clang上做一些东西,所以顺便将自己如何编译安装llvm+clang写了篇文章发在这里,希望能帮助刚接触llvm+clang的童鞋少走一些弯路(我刚接触的时候为了编译安装这个 ...

  5. Nginx服务编译安装、日志功能、状态模块及访问认证模式实操

    系统环境 [root@web ~]# cat /etc/redhat-release CentOS release 6.9 (Final) [root@web ~]# uname -a Linux d ...

  6. CentOS下PHP7的编译安装,MySQL的支持和一些问题的解决

    最近试了一下PHP7,在编译和支持MySQL上都遇到一些问题,相信不少同学也同样遇到,所以在这里聊一下这个过程.简单来讲编译PHP7只需要3步: 1../buildconf --force 2../c ...

  7. nginx在centos 7中源码编译安装【添加grpc的支持】

    安装依赖软件 1.安装编译工具gcc gcc是一个开源编译器集合,用于处理各种各样的语言:C.C++.Java.Ada等,在linux世界中是最通用的编译器,支持大量处理器:x86.AMD64.Pow ...

  8. 编译安装haproxy开启支持SSL

    1.下载程序包 # wget http://www.haproxy.org/download/1.7/src/haproxy-1.7.5.tar.gz # tar xvf haproxy-1.7.5. ...

  9. centos6编译安装zabbix3.0和中文支持整理文档

    编者按: 最近公司部分业务迁移机房,为了更方便的监控管理主机资源,决定上线zabbix监控平台.运维人员使用2.4版本的进行部署,个人在业余时间尝鲜,使用zabbix3.0进行部署,整理文档如下,仅供 ...

随机推荐

  1. 在Ubuntu上搭建kindle gtk开发环境

    某个角度上说,kindle很类似android,同样的Linux内核,同样的Java用户层.不过kindle更注重简单.节能.稳定.Amazon一向认为,功能过多会分散人们阅读时候的注意力. Kind ...

  2. 为啥用ip不可以访问知乎,而百度却可以?

    我们先来ping知乎的域名,然后可以得到响应的服务器的ip 之后我们用浏览器来访问这个ip,结果如下 被拒绝访问了. 而用ip来访问百度,则没啥问题,如图 访问知乎的时候,域名可以访问,ip不可以访问 ...

  3. Windows 下常见的反调试方法

    稍稍总结一下在Crack或Rervese中比较常见的一些反调试方法,实现起来也比较简单,之后有写的Demo源码参考,没有太大的难度. ①最简单也是最基础的,Windows提供的API接口:IsDebu ...

  4. kernel pwn 入门环境搭建

    刚开始上手kernel pwn,光环境就搭了好几天,应该是我太菜了.. 好下面进入正题,环境总共就由两部分构成,qemu和gdb.这两个最好都需要使用源码安装. 我使用的安装环境为 qemu:安装前要 ...

  5. RDIFramework.NET ━ .NET快速信息化系统开发框架 V3.2->Web版本模块管理界面新增模块排序功能

    模块(菜单)的排序是每个系统都必须要有的功能,我们框架模块的排序在业务逻辑中已经体现. WinForm版本可以直接在界面上对模块进行排序以控制模块展示的顺序.Web版本在3.2版本中也新增了直接可以模 ...

  6. SQL——嵌套查询与子查询

    前言 sql的嵌套查询可以说是sql语句中比较复杂的一部分,但是掌握好了的话就可以提高查询效率.下面将介绍带in的子查询.带比较运算符的子查询.带any/all的子查询.带exists的子查询以及基于 ...

  7. 第3章 支持和规范 - Identity Server 4 中文文档(v1.0.0)

    IdentityServer实现以下规范: 3.1 OpenID Connect OpenID Connect Core 1.0 (规范) OpenID Connect Discovery 1.0 ( ...

  8. 你需要一点点CIL

    1.当我们程序集中有大量反射的时候,性能往往会下降很快.我们目的很明确 如何解决反射造成的这些影响,其中之一个正确且高逼格的做法是 使用 CIL指令去实现.如何实现需要我们拥有若干基础知识.知道 CI ...

  9. python学习笔记(六)、类

    Python与java.c++等都被视为一种面向对象的语言.通过创建自定义类,用于处理各种业务逻辑.面向对象有封装.继承.多态三个特征,这也是面子对象语言的通用特征. 1 封装 封装,是值向外部隐藏内 ...

  10. java_List集合及其实现类

    第一章:List集合_List接口介绍 1).特点       1).有序的: 2).可以存储重复元素: 3).可以通过索引访问: List<String> list = new Arra ...