kafka单机部署多服务

跟上一篇《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启动起来即可。

你可能感兴趣的:(kafka单机部署多服务)