jurmous / etcd4j

Java / Netty client for etcd, the highly-available key value store for shared configuration and service discovery.
Apache License 2.0
267 stars 83 forks source link

Connecting to a etcd cluster using dns server name instead of IP #175

Closed pankaj-cashify closed 6 years ago

pankaj-cashify commented 6 years ago

When I use DNS server name instead of IP for etcd URL. The ETCD clients either hangs for long period of time or return result after 30 seconds or so.

EtcdClient etcd = new EtcdClient(URI.create("http://etcd.prv.api.abcd.in:80")); String value = etcd.get("test").send().get().getNode().getValue(); System.out.println("value: " + value);

Above code works fine if I use URL as http://127.0.0.1:2379

lburgazzoli commented 6 years ago

did you try with etcdctl ?

pankaj-cashify commented 6 years ago

I can run 'curl http://etcd.prv.api.abcd.in:80/v2/keys/test' fine

pankaj-cashify commented 6 years ago

Ignore this issue. Seems it was some issue with IDE.