-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmulti broker.txt
More file actions
40 lines (21 loc) · 962 Bytes
/
multi broker.txt
File metadata and controls
40 lines (21 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
## In this tutorial, we try to achieve and setup multi brokers
### Create config files for each new broker
config/server.properties config/server-1.properties
# Update the following properties in the new files
config/server-1.properties:
broker.id=1
listeners=PLAINTEXT://:9093
log.dir=/tmp/kafka-logs-1
config/server.properties config/server-2.properties
config/server-2.properties:
broker.id=2
listeners=PLAINTEXT://:9094
log.dir=/tmp/kafka-logs-2
### Start the two new nodes in separate termial windows
### Keep your Zookeeper running
kafka-server-start.sh config/server-1.properties
kafka-server-start.sh config/server-2.properties
### You can setup more replication factor under multiple brokers
kafka-topics.sh --zookeeper 127.0.0.2181 --topic kafka_topic --create --parition 3 replication factor 2
### To check the replication factor
kafka-topics.sh --zookeeper localhost:2181 --topic kafka_topic --describe