环境:
kafka集群依赖zookeeper
zookeeper集群部署:http://blog.51cto.com/haoyonghui/2113660
centos7 ip:192.168.41.47
centos7 ip:192.168.41.127
centos7 ip:192.168.41.86


下载kafka
三台机器执行
# tar xf kafka_2.11-1.1.0.tgz -C /usr/local/
# mv /usr/local/kafka_2.11-1.1.0 /usr/local/kafka
# vim /usr/local/kafka/config/server.properties

centos7搭建kafka集群_集群

注:三台主机broker.id 分别为1,2,3

centos7搭建kafka集群_部署_02

centos7搭建kafka集群_集群_03

其它默认即可


启动kafka

#./kafka-server-start.sh -daemon ../config/server.properties    #以后台方式启动,查看9092端口

#./kafka-server-stop.sh     #关闭kafka命令

登录zookeeper查看即可


官方安装文档:http://kafka.apache.org/documentation/