The first step: Download KAFKA_2.11-0.8.2.1.TGZ,TAR-XZVF extract to the installation directory, I am ~/kit, download zookeeper-3.3.6.tar.gz, the same decompression to the ~/kit directory
The second step: Modify the Zookeeper configuration file, CP zoo_sample.cfg ZOO.CFG, and configure the data directory and log directory, as follows
Datadir=~/kit/zookeeper-3.3.6/data
Datalogdir=~/kit/zookeeper-3.3.6/log
Then create the corresponding directory
Step three: Modify the Kafka configuration file Zookeeper.properties server.properties
Zookeeper.properties modified as follows:
Datadir=/home/hadoop/kit/kafka2.11/zookeeper/data
Server.properties modified as follows:
Broker.id=1
host.name=0.0.0.0
advertised.host.name=47.100.2.197
Log.dirs=/home/hadoop/kit/kafka2.11/log
Num.partitions=1
Offsets.topic.replication.factor=1
Default.replication.factor=1
Fourth step: Start zookeeper:bin/zookeeper-server-start.sh config/zookeeper.properties
Start kafka:bin/kafka-server-start.sh config/server.properties
Attention:
Kafka version is 2.11-0.8.2.1, if you use a Python client, you need to specify Apiversion
Kafkaproducer (bootstrap_servers=[' 47.100.2.197:9092 '],api_version= (0,8,2))
The MAVEN corresponding client must also specify the version
Producer end submission data, Comsumer end consumption data
ubuntu16.04 Kafka stand-alone version construction