Druid can't connect zookeeper cluster

I have a zookeeper cluster , which is druid_master, druid_d_01, druid_q_01.

In druid_master, the content of etc/hosts is


127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.1.14	druid_master

192.168.1.75	druid_d_01

192.168.1.113	druid_q_01

when I start coordinator service , it can only connect local zookeeper service, and the wrong information is :

2019-02-21T02:32:53,003 ERROR [main] org.apache.zookeeper.client.StaticHostProvider - Unable to connect to server: druid_q_01:2181

java.net.UnknownHostException: druid_q_01: 未知的名称或服务

at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[?:1.8.0_191]

at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929) ~[?:1.8.0_191]

at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1324) ~[?:1.8.0_191]

at java.net.InetAddress.getAllByName0(InetAddress.java:1277) ~[?:1.8.0_191]

at java.net.InetAddress.getAllByName(InetAddress.java:1193) ~[?:1.8.0_191]

at java.net.InetAddress.getAllByName(InetAddress.java:1127) ~[?:1.8.0_191]

at org.apache.zookeeper.client.StaticHostProvider.(StaticHostProvider.java:62) [zookeeper-3.4.11.jar:3.4.11-37e277162d567b55a07d1755f0b31c32e93c01a0]

at org.apache.zookeeper.ZooKeeper.(ZooKeeper.java:449) [zookeeper-3.4.11.jar:3.4.11-37e277162d567b55a07d1755f0b31c32e93c01a0]

at org.apache.curator.utils.DefaultZookeeperFactory.newZooKeeper(DefaultZookeeperFactory.java:29) [curator-client-4.0.0.jar:?]

at org.apache.curator.framework.imps.CuratorFrameworkImpl$2.newZooKeeper(CuratorFrameworkImpl.java:191) [curator-framework-4.0.0.jar:4.0.0]

at org.apache.curator.HandleHolder$1.getZooKeeper(HandleHolder.java:101) [curator-client-4.0.0.jar:?]

at org.apache.curator.HandleHolder.getZooKeeper(HandleHolder.java:57) [curator-client-4.0.0.jar:?]

at org.apache.curator.ConnectionState.reset(ConnectionState.java:201) [curator-client-4.0.0.jar:?]

at org.apache.curator.ConnectionState.start(ConnectionState.java:111) [curator-client-4.0.0.jar:?]

at org.apache.curator.CuratorZookeeperClient.start(CuratorZookeeperClient.java:214) [curator-client-4.0.0.jar:?]

at org.apache.curator.framework.imps.CuratorFrameworkImpl.start(CuratorFrameworkImpl.java:308) [curator-framework-4.0.0.jar:4.0.0]

at org.apache.druid.curator.CuratorModule$1.start(CuratorModule.java:109) [druid-server-0.13.0-incubating-iap8.jar:0.13.0-incubating-iap8]

at org.apache.druid.java.util.common.lifecycle.Lifecycle.start(Lifecycle.java:311) [java-util-0.13.0-incubating-iap8.jar:0.13.0-incubating-iap8]

at org.apache.druid.guice.LifecycleModule$2.start(LifecycleModule.java:134) [druid-api-0.13.0-incubating-iap8.jar:0.13.0-incubating-iap8]

at org.apache.druid.cli.GuiceRunnable.initLifecycle(GuiceRunnable.java:109) [druid-services-0.13.0-incubating-iap8.jar:0.13.0-incubating-iap8]

at org.apache.druid.cli.ServerRunnable.run(ServerRunnable.java:58) [druid-services-0.13.0-incubating-iap8.jar:0.13.0-incubating-iap8]

at org.apache.druid.cli.Main.main(Main.java:118) [druid-services-0.13.0-incubating-iap8.jar:0.13.0-incubating-iap8]

Hi Wang,

Have you tried using IPs rather than host names in the config?

Best,

Caroline

Thanks for your reply

Yeah, I have tried both hostnames and IPs, the results are the same.

Still get the error information: java.net.UnknownHostException: 192.168.1.75: 未知的名称或服务

Best regards,

Wang

how about trying “telnet 192.168.1.75 2181” on your localhost console? does that work?