Rolling updates

54 views
Skip to first unread message

Mark Eisenblätter

unread,
Apr 9, 2014, 3:41:01 AM4/9/14
to help-c...@googlegroups.com
hello list,

i' am using cf2 for quite a while and now starting with cf3, so my general knowledge is not to deep.

for my first project i will need rolling upgrades for a group of systems, if the service need to be restarted. 
installing new software/configurations is not the problem, and restarting when changes were made is ok.  

but how do i coordinate that only one(ore more) system is restarted at any time until all are finished.


thanks in advanced,
mark 

Neil Watson

unread,
Apr 9, 2014, 7:57:52 AM4/9/14
to help-c...@googlegroups.com
I think using deterministic classes will help you distribute your
promises over a time window. Checkout dist and splayclass.

https://cfengine.com/docs/3.5/reference-functions-splayclass.html
https://cfengine.com/docs/3.5/reference-promise-types-classes.html#dist

You could also do it manually.

classes:
"batch" and => { "Hr10", hostrange("myhost_", "00-10") };
"batch" and => { "Hr11", hostrange("myhost_", "10-20") };

files:
batch::
"/myconfig.conf"
...
action => if_elapsed( "60" ),
classes => if_repaired( "restart_myservice" );

commands:
restart_myclass::
"/sbin/service restart myservice";

--
Neil H Watson
Promise Reporting with CFEngine Community http://evolvethinking.com/products/delta-reporting/
Make CFEngine simple with EFL http://evolvethinking.com/evolve-thinkings-free-cfengine-library/
VIM and Cfengine https://github.com/neilhwatson/vim_cf3

Eisenblätter, Mark

unread,
Apr 9, 2014, 8:53:58 AM4/9/14
to help-c...@googlegroups.com
hi,

dist and splayclass looks good.

manually would be ok for a static setup, but we plan to use some scale up routines.

thanks for the help,

mark




--
You received this message because you are subscribed to a topic in the Google Groups "help-cfengine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/help-cfengine/5Ey1vB_Vc6I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to help-cfengine+unsubscribe@googlegroups.com.
To post to this group, send email to help-c...@googlegroups.com.
Visit this group at http://groups.google.com/group/help-cfengine.
For more options, visit https://groups.google.com/d/optout.



--
Grüße,
Mark Eisenblätter
____________________________________

G&L Geißendörfer & Leschinsky GmbH
Systemhaus für Streaming, Softwareentwicklung und Internetdienste
Maarweg 149-161 Haus 3, D-50825 Köln, Deutschland / Germany

Unseren Support erreichen Sie unter der Nummer 0700 07873267 (07000streams) oder senden Sie ein Mail an sup...@gl-systemhaus.de


Skype: meisenblaetter
Jabber(google chat): mark.eise...@gl-systemhaus.de

Geschäftsführer: Alexander Leschinsky
Amtsgericht Köln, HRB 56772
Ust.-IdNr. DE814612929, Steuernr. 214 5806 22 63

Nick Anderson

unread,
Apr 9, 2014, 9:32:29 AM4/9/14
to Eisenblätter, Mark, help-c...@googlegroups.com
Also checkout the peers() function. With enterprise you could also use hostswithclass() and classesmatching to manage the coordination in a distributed way.


--
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to help-cfengin...@googlegroups.com.

Aleksey Tsalolikhin

unread,
Oct 1, 2015, 5:29:27 PM10/1/15
to help-cfengine, mark.eise...@gl-systemhaus.de, Nick Anderson
Could you please provide an example of using hostswithclass() and classesmatching() to manage the coordination of a rolling upgrade?  Let's say I'm running "yum -y update-minimal --security && /sbin/reboot", and I only want one server per location to run it at a time?

I looked at https://docs.cfengine.com/latest/reference-functions-hostswithclass.html but didn't understand it.  Why is the policy hub editing a file? (Might help to add a comment to that files promise.)
To unsubscribe from this group and all its topics, send an email to help-cfengin...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages