Installing Multiple Broker's on Single kafka cluster :
Streps to create multiple brokers on single node :
1. cp /etc/kafka/conf/server.properties /etc/kafka/conf/server1.properties
it will create new server1.properties file .
Make following changes to the file
broker.id=1
port=9093
log.dir=/tmp/kafka-logs-1
2. cp /etc/kafka/conf/server.properties /etc/kafka/conf/server2.properties
it will create new server2.properties file .
Make following changes to the file
server2.properties
broker.id=2
port=9094
log.dir=/tmp/kafka-logs-2
then start all the brokers :
nohup /usr/hdp/2.2.9.1-11/kafka/bin/kafka-server-start.sh /etc/kafka/conf/server.properties
nohup /usr/hdp/2.2.9.1-11/kafka/bin/kafka-server-start.sh /etc/kafka/conf/server1.properties
nohup /usr/hdp/2.2.9.1-11/kafka/bin/kafka-server-start.sh /etc/kafka/conf/server2.properties
Now you can see three brokers are running on Node.
Note. make sure you have set these properties :
zookeeper.connect=host1:2181,host2:2181,..
listeners:PLAINTEXT://host:9092
Streps to create multiple brokers on single node :
1. cp /etc/kafka/conf/server.properties /etc/kafka/conf/server1.properties
it will create new server1.properties file .
Make following changes to the file
broker.id=1
port=9093
log.dir=/tmp/kafka-logs-1
2. cp /etc/kafka/conf/server.properties /etc/kafka/conf/server2.properties
it will create new server2.properties file .
Make following changes to the file
server2.properties
broker.id=2
port=9094
log.dir=/tmp/kafka-logs-2
then start all the brokers :
nohup /usr/hdp/2.2.9.1-11/kafka/bin/kafka-server-start.sh /etc/kafka/conf/server.properties
nohup /usr/hdp/2.2.9.1-11/kafka/bin/kafka-server-start.sh /etc/kafka/conf/server1.properties
nohup /usr/hdp/2.2.9.1-11/kafka/bin/kafka-server-start.sh /etc/kafka/conf/server2.properties
Now you can see three brokers are running on Node.
Note. make sure you have set these properties :
zookeeper.connect=host1:2181,host2:2181,..
listeners:PLAINTEXT://host:9092
No comments:
Post a Comment