Skip to content

Commit 85e48f7

Browse files
authored
added a third broker
1 parent 2d66e86 commit 85e48f7

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

zk-multiple-kafka-multiple.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ services:
4343
environment:
4444
# add the entry "127.0.0.1 kafka1" to your /etc/hosts file
4545
KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://kafka1:9092"
46-
KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181"
46+
KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181,zoo2:2182,zoo3:2183"
4747
KAFKA_BROKER_ID: 1
4848
# KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
4949
depends_on:
@@ -59,10 +59,26 @@ services:
5959
environment:
6060
# add the entry "127.0.0.1 kafka1" to your /etc/hosts file
6161
KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://kafka2:9093"
62-
KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181"
62+
KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181,zoo2:2182,zoo3:2183"
6363
KAFKA_BROKER_ID: 2
6464
# KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
6565
depends_on:
6666
- zoo1
6767
- zoo2
6868
- zoo3
69+
70+
kafka3:
71+
image: confluentinc/cp-kafka:3.1.2
72+
hostname: kafka3
73+
ports:
74+
- "9094:9094"
75+
environment:
76+
# add the entry "127.0.0.1 kafka1" to your /etc/hosts file
77+
KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://kafka3:9094"
78+
KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181,zoo2:2182,zoo3:2183"
79+
KAFKA_BROKER_ID: 3
80+
# KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
81+
depends_on:
82+
- zoo1
83+
- zoo2
84+
- zoo3

0 commit comments

Comments
 (0)