Installing the zookeeper cluster and the problems that arise

Source: Internet
Author: User

A: Install zookeeper (fully distributed (with Virtual machine installation))

1. Upload ZK installation package

2. Unzip

3. Configuration (first configured on a single node)
3.1 Adding a zoo.cfg configuration file
$ZOOKEEPER/conf
MV Zoo_sample.cfg Zoo.cfg

3.2 Modifying a configuration file (zoo.cfg)
Datadir=/itcast/zookeeper-3.4.5/data

server.1=itcast05:2888:3888
server.2=itcast06:2888:3888
server.3=itcast07:2888:3888

3.3 Create a myID file in (datadir=/itcast/zookeeper-3.4.5/data) with the contents of server. N in N (the content of SERVER.2 is 2)
echo "1" > myID

3.4 Copy the configured ZK to the other nodes
Scp-r/itcast/zookeeper-3.4.5/itcast06:/itcast/
Scp-r/itcast/zookeeper-3.4.5/itcast07:/itcast/

3.5 Note: Be sure to modify the contents of myID on other nodes
In itcast06 should talk about myID content changed to 2 (echo "6" > myID)
In itcast07 should talk about myID content changed to 3 (echo "7" > myID)

4. Start the cluster
Start ZK separately
./zkserver.sh Start

View cluster status

The./zkserver.sh Status View results should be a leader, multiple follower

B: Problems that arise

1: Occurs at startup:

Viewing status after starting multiple machines individually is still it is probably not running

    

Then go to the Bin directory to view the Zookeeper.out log file to see the following information:

    

It is said that the cluster deny connection is still not the reason for exiting the log file to continue viewing errors during the restart of the cluster.

Then I looked at the log and found this sentence.

    

My group of IP is 192.168.2.23--192.168.25 but myid:1 to connect myid:2 when the IP is 192.168.2.22. Instantly understand,----configuration file in the host name is WRONG!!!

To open a configuration file:

      

It was wrong to write. Modify the host name. It's OK.

      



Installing the zookeeper cluster and the problems that arise

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.