Use configuration of kafka and zookeeper under linux

Recently, there is a demand to use Kafka's topic subscription mode to collect error information and record the detailed configuration method.

Prerequisite: The kafka and zookeeper of this document are deployed on the same linux machine, without cluster settings, first configure zookeeper and then kafka, zookeeper version is zookeeper-3.4.6,

1. Upload the zookeeper compressed package zookeeper-3.4.6.tar.gz to the server, upload it here to the /jboss/zookeeper directory, and decompress it to the zookeeper directory. Unzip the command (tar -zxvf zookeeper-3.4.6.tar.gz /jboss/zookeeper), as shown below:

2. Enter the zookeeper conf folder (cd /jboss/zookeeper/zookeeper-3.4.6/conf) and execute the command cp zoo_sample.cfg to zoo.cfg, copy the zoo_sample.cfg that comes with it and name it zoo.cfg (This name cannot be modified), as shown below:

3. Create new folders zkdata and zkdataLog in the /jboss/zookeeper directory, (mkdir /jboss/zookeeper/ zkdata      mkdir /jboss/zookeeper/zkdataLog) to store the data and logs saved by Zookeeper, as shown below:


4. Modify the zoo.cfg file configuration under conf

5. Start zookeeper, switch to the bin directory, and execute the startup command sh zkServer.sh start to start the service. After the service is started, you can check the status of zookeeper through the command (sh zkServer.sh status)


6. Copy the kafka_2.11-0.8.2.0.tar.gz package to the server, and unzip it to the kafka directory, as shown below:

7. Modify the server.properties file under /jboss/kafka/kafka_2.11-0.8.2.0/config

8. Start the kafka service

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

At this point, the zookeeper and kafka services are up, and you can send messages online and get them.


Guess you like

Origin blog.csdn.net/jerry_player/article/details/77197762