ubuntu16.04 Kafka stand-alone version construction

Source: Internet
Author: User
Tags zookeeper

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.