Can model versions be read from Zookeeper?

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

Can model versions be read from Zookeeper?

oldgluuser
Using the jetty glu script example to ask this question.  What if I wanted to have the jetty version read by the script from zookeeper?  Writing the groovy to do that is easy, so I am not questioning how to do that.

Rather, the changes to the Glu Script would be such that the Model did not have the specific version in it anymore - so it would not need to change when the latest version of jetty (or a war file deployed there) changed.

Would such an approach be good or bad?
Reply | Threaded
Open this post in threaded view
|

Re: Can model versions be read from Zookeeper?

frenchyan
Administrator
As you say this does not really have anything to do with glu. In my mind it is really a matter of practice for your company, how do you handle testing, etc...

I personally do not like the "implicit" approach. The problem is that at the end of the day, what you are running is not just a war. It is a web container (jetty) which runs your war. If there is a new version of jetty and you simply update some entry in ZooKeeper, it will not be reported as a delta. Let's say it is a critical update and you must have it on all your webapps deployed. You now have no way to know which one has been or has not been updated. Let's say you select all in the console and issue a "redeploy all", which will technically undeploy and redeploy everything => all your apps will pick the latest jetty... Let say that for some reason the process stops in the middle (network failure, etc...). Now you have no way to know which of your apps are running with the latest jetty or not. The only thing you can do is do a redeploy all hopping it will work this time.

Another use case: you actually want to try the new jetty in a production setup on only 1 war. If you change the value in zookeeper then ANY war that will be redeployed would pick it up (ex: a machine crash and you need to reinstall it).

I do understand that if it is in the model it is repeated for every single entry (soon you will be able to write your model in groovy, thus NEVER repeating this value...), but then you have the safety of being sure that what is running is what you have expressed in the model.

Yan
Reply | Threaded
Open this post in threaded view
|

Re: Can model versions be read from Zookeeper?

oldgluuser
Thanks - what you say makes a lot of sense.  I was questioning the initial approach I used!  My need is to be able to automate such updates - of war files or, in our case, versions of Tomcat (and other applications).  So I pull down the static model via a REST call, update the version number via groovy in one of my timer tasks, and then upload the new model, again via REST.   I think this gives me the consistency you describe, though I certainly had not thought of it that way previously!