Zookeeper Cluster Mode Unable to Deploy Cloud Server [java.net.BindException: Unable to specify the Bind failed]

Source: Internet
Author: User
Keywords Cloud computing zookeeper cloud server deployment ZooKeeper cluster
Zookeeper cluster mode can not deploy the cloud server [java.net.BindException: Unable to specify the requested address (Bind failed)] solution. text

When deploying Zookeeper cluster mode on a cloud server (Aliyun cloud, Tencent cloud), there are many reasons why it can not be successfully used. There are two main problems mentioned above, such as the port being occupied (not open) and the firewall being opened. There are many similar blogs, Go into detail
If you have been modified for the two cases still did not succeed, then there may be a problem of this chapter.
When ZooKeeper is started, it does not print information, and even if the cluster fails to start up, it will still display:


So that we can not see the log information, we can not judge the problems that have passed

# zkServer.sh start-foreground

You can see the Zookeeper start-up information.
Zookeeper each start a lot of information, we must turn the top to start from the first look.

If you have this error message

2017-08-05 09: 27: 32,253 [myid: 1] - ERROR [/xxx.xx.xxx.xxx (your IP): 3888: QuorumCnxManager $ Listener @ 763] - Exception while listening java.net.BindException: Can not specify the requested address at java.net.PlainSocketImpl.socketBind (Native Method) at java.net.AbstractPlainSocketImpl.bind (AbstractPlainSocketImpl.java:382) at java.net.ServerSocket.bind (ServerSocket.java:375) at java .net.ServerSocket.bind (ServerSocket.java:329) at org.apache.zookeeper.server.quorum.QuorumCnxManager $ Listener.run (QuorumCnxManager.java:742)

Congratulations, I encountered the same problem.

Solution

Very simple, add on zoo.cfg on each Zookeeper node

quorumListenOnAllIPs = true

Then restart all nodes.

the reason

I myself do not really understand, probably for cloud servers, due to the use of virtualization technology. . . . . . balabala, hope people who are familiar with this area can enlighten me.

Potential problems with this parameter

Mainly affect the ZAB protocol and FastLeaderElection agreement.
The official website is as follows

quorumListenOnAllIPs

When set to true the ZooKeeper server will listen for connections from its peers on all available IP addresses, and not only the address configured in the server list of the configuration file. It affects the connections handling the ZAB protocol and the Fast Leader Election protocol. Default value is false

Extra bonus

In the Zookeeper official website to find a variety of configuration parameters, if there is any problem so blind.
Zookeeper configuration parameter description

Thanks & quote

This article mainly quoted and referenced @ Back small kiss blog zookeeper cluster can not start properly Thank bloggers to share.

At the same time, I would also like to thank Climbing and Zhang Gen for their help. The final solution to this problem

Mental history

Distributed reptiles at hand, from their own hands-on preparation of distributed coordination algorithm to the selection of Zookeeper. From overfilling the Kazoo English API documentation to deploying Zookeeper failed again and again. Then in the face of abnormal Java network programming I do not know where to start. . . . Fortunately, the last of the straw - seniors promptly delivered a horse to save me, bug ah bug, there will always be a solution, fate to the natural has become.

Of course, this matter also fully reflects the important technical aspects, in fact, the first time to seek help Pharaoh, Pharaoh given the right direction, that is, cloud server virtualization may exist in this pit, but I am Virtualization is ignorant, did not think of this. And then saw that Java anomaly, their search on the Internet no relevant explanation, there may be a little bit of accumulation on both can probably have a direction.

Me and I finally stubborn, and finally asked the seniors seniors, thanks @ climb cling to seniors and @ stupid seniors.

Really embarrassed, and finally seniors find articles blog. . . However, I have not found N articles, but sometimes the bug still rely on fate.

Related Article

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.