Laboratory of Scientific Computing "Marco D'Apuzzo"


Deploying NUT on an Ubuntu 10.04 cluster

This article describes installing and configuring NUT Network UPS Tools on the cluster consisting of eleven PCs 
and two servers, all connected to the network through Fast Ethernet switch. The two servers perform the functions 
of gateway and server-nis. The operating system. Ubuntu 10.04 kernel 2.6.32-22 is installed on all these PCs. The protection is provided by four types Atlantis Land 3000VA ups managed by NUT in order to shutdown all PCs whenever the value of the battery gets below the critical level.

Installation and configuration of master node
1)
Install NUT on nis-server:
     root@myhost> apt-get install nut
2) Edit the file /etc/nut/nut.conf and add:
    MODE=netserver
3)
Edit the file /etc/nut/ups.conf and modify it as follows:
    [MyUpsName]
             driver = megatec
             port = /dev/ttyS0
4)
Edit the file /etc/nut/upsd.user:
    [MyUsername]
              password = MyPass
              upsmon  master
5) Edit the file /etc/nut/upsmon.conf and add the following line:
    MONITOR MyUpsName@HostIpAddress 1 MyUsername MyPass master
   
where HostIpAddress is the type 192.168.3.2
6) Edit the file /etc/nut/upsd.conf and add the line:
     LISTEN HostIpAddress
7)
Start the service:
      root@myhost> /etc/init.d/nut start

Installation and configuration of slave node
1)
Install nut on gateway:
     root@myhost> apt-get install nut
2)
Edit  /etc/nut/nut.conf and add:
    MODE=netclient
3)
Edit /etc/nut/upsmon.conf and add the following line:
    MONITOR MyUpsName@HostIpAddress 1 MyUsername MyPass slave
4)
Start the service:
    root@myhost> /etc/init.d/nut start

Installing and configuring master and slave of the remaining groups of PCs
The second group includes PC1 as master node, PC2, PC3 and PC4 as slave nodes. For PC1, repeat  steps 1) to 7) of the Installation and configuration of master node process. For PC2, PC3 and PC4 repeat steps 1) to 4) of the Installation and configuration of slave nodes process. Do this for each computer group you want to control.

Verification operations
Type:
root@myhost
> upsc MyUpsName@HostIpAddress
This furnishes us information about the ups status.
In order
to verify the proper functioning of master nodes, type:

root@myhost
> upsmon –c fsc
this produces an immediate shutdown of all controlled slave nodes.
Confirmation of a proper shutdown is achieved by checking the file daemon.log:
root@myhost> less /var/log/daemon.log | grep shutdown
the following phrase is expected to appear Auto logout and shutdown proceeding.

Written by Angelone Stefano e-mail stefano.angelone@unina2.it