Paul Freeman
2012-Apr-20 01:22 UTC
[Nut-upsuser] Understanding the shutdown sequence of steps for a master and slave configuration
I am running the standard nut package (v 2.4.3) on a number of servers running Ubuntu 10.04 LTS. I have one master server which has an Upsonic 2000VA UPS connected via a USB port. The driver I am using is blazer_usb. I also have a number of slave servers (including some running virtual servers) running the same version of Ubuntu and nut as the master. I have configured the master to use upssched to issue the upsmon -c fsd command after 10 minutes of the UPS running on battery as I decided after much thought was the "best" way to allow sufficient time for the slaves and master to shutdown after a power failure. I was recently away and a power failure occurred. The nut master detected this and the slaves picked this up also. The power outage continued for > 10minutes so the upssched timer expired and upsmon -c fsd command was issued. The slaves detected this and commenced shutting down as expected. However, the master also commenced shutting down. I had expected the master to wait until the slaves had indicated they were shutting down before shutting itself down. This meant a number of the slave servers did not complete a clean shutdown before the power was removed. I was wondering what is the best way to ensure the slaves have actually shutdown before the master shuts down? The options I see at the moment include specifying a longer HOSTSYNC value (I am using the default of 15 sec), a longer FINALDELAY value (I am using the default of 5 sec) or edit the SHUTDOWNCMD so that it waits for a few minutes before actually shutting down? At this point I have decided to change the time parameter to the SHUTDOWNCMD to 5 minutes as I am confident the UPS has sufficient reserve to last that long. In trying to understand what actually happens on a slave when it receives the FSD command I have noticed the slave does not appear to actually formally logout from the master server. ie there are no log entries indicating the slave logged out in syslog. Is this the expected behaviour? Also, is there any way to see how many logged in slaves there are on the server? Any comments and suggestions are welcome. Thanks Paul
Gabriele
2012-Apr-20 07:55 UTC
[Nut-upsuser] Understanding the shutdown sequence of steps for a master and slave configuration
Hy, I have the same situation. In brief: the trick is to put FINALDELAY 600 on the master node. My shutdown sequence is: * power outage occurs * master not waits 300 seconds (timer of upssched) * after 300 seconds, the master node sends shutdown signal to all slaves * masternode waits 600 seconds (FINALDELAY) doing nothing * all slaves initiates shutdown. I calculated that I have enough time. * when the 600 seconds FINALDELAY expires on master, it starts shutdown * My UPS is configured to wait 340 seconds before cutting power * after 340 seconds, power is disconnected * when power returns, my ups will wait for 90 seconds AND at le ast 15% of battery power to restore power My 2c, -- Gabriele
Paul Freeman
2012-Apr-25 21:35 UTC
[Nut-upsuser] Understanding the shutdown sequence of steps for a master and slave configuration
Gabriele, Thank you for your reply. I will try your solution. Regards Paul> -----Original Message----- > From: nut-upsuser- > bounces+paul.freeman=emlair.com.au at lists.alioth.debian.org [mailto:nut- > upsuser-bounces+paul.freeman=emlair.com.au at lists.alioth.debian.org] On > Behalf Of Gabriele > Sent: Friday, 20 April 2012 5:55 PM > To: nut-upsuser at lists.alioth.debian.org > Subject: Re: [Nut-upsuser] Understanding the shutdown sequence of steps > for a master and slave configuration > > Hy, > I have the same situation. > In brief: the trick is to put FINALDELAY 600 on the master node. > > My shutdown sequence is: > > * power outage occurs > * master not waits 300 seconds (timer of upssched) > * after 300 seconds, the master node sends shutdown signal to all slaves > * masternode waits 600 seconds (FINALDELAY) doing nothing > * all slaves initiates shutdown. I calculated that I have enough time. > * when the 600 seconds FINALDELAY expires on master, it starts shutdown > * My UPS is configured to wait 340 seconds before cutting power > * after 340 seconds, power is disconnected > * when power returns, my ups will wait for 90 seconds AND at le > ast 15% of battery power to restore power > > My 2c, > -- > Gabriele > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at lists.alioth.debian.org > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser