The installation

The mkdir/app/kafka CD/app/kafka wget tar - XZF at https://mirrors.bfsu.edu.cn/apache/kafka/2.8.0/kafka_2.13-2.8.0.tgz ## install JDK yum install java-1.8.0-openjdk.x86_64 -y ## install java-1.8.0-openjdk.x86_64 -y ## install java-1.8.0-openjdk.x86_64 -y # Bin/zookeeper server - start. Sh config/zookeeper properties # start kafka broker bin/kafka - server - start. Sh config/server.properties

News operation

# Create Topic bin/kafka-topics. Sh --create -- Topic quickstart-events --bootstrap-server localhost:9092 Bin /kafka-console-producer.sh --topic quickstart-events --bootstrap-server localhost:9092 # bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server localhost:9092

Configuring the Supervisor startup

kafka-zookeeper.conf

[program: kafka - zookeeper] command = / app/kafka/kafka_2. 13-2.8.0 / bin/zookeeper - server - start. Sh / / app/kafka kafka_2. 13-2.8.0 / config/zookeeper. Properties autostart = true startsecs = 5 autorestart = true startretries =  3 user = root redirect_stderr = true stdout_logfile_maxbytes = 20MB stdout_logfile_backups = 20 stdout_logfile = /app/kafka/log/zookepper.log

kafka-server.conf

[the program: kafka - server] command = / app/kafka/kafka_2. 13-2.8.0 / bin/kafka - server - start. Sh / app/kafka/kafka_2. 13-2.8.0 / config/server properties autostart = true startsecs = 5 autorestart = true startretries = 3 user = root redirect_stderr = true stdout_logfile_maxbytes = 20MB stdout_logfile_backups = 20 stdout_logfile = /app/kafka/log/server.log