机器和环境

三台ubuntu 16.04 64bit

  • jdk 1.8
  • kafka_2.11-1.1.0
  • zookeeper-3.4.12/

172.16.227.128的配置包括如下(同理其它两台机器)

  • /opt/zookeeper/zookeeper-3.4.12/conf/zoo.cfg
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
dataDir=/opt/zookeeper/data
dataLogDir=/opt/zookeeper/log
# the port at which the clients will connect
clientPort=2181
server.1=172.16.227.128:2888:3888
server.2=172.16.227.129:2888:3888
server.3=172.16.227.130:2888:3888
  • /opt/zookeeper/data/myid (对应server.1)
1
  • /opt/kafka_2.11-1.1.0/config/ server.properties
# The id of the broker. This must be set to a unique integer for each broker.
broker.id=1
hostname.name=172.16.227.128
port=9092

advertised.host.name=172.16.227.128
advertised.port=9092

zookeeper.connect=172.16.227.128:2181,172.16.227.129:2182,172.16.227.130:2181

Ubuntu虚拟机 Zookeeper+Kafka集群搭建-LMLPHP

Ubuntu虚拟机 Zookeeper+Kafka集群搭建-LMLPHP

Ubuntu虚拟机 Zookeeper+Kafka集群搭建-LMLPHP

参考:
https://blog.csdn.net/u014388408/article/details/52871718

10-03 18:46