Closed burakdede closed 8 years ago
I got the same error. But i was using http://my_etcd_container:2379
to create an EtcdClient
. So at first i thought this PR would not solve the problem. But my problem was that i contains underscore in my hostname, that is invalid. So java.net.URI
can't parse it.
But i'm wondering if using 80 as default port is good enough, because etcd itself uses 4001 for client and 7001 for server as default port
I think that if the port is not provided it should eventually default to etcd defaults, not port 80.
An additional option is to retrieve connection info from env like etcdctl does
Yes, my point was etcd node may sit behind of some kind of proxy and it may not have explicit port information (80 does not make sense and work for everyone, thats true) but at least it should not fail because no explicit port information provided.
@burakdd would you be able to rework this PR to behave according to the discussion ?
See etcdct- endpoint
@lburgazzoli
ETCD4J_ENDPOINT
if uri list emptyThx for the PR
:+1: thanks
This tries to fix problem when given uri does not have port information attached on EtcdNettyClient.connect. This happens when you put your nodes in cluster behind some proxy like nginx to enable basic authentication (which by default listens port 80).
Of course sending port information attached to URI when creating
EtcdClient
explicitly is another solution, let me know which one works for you.