kafka單機部署多服務

weixin_33762321發表於2018-12-05

跟上一篇《zookeeper單機部署多服務》原理一樣,實際上就是用多個埠開多個程式。

一起來看一下怎麼操作。

主要是配置檔案 service.properties
kafka0

broker.id=0
listeners=PLAINTEXT://localhost:9090
advertised.listeners=PLAINTEXT://localhost:9090
log.dirs=kafka/cluster_deploy/kafka0/logs
zookeeper.connect=192.168.2.57:2190,192.168.2.57:2191,192.168.2.57:2192

kafka1

broker.id=1
listeners=PLAINTEXT://localhost:9091
advertised.listeners=PLAINTEXT://localhost:9091
log.dirs=kafka/cluster_deploy/kafka1/logs
zookeeper.connect=192.168.2.57:2190,192.168.2.57:2191,192.168.2.57:2192

kafka2

broker.id=2
listeners=PLAINTEXT://localhost:9092
advertised.listeners=PLAINTEXT://localhost:9092
log.dirs=kafka/cluster_deploy/kafka2/logs
zookeeper.connect=192.168.2.57:2190,192.168.2.57:2191,192.168.2.57:2192

然後在分別把各個kafka啟動起來即可。

相關文章