Zookeeper + kafka cluster Installation

Source: Internet
Author: User

Zookeeper + kafka cluster Installation

Prepare three VMS. The system is RHEL64.

1) the configuration of each machine is as follows:

$ Cat/etc/hosts

...# zookeeper hostnames:192.168.8.182       zk1192.168.8.183       zk2192.168.8.184       zk3

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

$ Vi/etc/profile

...# jdk, zookeeper, kafkaexport KAFKA_HOME=/usr/local/lib/kafka/kafka_2.9.2-0.8.11export ZK_HOME=/usr/local/lib/zookeeper/zookeeper-3.4.6export CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jarexport 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 connectclientPort=2181# zookeeper clusterserver.1=zk1:2888:3888server.2=zk2:2888:3888server.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



















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.