Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-1734

Zookeeper fails to connect if one zookeeper host is down on EC2 when using elastic IP (UnknownHostException)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.4.5
    • Fix Version/s: None
    • Component/s: java client
    • Labels:
      None
    • Environment:

      Amazon EC2. Linux.

      Description

      We use Amazon Elastic IP for zookeeper hosts so that the zookeeper hosts have the same IP address after a restart.

      The issue is, if one host is down then we cannot connect to the other hosts.

      Here is an example connect string:

      "ec2-1-2-3-4.compute-1.amazonaws.com, ec2-4-3-2-1.compute-1.amazonaws.com, ec2-5-5-5-5.compute-1.amazonaws.com"

      If all three hosts are up, we can connect. If one host is down, then we cannot create a Zookeeper instance due to an UnknownHost exception, even though the other servers in the connect string are valid.

      java.net.UnknownHostException: ec2-5-5-5-5.compute-1.amazonaws.com
      at java.net.InetAddress.getAllByName0(InetAddress.java:1243)
      at java.net.InetAddress.getAllByName(InetAddress.java:1155)
      at java.net.InetAddress.getAllByName(InetAddress.java:1091)
      at org.apache.zookeeper.client.StaticHostProvider.<init>(StaticHostProvider.java:60)
      at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:445)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                andygrove Andy Grove
              • Votes:
                1 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated: