Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Single ZooKeeper service to point to - is there an alias for ZooKeeper?

avatar
Rising Star

I am running CDH 5.2 managed by Parcels and CM 5.2. I have a few Java applications that require ZooKeeper and I don't like to point to a specific named host because the host could potentially change. Is there a ZooKeeper alias I can use that will point my query to the leader of the ZooKeeper quorum? Or can I just point to any of the three ZooKeeper services and expect my query to work. What I'm looking for is one name for ZooKeeper that will be correct no matter what host I'm running the ZooKeeper servers from. Any advice would be appreciated. 

1 ACCEPTED SOLUTION

avatar
If your services (eg: HDFS, HBase) are marked as dependent on that
ZooKeeper service, then the ensemble will a part of their config
(hdfs-site.xml, hbase-site.xml). If your application uses HBase for
example, then mark the node as a gateway which will deploy the config in
/etc/hbase, then let your app use those.

If you're running a custom app that has its own set of config files, then
you should provide all ZooKeeper servers. Pointing to only one would mean
you might face an outage if it is down. The ZooKeeper client libraries know
how to deal with multiple servers and switch connections if one goes down.

Regards,
Gautam Gopalakrishnan

View solution in original post

1 REPLY 1

avatar
If your services (eg: HDFS, HBase) are marked as dependent on that
ZooKeeper service, then the ensemble will a part of their config
(hdfs-site.xml, hbase-site.xml). If your application uses HBase for
example, then mark the node as a gateway which will deploy the config in
/etc/hbase, then let your app use those.

If you're running a custom app that has its own set of config files, then
you should provide all ZooKeeper servers. Pointing to only one would mean
you might face an outage if it is down. The ZooKeeper client libraries know
how to deal with multiple servers and switch connections if one goes down.

Regards,
Gautam Gopalakrishnan