Quantcast

Accessing Zookeeper from within a GLU script

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Accessing Zookeeper from within a GLU script

Russ
I'm attempting to control a piece of software (accumulo) that, during the initialization phase, creates entries in zookeeper.  While the code to check these entries is trivial, the script is failing at the point where I'm attempting to create a new connection to zookeeper.

So my questions are:
   1. Is it possible to access zookeeper directly from within my glu script?
   2. If so, what is the preferred method to access zookeeper?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Accessing Zookeeper from within a GLU script

frenchyan
Administrator
If your script needs to access the SAME ZooKeeper cluster as the agent, then you can simply use the agentZooKeeper attribute on the script (http://pongasoft.github.io/glu/docs/latest/html/glu-script.html#capabilitieshttps://github.com/pongasoft/glu/blob/master/agent/org.linkedin.glu.agent-api/src/main/groovy/org/linkedin/glu/agent/api/GluScript.groovy#L101)

It gives you access to an IZKClient object (https://github.com/pongasoft/utils-zookeeper/blob/master/org.linkedin.zookeeper-impl/src/main/java/org/linkedin/zookeeper/client/IZKClient.java) which is a thin wrapper around the ZooKeeper class with extra functionalities added

Yan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Accessing Zookeeper from within a GLU script

Russ
Thanks for the pointer to the IZKClient class.   That will help during the read-only phase (checking if accumulo is configured).  Unfortunately, while I need access to the same zookeeper instance, I will need different credentials when I get to the uninstall phase.

My guess is that, at this point, I'll need to have glu write the appropriate shell scripts.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Accessing Zookeeper from within a GLU script

frenchyan
Administrator
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Accessing Zookeeper from within a GLU script

Russ
Thank you.  That is quite helpful.
Loading...