Master/Slave Configuration

General

If you have two or more computers that are powered by the same UPS and they are connected by a network, you can configure apcupsd so that the computer that controls the UPS (connected by the serial port or USB port), which is called the master, can provide information to other machines powered by the UPS, called slaves. When the master detects a power failure, it will notify all the slaves (maximum of twenty). If the master detects that the battery is low, it will also notify the slave so that the slave may perform a shutdown.

In addition, in cases where you wish to keep the master up longer than the slave, you can configure the slave to shutdown in a predetermined time after the UPS goes on batteries.

If a picture is worth a thousand words for you, please see the Three Major Configuration Possibilities for Apcupsd section of the Configuration chapter of this manual.

Configuration Directives

The minimum set of configuration directive changes needed to create a proper master and slave configuration files is described in the Configuration Examples section of this manual.

The details of these directives is explained in the UPS Sharing section of the Configuration chapter of this document.

In addition, sample master and slave configuration files can be found in the <src>/examples directory (apcupsd.master.conf and apcupsd.slave.conf).

Master/Slave Problems

If you are having problems getting a master/slave configuration to work, or you are getting error messages, please see the Trouble Shooting Apcupsd Chapter of this manual for more details.

Master/Slave Shutdown

For additional details of shutting down a master/slave configuration, please see the Master/Slave Shutdown section of the Shutdown chapter of this manual.

Master/Slave Networking using NIS and the NET Driver

It is also possible to implement a network of master/slave apcupsds using the new 3.10.x code and the net driver. This mode of master/slave networking is considerably different from the old method described at the beginning of this chapter. In the old code, there is a lot of configuration on both the master and slave side, and the master polls or sends info to the slave. Using the net driver is much simpler. However, you should carefully check that the slave does a proper shutdown. In the master/slave code, the master ensures the best it can that the slave is shutdown or notified before it shuts down itself. On the other hand, using the net driver, the master knows nothing about the slaves that may be listening and thus takes no special precautions to ensure that the slaves receive the shutdown signal. Since the slave reads the master's data once per second there should be no shutdown problems, and our experience confirms this. This point can be answered in your case by carefully testing the shutdown.

In this master/slave mode, the master is a standard stand alone configuration except that it must have NETSERVER on in the configuration file and have an NISPORT nnn defined. Thus any apcupsd running in this mode then becomes the master.

The slave then uses the net driver to connect to the master's NIS output. In this mode, the slave decides how often to poll the master for the NIS information. The slave copy of apcupsd, have UPSTYPE net, which will invoke the "network" driver. By setting this machine's DEVICE to be master-ip:master-NIS-port it will automatically connect to the master and use the master's signals to shutdown the computer. In the example net slave configuration file below, the slave uses the NIS information provided by the computer tibs on port 3551.

## apcupsd.conf v1.1 ##
UPSCABLE ether
UPSTYPE net
# Specify the server name:port where NIS is running
DEVICE tibs:3551
LOCKFILE /var/lock
BATTERYLEVEL 5
MINUTES 3
TIMEOUT 0
ANNOY 300
ANNOYDELAY 60
NOLOGON disable
EVENTSFILE /etc/apcupsd/apcupsd.events
UPSCLASS standalone
UPSMODE disable
#
# Use this to control the poll time.
#  the default is 60 or 1 minute
#
NETTIME 30


Back Next Home