Zookeeper3.4.5 cluster Installation notes

Source: Internet
Author: User

Zookper is a distributed, open-source collaborative service that is applied to distributed applications. It provides some simple operations so that distributed applications can implement services such as synchronization, configuration maintenance, and sharding or naming based on these interfaces. There are a lot of installation tutorials on the Internet, some of which are really good, but there are always some pitfalls that mislead everyone about installation. This time I personally experienced it, the installation steps and problems encountered during installation are released for everyone to learn.

First, download the zookeeper installation package. : Http://apache.claz.org/zookeeper/zookeeper-3.4.5/ through the following command: wget http://apache.claz.org/zookeeper/zookeeper-3.4.5/ and then enter the directory, directly decompress: tar zxvf zookeeper-3.4.5.tar.gz modify zoo_sample.cfg under the zookeeper-3.4.5/conf directory to zoo. cfg. Run the following command: mv zoo_sample.cfg zoo. cfg and configure the file as follows:
tickTime=2000dataDir=/home/hadoop/zookeeper/dataclientPort=2181initLimit=10syncLimit=5server.1=Master.Hadoop:2888:3888server.2=Slave1.Hadoop:2888:3888server.3=Slave2.Hadoop:2888:3888
Each field has its own meaning. If you are interested, you can view the meaning of relevant fields on your own. The following server.1, server.2, and server.3 labels indicate three zookeeper nodes, all of which share the same status. At work, they use an algorithm to recommend a leader and all others are follower, you can see in the subsequent verification. As shown in figure: publish the service to the other two nodes (pay attention to your directory before execution ):
scp -r zookeeper-3.4.5/ hadoop@Slave1.Hadoop:~/zookeeper/scp -r zookeeper-3.4.5/ hadoop@Slave2.Hadoop:~/zookeeper/

Set myid to create a myid file under the directory specified by dataDir, which contains a number to identify the current host, conf/zoo. the server configured in the cfg file. why is the number of X in X entered in the myid file? For example:
hadoop@Master:~/zookeeper$ echo "1" > /home/hadoop/zookeeper/myid hadoop@Slave1:~/zookeeper$ echo "2" > /home/hadoop/zookeeper/myid hadoop@Slave2:~/zookeeper$ echo "3" > /home/hadoop/zookeeper/myid 

Start zookeeper
hadoop@Master:~/zookeeper/zookeeper-3.3.4$ bin/zkServer.sh starthadoop@Slave1:~/zookeeper/zookeeper-3.3.4$ bin/zkServer.sh starthadoop@Slave2:~/zookeeper/zookeeper-3.3.4$ bin/zkServer.sh start
Because the three nodes are started sequentially, when the three nodes are started one after another, some errors will be reported when the node that is started first connects to the node that is not started. Can be ignored. A problem occurs. The following shows how to view the log: The Directory written in the configuration file zoo. cfg has a problem. The directory configured is different from the directory created for myid. It is easy to find problems in step 1. Modify the directory of myid. Check whether the operation is successful. The status of the following three nodes is detected:

<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + pgltzybzcm9 "http://www.bkjia.com/uploadfile/Collfiles/20131226/2013122615204027.jpg" alt = "">

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.