Kafka build clusters (v2.12-2.3.0)

Server: 10.20.32.121,10.20.32.122,10.20.32.123 

Three servers are required to install jdk, configuration zookeeper, configuration kafka

1, installation configuration jdk1.8

[root@localhost ~]# cat /etc/profile
export JAVA_HOME=/opt/jdk1.8.0_101
export PATH=$JAVA_HOME/bin:$PATH

2, the installation configuration zookeeper

3, installation configuration kafka cluster (for example configuration to 10.20.32.121)

3.1, unzip files download

[root@node3 cluster]# cd /opt && wget https://www-eu.apache.org/dist/kafka/2.3.0/kafka_2.12-2.3.0.tgz 
[root@node3 cluster]# tar zxvf kafka_2.12-2.3.0.tgz

3.2, edit the configuration file /opt//kafka_2.12-2.3.0/config/server.properties, the following is a need to modify the part

= 121 broker.id 
the Listeners = PLAINTEXT: //10.20.32.121: 9092 
log.dirs = / opt / kafka_2.12-2.3.0 / kafkalogs 
zookeeper.connect = 10.20.32.121: 2181,10.20.32.122: 2181,10.20. 32.123: 2181 
# timeout in MS for Connecting to ZooKeeper to be modified, or report timeout 
zookeeper.connection.timeout.ms = 60000

note:

If the stand-alone version, use the default configuration can be.

If you are configuring a cluster, the following information must be modified:

(1), broker.id: the same cluster, each machine can not be the same

(2), zookeeper.connect: zookeeper because I have three servers, so here zookeeper.connect set to three, must all be added to the list

(3), listeners: When configuring a cluster must be set, otherwise the operation will be reported later found error leader of
10.20.32.122 and 10.20.32.123 server only needs to modify broker.id, in the Listeners value, broker.id = 122 listeners = PLAINTEXT: //10.20.32.122: 9092

 

Guess you like

Origin www.cnblogs.com/zhangmingcheng/p/11270986.html