I'm looking for the best way to perform regular rolling upgrades for my infrastructure.
Typically, this involves doing this on each host, one at a time:
sudo yum update -y && sudo reboot
But, I'm hitting limits of that being a scalable.
I want to only reboot one node at a time within each of my roles, so that, say, I don't take down all of my load balancers, or DB cluster members, at the same time.
Ideally, I'd wanna do something like:
for role in $(< roles_list.txt) ; do
mco package update_all_and_reboot \
--batch 1 --batch-sleep 90 \
-C $role -F environment=test
done
But, that doesn't quite seem to exist. I'm not sure if using the "shell" agent is the best approach, either?
mco shell run 'yum update -y && reboot' \
--batch 1 --batch-sleep 90
Am I just looking at the wrong sort of tool for this job, though? Is there something better for managing these sort of rolling reboots, but that I can somehow link up with my Puppet-assigned roles, so that I can be comfortable that I'm not taking down anything important all at once, but that I can still do some parallel updates & reboots?
Configuration
Deploy
and
on both hosts, i.e.
test-server1
andtest-server2
.Services
Restart mcollective on both services:
and
Commands
Run the following commands on the mcollective server node:
The host
test-server2
is listening:Reboot the
test-server2
:The
test-server2
is rebooting:and it has been rebooted:
Note that it is possible to shutdown a host as well:
Original code
/usr/libexec/mcollective/mcollective/agent/power.rb
/usr/libexec/mcollective/mcollective/agent/power.ddl
/usr/share/ruby/vendor_ruby/mcollective/application/power.rb
Modified code
/usr/libexec/mcollective/mcollective/agent/power.ddl
/usr/libexec/mcollective/mcollective/agent/power.rb
Command