Glu agent zookeeper configuration refresh

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

Glu agent zookeeper configuration refresh


My glu scripts reference zookeeper configuration. Eg
baseInstallDir = shell.env["install.dir"]

I've updated the value of "install.dir" in zookeeper (org/glu/agents/fabrics/<env>/config/, but the agents do not see the change until I restart them.  Is there a rest api on the agent which I can invoke to force them to update their configuration from zookeeper?

Any recommendations for handling the need to update fabric common configuration supplied to the glu scripts?


Reply | Threaded
Open this post in threaded view

Re: Glu agent zookeeper configuration refresh

The agent does offer a REST api to change the config: a PUT at /config. And here is the code that gets executed when this happens: 

It is being used right now only on an agent that has not been started with a fabric or ZooKeeper and the UI will provide it (using this api) (so the agent is started "enough" to listen to this but not really booted yet).

But as you can see from the TODO in the code, although it can be used to change the properties of an agent and they will be properly saved, if the agent is up and running then it won't be rebooted automatically.

In other words, without changing the code, you cannot invoke the REST api without rebooting the agent.

I think what you could to provide fabric common configuration is to store them in ZooKeeper (in a different path which contains the name of the fabric in the path) and use the "agentZooKeeper" ( property to access ZooKeeper:



and in the glu script