Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

Solved Go to solution
Highlighted

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

Expert Contributor

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

Accepted Solutions

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

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
1 REPLY 1

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

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
Don't have an account?
Coming from Hortonworks? Activate your account here