这里我们罗列一下我们的环境
10.19.18.88 zk1
10.19.16.84 zk2
10.19.11.44 zk3

这里公司需要接入kafka用于zipkin来定位调用链

kafka 的地址是http://kafka.apache.org/

zipkin 的地址是https://github.com/openzipkin/zipkin/tree/master/zipkin-server#environment-variables

kafka-manager 地址是https://github.com/yahoo/kafka-manager

这里首先我们现在kafka的下载包

kafka     download      http://kafka.apache.org/downloads      https://archive.apache.org/dist/kafka/0.11.0.0/kafka_2.11-0.11.0.0.tgz

下载包之后我们直接解压使用,因为这里我们环境已经配置过zookeeper

所以这里我就不配置kafka/config/zookeeper.properties

我们直接修改kafka的配置文件:

# The id of the broker. This must be set to a unique integer for each broker.
broker.id=1
############################# Socket Server Settings #############################
listeners=PLAINTEXT://10.19.18.88:1092
port=1092
host.name=10.19.18.88
# The number of threads handling network requests
num.network.threads=8
# The number of threads doing disk I/O
num.io.threads=8
# The send buffer (SO_SNDBUF) used by the socket server
socket.send.buffer.bytes=1048576
# The receive buffer (SO_RCVBUF) used by the socket server
socket.receive.buffer.bytes=1048576
# The maximum size of a request that the socket server will accept (protection against OOM)
socket.request.max.bytes=104857600
# The number of queued requests allowed before blocking the network threads
queued.max.requests=100
# The purge interval (in number of requests) of the fetch request purgatory
fetch.purgatory.purge.interval.requests=200
# The purge interval (in number of requests) of the producer request purgatory
producer.purgatory.purge.interval.requests=200############################# Log Basics #############################
# A comma seperated list of directories under which to store log files
log.dirs=/data/package/kafka/kafka-logs
# The default number of log partitions per topic.
num.partitions=24
# The number of threads per data directory to be used for log recovery at startup and flushing at shutdown.
num.recovery.threads.per.data.dir=2
# The maximum size of message that the server can receive
message.max.bytes=1000000
# Enable auto creation of topic on the server
auto.create.topics.enable=true
# The interval with which we add an entry to the offset index
log.index.interval.bytes=4096
# The maximum size in bytes of the offset index
log.index.size.max.bytes=10485760
# Allow to delete topics
delete.topic.enable=true
############################# Log Flush Policy #############################
# The number of messages to accept before forcing a flush of data to disk
log.flush.interval.messages=20000
# The maximum amount of time a message can sit in a log before we force a flush
log.flush.interval.ms=10000
# The frequency in ms that the log flusher checks whether any log needs to be flushed to disk
log.flush.scheduler.interval.ms=2000
############################# Log Retention Policy #############################
# The minimum age of a log file to be eligible for deletion
log.retention.hours=168
# A size-based retention policy for logs.
log.retention.bytes=1073741824
# The maximum size of a log segment file. When this size is reached a new log segment will be created.
log.segment.bytes=1073741824
# The interval at which log segments are checked to see if they can be deleted according
# to the retention policies
log.retention.check.interval.ms=300000
# The maximum time before a new log segment is rolled out (in hours)
log.roll.hours=168
############################# Zookeeper #############################
# Zookeeper connection string (see zookeeper docs for details).
zookeeper.connect=10.19.18.88:12081,10.19.16.84:12081,10.19.11.44:12081
# Timeout in ms for connecting to zookeeper
zookeeper.connection.timeout.ms=6000
# How far a ZK follower can be behind a ZK leader
zookeeper.sync.time.ms=2000############################# Replication configurations ################
# default replication factors for automatically created topics
default.replication.factor=3
# Number of fetcher threads used to replicate messages from a source broker.
num.replica.fetchers=4
# The number of bytes of messages to attempt to fetch for each partition.
replica.fetch.max.bytes=1048576
# max wait time for each fetcher request issued by follower replicas.
replica.fetch.wait.max.ms=500
# The frequency with which the high watermark is saved out to disk
replica.high.watermark.checkpoint.interval.ms=5000
# The socket timeout for network requests.
replica.socket.timeout.ms=30000
# The socket receive buffer for network requests
replica.socket.receive.buffer.bytes=65536
# If a follower hasn't sent any fetch requests or hasn't consumed up to the leaders log end offset for at least this time, the leader will remove the follower from isr
replica.lag.time.max.ms=10000
# The socket timeout for controller-to-broker channels
controller.socket.timeout.ms=30000
controller.message.queue.size=10

这里不同的就是上面红色标注的,我们这里有三台机器组成的kafka集群

vim bin/kafka-server-start.sh
修改最后一行#exec $base_dir/kafka-run-class.sh $EXTRA_ARGS kafka.Kafka "$@"
exec $base_dir/kafka-run-class.sh $EXTRA_ARGS kafka.Kafka "/data/package/kafka/config/server.properties"

同样的方法,我们修改一下其他的两台server的配置文件

然后我们就可以一次启动kafka了。

最后我们安装kafka-manager

功能:
为了简化开发者和服务工程师维护Kafka集群的工作,yahoo构建了一个叫做Kafka管理器的基于Web工具,叫做 Kafka Manager。这个管理工具可以很容易地发现分布在集群中的哪些topic分布不均匀,或者是分区在整个集群分布不均匀的的情况。它支持管理多个集群、选择副本、副本重新分配以及创建Topic。同时,这个管理工具也是一个非常好的可以快速浏览这个集群的工具,有如下功能:1.管理多个kafka集群
2.便捷的检查kafka集群状态(topics,brokers,备份分布情况,分区分布情况)
3.选择你要运行的副本
4.基于当前分区状况进行
5.可以选择topic配置并创建topic(0.8.1.1和0.8.2的配置不同)
6.删除topic(只支持0.8.2以上的版本并且要在broker配置中设置delete.topic.enable=true)
7.Topic list会指明哪些topic被删除(在0.8.2以上版本适用)
8.为已存在的topic增加分区
9.为已存在的topic更新配置
10.在多个topic上批量重分区
11.在多个topic上批量重分区(可选partition broker位置)
安装步骤1、获取kafka-manager源码,并编译打包
# cd /usr/local
# git clone https://github.com/yahoo/kafka-manager
# cd kafka-manager
# ./sbt clean dist
注: 执行sbt编译打包可能花费很长时间,如果你hang在如下情况
将project/plugins.sbt 中的logLevel参数修改为logLevel := Level.Debug(默认为Warn)2、安装配置
编译成功后,会在target/universal下生成一个zip包# cd /usr/local/kafka-manager/target/universal
# unzip kafka-manager-1.3.3.7.zip
将application.conf中的kafka-manager.zkhosts的值设置为你的zk地址
如:kafka-manager.zkhosts="172.16.218.201:2181,172.16.218.202:2181,172.16.218.203:2181"
3、启动,指定配置文件位置和启动端口号,默认为9000
直接启动:# cd kafka-manager-1.3.3.7/bin
# ./kafka-manager -Dconfig.file=../conf/application.conf
后台运行:# ./kafka-manager -h
# nohup ./kafka-manager -Dconfig.file=../conf/application.conf &
指定端口,例如:# nohup bin/kafka-manager -Dconfig.file=conf/application.conf -Dhttp.port=9001 &
第一次进入web UI要进行kafka cluster的相关配置,根据自己的信息进行配置。

参考文章链接:

kafka
https://www.cnblogs.com/shiyiwen/p/6150213.html
http://blog.51cto.com/xiangcun168/1933509
http://orchome.com/41
http://www.360doc.com/content/16/1117/16/37253246_607304757.shtml
http://jayveehe.github.io/2017/02/01/elk-stack/
http://blog.51cto.com/wuyebamboo/1963786
https://facingissuesonit.com/2017/05/29/integrate-filebeat-kafka-logstash-elasticsearch-and-kibana/
https://www.yuanmas.com/info/GlypPG18y2.html
https://www.cnblogs.com/yinchengzhe/p/5111635.html  kafka 参数
https://www.cnblogs.com/weixiuli/p/6413109.html        kafka 配置文件参数详解

转载于:https://www.cnblogs.com/smail-bao/p/7987340.html

kafka 集群的部署安装相关推荐

  1. kafka集群的部署

    文章目录 1.kafka.apache.org网址中下载所需的kafka包 2.修改配置文件server.properties 3.修改环境变量 4.分发到各节点 5.开启zookeeper集群 6. ...

  2. kafka 基础知识梳理及集群环境部署记录

    一.kafka基础介绍 Kafka是最初由Linkedin公司开发,是一个分布式.支持分区的(partition).多副本的(replica),基于zookeeper协调的分布式消息系统,它的最大的特 ...

  3. ELK集群+Kafka集群+FileBeat——命运多舛的安装采坑之路

    欢迎大家关注我的公众号,添加我为好友! 开始的时候感觉日志监控是比较NB的技术,感觉很神奇,那么多日志,为什么一下子就能够找到自己想要的?后来初步了解到了ELK(ElasticSearch + Log ...

  4. zookeeper + kafka集群搭建详解

    文章目录 一.消息队列介绍 1.1 为什么需要消息队列 (MO) 1.2 使用消息队列的好处 (1)解耦 (2)可恢复性 (3)缓冲 (4)灵活性 & 峰值处理能力 (5)异步通信很多时候,用 ...

  5. 使用 xCAT 简化 AIX 集群的部署和管理

    使用 xCAT 简化 AIX 集群的部署和管理 基于 IBM® Power 520 Express® (8203-E4A) 的实践 本文主要介绍了 xCAT 软件的工作原理,并且通过在 IBM® Po ...

  6. 单机 搭建kafka集群 本地_10分钟搭建单机Kafka集群

    单机版kafka集群有什么作用 练习上手用. 搭建zookeeper集群首先下载zookeeper解压 apache zookeeper tar -zxvf apache-zookeeper-3.5. ...

  7. 4.2.9 Kafka集群与运维, 应用场景, 集群搭建, 集群监控JMX(度量指标, JConsole, 编程获取, Kafka Eagle)

    目录 3.1 集群应用场景 1 消息传递 2 网站活动路由 3 监控指标 4 日志汇总 5 流处理 6 活动采集 7 提交日志 总结 3.2 集群搭建 3.2.1 Zookeeper集群搭建 3.2. ...

  8. Kafka集群部署详细步骤(包含zookeeper安装步骤)

    Kafka集群部署 注意:如果jdk1.8和zookeeper都安装设置过之后可以直接安装kafka跳过其它步骤 kafka基础简介及基本命令 1.环境准备 1.1集群规划 node01  node0 ...

  9. Linux下搭建 kafka集群 + zookeeper集群部署 安装、启动、停止

    文章目录 一.环境部署总览 1. 软件版本选型 2. 服务器软件部署总览 二.软件部署手册 2.1. JDK 2.2. kafka 2.3. Kafka Eagle 2.4. mysql 2.5. z ...

最新文章

  1. 让学生网络相互学习,为什么深度相互学习优于传统蒸馏模型?| 论文精读
  2. 【220】◀▶ IDL 数组操作函数说明
  3. Redis的两种连接方式
  4. HDU-2037-今年暑假不AC
  5. 流量分析_安恒八月月赛
  6. 皇室战争:渔夫化身“战场搅屎棍”,见人就拉,选卡很关键
  7. JEPaas代码_((列表)输入字段值而改变值
  8. ux和ui_设计社交餐厅策展应用程序— UX / UI案例研究
  9. [转]两个经典的windbg调试案例,值得学习。
  10. python语音播放文本_python将文本转化成语音并播放
  11. MIT 18.03 写给初学者的微积分校对活动 | ApacheCN
  12. Hibernate 对c3p0配置不支持导致的错误
  13. Zabbix通过Smokeping检测网络质量并告警
  14. 江西 高职 分数 计算机,快讯!江西高职(专科)批次各高校投档分数线出炉…...
  15. 330UF16V 10*7.7片式铝电解电容封装
  16. NodeJs快速入门
  17. 访问json接口浏览器提示下载文件
  18. 【5G核心网】5GC核心网之网元AMF
  19. 未分配利润与利润表不一致_资产负债表中的未分配利润和利润表中的净利润肯定是一致的吗?...
  20. Game101课程笔记_lecture06_光栅化2

热门文章

  1. 算法与数据结构 (三) 二叉树的简单应用 二叉查找树,二叉堆排序
  2. CSP 行车路线 最短路变型
  3. ROS与Arduino学习(六)Logging日志
  4. MQTT客户端库-Paho GO
  5. 第三方控件netadvantage UltraWebGrid如何生成带加号多级表数据也就是带子表
  6. can't load apple.laf.AquaLookAndFeel (Ant in Eclipse can't find it
  7. oracle数据库视图有红叉,oracle触发器 前面的红叉是什么意思
  8. linux中fstab含义,fstab每一列的含义
  9. Python2和Python3的兼容性写法
  10. MacOS svn:E230001 Can‘t use Subversion command line client: svn The path to the Subversion executabl