Kafka cluster installation under Linux

Environment: Two CentOS 7 virtual machines, respectively: 192.168.31.224 and 192.168.31.225 1. Install jdk and zookeeper
before installation 2. Download kafka_2.12-1.1.0.tgz, and the download address is: https://mp .csdn.net/mdeditor 3. Decompress kafka_2.12-1.1.0.tgz, use the command tar -zxvf kafka_2.12-1.1.0.tgz, after decompression, the kafka_2.12-1.1.0 package will be generated and enter the config directory

write picture description here
4. Modify the zookeeper.properties and server.properties files

  • The zookeeper.properties file is modified according to the zoo.cfg file in the zookeeper installation
  • In the server.properties file, modify advertised.listeners (set the machine's IP and default 9092 port) and zookeeper.connect (set the zookeeper server cluster, here I used two virtual machines 192.168.31.224 and 192.168.31.225 to simulate the zookeeper cluster ), other parameters are temporarily defaulted. broker.id can be set to 0 and 1 in order of hosts.
broker.id=0
----------
advertised.listeners=PLAINTEXT://192.168.31.224:9092
----------
zookeeper.connect=192.168.31.224:2181,192.168.31.225:2181

5. Start kafka

./bin/kafka-server-start.sh  ./config/server.properties

write picture description here
The terminal output does not report an error, indicating that the startup is successful. Server startup can use nohup &

stop

./bin/kafka-server-stop.sh

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325564294&siteId=291194637