Zookeeper + Kafka cluster Installation

Source: Internet
Author: User

Zookeeper + Kafka cluster Installation

Record the Zookeeper + Kafka cluster installation process in detail. Prepare three virtual machines. The system is RHEL64.

1) the configuration of each machine is as follows:

$ Cat/etc/hosts

...
# Zookeeper hostnames:
192.168.8.182 zk1
192.168.8.183 zk2
192.168.8.184 zk3

2) install jdk, zookeeper, and kafka on each machine. The configuration is as follows:

$ Vi/etc/profile

...

# Jdk, zookeeper, kafka
Export KAFKA_HOME =/usr/local/lib/kafka/kafka_2.9.2-0.8.11
Export ZK_HOME =/usr/local/lib/zookeeper/zookeeper-3.4.6
Export CLASSPATH =.: $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/lib/dt. jar
Export PATH = $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin: $ KAFKA_HOME/bin: $ ZK_HOME/bin: $ PATH

3) run on each machine:

$ Source/etc/profile

$ Mkdir-p/var/lib/zookeeper

$ Cd $ ZK_HOME/conf

$ Cp zoo_sample.cfg zoo. cfg

$ Vi zoo. cfg

...

DataDir =/var/lib/zookeeper

# The port at which the clients will connect
ClientPort = 2181

# Zookeeper cluster
Server.1 = zk1: 2888: 3888
Server.2 = zk2: 2888: 3888
Server.3 = zk3: 2888: 3888

4) generate the myid on each machine:

Zk1:

$ Echo "1">/var/lib/zookeeper/myid

Zk2:

$ Echo "2">/var/lib/zookeeper/myid

Zk3:

$ Echo "3">/var/lib/zookeeper/myid

5) run setup on each machine to close the Firewall

Firewall:

[] Enabled

6) Start zookeeper on each machine:

$ ZkServer. sh start

View status:

$ ZkServer. sh status

Kafka architecture design of the distributed publish/subscribe message system

Apache Kafka code example

Apache Kafka tutorial notes

Getting started with Kafka

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

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.