这里我们罗列一下我们的环境
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 配置文件参数详解

kafka 集群的部署安装的更多相关文章

  1. Kafka集群模式部署

    环境:kafka 0.8.1.1 基本概念 Kafka维护按类区分的消息,称为主题(topic) 生产者(producer)向kafka的主题发布消息 消费者(consumer)向主题注册,并且接收发 ...

  2. bigdata_ Kafka集群模式部署

    环境:kafka 0.8.1.1 基本概念 Kafka维护按类区分的消息,称为主题(topic) 生产者(producer)向kafka的主题发布消息 消费者(consumer)向主题注册,并且接收发 ...

  3. zookeeper+kafka集群的安装部署

    准备工作 上传 zookeeper-3.4.6.tar.gz.scala-2.11.4.tgz.kafka_2.9.2-0.8.1.1.tgz.slf4j-1.7.6.zip 至/usr/local目 ...

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

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

  5. 使用docker-compose部署Kafka集群

    之前写过Kafka集群的部署,不过那是基于宿主机的,地址:Kafka基础教程(二):Kafka安装 和Zookeeper一样,有时想简单的连接Kafka用一下,那就需要开好几台虚拟机,如果Zookee ...

  6. zookeeper集群+kafka集群 部署

    zookeeper集群 +kafka 集群部署 1.Zookeeper 概述: Zookeeper 定义 zookeeper是一个开源的分布式的,为分布式框架提供协调服务的Apache项目 Zooke ...

  7. Centos7.5安装kafka集群

    Tags: kafka Centos7.5安装kafka集群 Centos7.5安装kafka集群 主机环境 软件环境 主机规划 主机安装前准备 安装jdk1.8 安装zookeeper 安装kafk ...

  8. Centos 6.5 Rabbitmq 安装和集群,镜像部署

    centos 6.5 rabbitmq 安装和集群,镜像部署 安装erlang: yum install gcc glibc-devel make ncurses-devel openssl-deve ...

  9. Zookeeper、Kafka集群与Filebeat+Kafka+ELK架构

    Zookeeper.Kafka集群与Filebeat+Kafka+ELK架构 目录 Zookeeper.Kafka集群与Filebeat+Kafka+ELK架构 一.Zookeeper 1. Zook ...

随机推荐

  1. python中string和十六进制、二进制互转

    def str_to_hex(s): return ' '.join([hex(ord(c)).replace('0x', '') for c in s]) def hex_to_str(s): re ...

  2. Atlas系列一:Atlas功能特点FAQ

    1:Atlas是否支持多字符集? 支持,可以在test.cnf中指定. #默认字符集,设置该项后客户端不再需要执行SET NAMES语句charset = utf8 2:Atlas是否支持事物操作? ...

  3. ajax请求,返回值为304 Not Modified 错误原因与解决办法

    先说原因吧,这是因为http请求的缓存问题引起的 前后调用了两个相同的请求,服务器懒得给你重新发一个请求,所以就304咯 那怎么办呢? 解决方法也很简单,加一个时间戳就行了 比如: 原请求为: $.g ...

  4. V-rep学习笔记:力传感器

    VREP中可以添加力传感器,用于刚性连接在两个物体之间以测量这两个物体之间的作用力或力矩.如下图所示,力传感器可以测量沿着X.Y.Z三个坐标轴的力和力矩: [Forces and torques me ...

  5. Servlet学习(二):ServletConfig获取参数;ServletContext应用:请求转发,参数获取,资源读取;类装载器读取文件

    转载:http://www.cnblogs.com/xdp-gacl/p/3763559.html 一.ServletConfig讲解 1.1.配置Servlet初始化参数 在Servlet的配置文件 ...

  6. 转 linux下php扩展mysqli的支持

    前两天一个站点转移过来,因为给我的数据库有问题,我也没有仔细处理这个站点.今天把数据库弄好了,发现还是用不了,报的错误如下:Fatal error: Class ‘mysqli’ not found ...

  7. Arduino驱动无源蜂鸣器发声

    tone()函数 tone(pin, frequency) tone(pin, frequency, duration) # 参数 pin: the pin on which to generate ...

  8. android布局layout中的一些属性

      1.可以使某些资源文件或UI组件可重用 <include layout="@layout/other"/>  2.定义一个文本编辑框,使用绝对定位 android: ...

  9. startActivityForResult的使用和用法

    startActivityForResult的使用和用法 startActivityForResult 和 onActivityResult在activity间传递数据 AndroidManifest ...

  10. ios中Pldatabase的用法

    将PLDATABASE加入到工程 下载PLDatabase 的dmg文件 将PLDatabase的framework复制到工程根目录在工程中加入该framework使用该framework进行数据库操 ...