your problem seems to have to do with NAT = network address translation. EC2 uses a 10.x.x.x network of private addresses internally, i.e., you can only connect to those addresses from inside that network - by definition. You need to find out what the public IP address of these servers is. Then point another DNS name for each machine, e.g.,, to these nodes' public IP addresses.

So, the zoo.cfg of the zookeepers will specify the EC2-internal host names, a set of public DNS names points to the respective public IP addresses of these services (assuming they are publically reachable from the Internet), and the client connect strings have to use these public DNS names. That should do the trick.

Best regards,

On 23.09.2014 17:36, Carl Hörberg wrote:
When starting up zookeeper it finds its own hostname, eg: 

2014-09-23 15:28:02,356 [myid:] - INFO [main:Environment@100] - Server

But is it possible to override it? I've tried changing /etc/hostname but to no avail. 

The problem I have is that when a client connects to the servers public IP it seems like the connection is accepted but then the clients tries to resolve and connect to the hostname that the server has set, so if the client can't resolve it, eg. in this case if the client isn't in EC2, it won't successfully connect. 


Mit freundlichen Grüßen/Kind regards/Cordialement vôtre/Atentamente/С уважением
i.A. Jürgen Wagner
Head of Competence Center "Intelligence"
& Senior Cloud Consultant

Devoteam GmbH, Industriestr. 3, 70565 Stuttgart, Germany
Phone: +49 6151 868-8725, Fax: +49 711 13353-53, Mobile: +49 171 864 1543
E-Mail:, URL:

Managing Board: Jürgen Hatzipantelis (CEO)
Address of Record: 64331 Weiterstadt, Germany; Commercial Register: Amtsgericht Darmstadt HRB 6450; Tax Number: DE 172 993 071