Revision history
-
1.0 — November 2024 — Initial version
1. Introduction
This document provides instructions for installing metclient (a met. data recorder) for Field System computers. It is assumed that there are both operational and spare computers in use. They are usually running the fs1 and fs2 systems, respectively. In the instructions in this document, you should of course replace those names with the ones of your systems, if different. If there is only one system, you can omit the actions involving fs2. If you do install on fs2, metclient would normally be disabled there unless operations are moved there.
The instructions in this document only cover installation on systems
using systemd
. Use of init.d
is deprecated, but instructions for
using it can be found in the old INSTALL document at:
https://github.com/nvi-inc/metclient/blob/main/INSTALL.
The installation process uses the recoverable testing procedure of FSL11 (or FSL10) with a RAID to enable easy recovery in case of a problem. This has the advantage that if (i) actions are missing from the metclient installation procedure in this document, or (ii) errors occur, and either or both can’t be recovered from directly, it is relatively easy to return to the original state and start over. If you are using some other FSLx (before FSL10) or don’t have a RAID, you should skip using the recoverable testing procedure or substitute a different one.
2. Reverting the installation
If you are using the recoverable testing procedure and it is not possible finish the installation before the next operational use of the system or disk rotation, the systems can be reverted to their previous configuration. For each system that had the primary disk dropped, follow the failed branch of the recoverable testing procedure for FSL11 at https://nvi-inc.github.io/fsl11/raid.html#_recoverable_testing (or for FSL10 at: https://nvi-inc.github.io/fsl10/raid.html#_recoverable_testing).
It will require several hours for the refresh operation to complete. The system can be used for operations, but not a disk rotation, while the refresh is in progress. Later, the installation can be tried again from scratch when it is convenient.
3. fs1 installation
All work in this section is to be performed on the fs1 system.
3.1. Preparing fs1
If you are not using an FSL10, or later, RAID configuration, skip this step, or substitute your own test and recovery method.
-
Follow the directions for the recoverable test procedure for FSL11 at https://nvi-inc.github.io/fsl11/raid.html#_recoverable_testing (or for FSL10 at https://nvi-inc.github.io/fsl10/raid.html#_recoverable_testing.
-
Once the primary disk has been dropped from the RAID, move onto the next step, Installing metclient on fs1, below.
3.2. Installing metclient on fs1
-
Remove any previous installation of
metclient
. -
As root, download metclient:
cd /usr2 git clone https://github.com/nvi-inc/metclient chown -R prog.rtx metclient
-
As root, install metclient as a service:
cd /usr2/metclient cp -i metclient.service /etc/systemd/system/ chmod 644 /etc/systemd/system/metclient.service cp -i metclient_systemd.sh /usr/local/sbin chmod 744 /usr/local/sbin/metclient_systemd.sh
NoteIf you want to change the host name for the server (which is not recommended), update /usr/local/sbin/metclient_systemd.sh. -
As root, install the alias for the met. server.
This is normally taken care of by the installation of gromet on this machine. However, if gromet is serving met. data from a different machine, add the alias, usually
met_server
to that machine’s line in /etc/hosts.CautionNormally, fs1 and fs2 have the alias for the server on the same line in /etc/hosts whether that is the internal interface (
localhost
) or the external interface (this machine’s IP address) or the address of some other machine. They do not normally point to the other of fs1 or fs2, if it is the one running gromet.For systems with RDBEs where gromet is being use on the active systems for operations, this enables using set_telegraf (see: https://nvi-inc.github.io/set_telegraf/) to transition operations between fs1 and fs2 without making other changes.
-
As prog, make metclient:
cd /usr2/metclient make
-
As oper, install and customize /usr2/control/metlog.ctl:
-
Copy the file:
cd /usr2/metclient cp -i metlog.ctl /usr2/control
NoteThe -i
option of cp will give you a chance to abort before overwriting an existing metlog.ctl file. -
Edit /usr2/control/metlog.ctl.
Update the following items:
-
Station two-character code
-
Station Name
-
Longitude (West is positive)
-
Latitude
-
Station Elevation
-
-
-
As root, start and enable the gromet service:
systemctl start metclient systemctl enable metclient
4. Testing metclient on fs1
Check that there is a file /usr2/log/wx<YY><DDD><sc>.log (<YY> is
the last two digits of the year, <DDD> is the day of the year, and
<sc> is the two-character station code; for example,
/usr2/log/wx/wx24317k2.log for station k2
).
You should be able to list the file with tail -f …
and see one
line being added per minute with the met. values.
5. fs2 installation
Once fs1 has been successfully set-up, the fs2 system, usually running in the spare computer, can be set-up. Do not proceed with this section until metclient is working on fs1.
5.1. Preparing fs2
Follow the instructions in the Preparing fs1 step above, but this time performing them on fs2. Then proceed with the next step below Changes needed before installing metclient on fs2.
5.2. Changes needed before installing metclient on fs2
For this part of the installation it will be necessary to take some additional actions, all as root:
-
On fs1:
-
Stop and disable metclient:
systemctl stop metclient systemctl disable metclient
-
Stop and disable gromet:
Noteif you are not using gromet on this system, skip this step. systemctl stop gromet systemctl disable gromet
-
-
On fs2:
-
Start and enable gromet:
Noteif you are not using gromet on this system, skip this step. systemctl start gromet systemctl enable gromet
-
5.3. Installing metclient on fs2
Follow the directions in the Installing metclient on fs1 step above, but this time performing the actions on fs2.
Note
|
If the /usr2 partition on your fs2 system is periodically overwritten with refresh_spare_usr2, as it should be, all of the setup on fs2, except for the service, will be replaced with the setup on fs1. This is expected and should not cause a problem. |
6. Testing metclient on fs2
Follow the directions in Testing metclient on fs1, but perform the actions on fs2.
7. Finishing up
This section covers the actions to follow once metclient has been tested successfully on both fs1 and fs2. Al actions are performed as root.
Note
|
if you are not using gromet on these systems, skip those commands. |
7.1. Finalizing fs2
-
Stop and disable gromet and metclient:
systemctl stop metclient systemctl disable metclient systemctl stop gromet systemctl disable gromet
7.2. Finalizing fs1
-
Start and enable gromet and metclient:
systemctl start gromet systemctl enable gromet systemctl start metclient systemctl enable metclient
-
Reverify the results of the Testing metclient on fs1 section above.
7.3. Restoring RAIDs
If everything is still working, follow the successful branch in the recoverable test procedure, to recover the RAIDs for FSL11 at https://nvi-inc.github.io/fsl11/raid.html#_recoverable_testing (or for FSL10 at https://nvi-inc.github.io/fsl10/raid.html#_recoverable_testing):
-
Recover the RAID on fs1.
-
Recover the RAID on fs2.
Appendix A: Changing the Active System for metclient
If you have an operational (fs1) and a spare (fs2) system. You can switch which system is running the metclient service. There are three possible cases:
-
For systems with RDBEs that running telegraf, you can use set_telegraf, which is described at https://nvi-inc.github.io/set_telegraf/). Once set_telegraf has been installed, you can follow the directions at https://nvi-inc.github.io/set_telegraf/#_use_of_set_telegraf for how to use it.
-
For systems running metclient and gromet, follow the instructions below.
-
For systems only running metclient, follow the instructions below, but omit the commands for gromet.
A.1. Instructions for systems without telegraf
All commands are run by root:
Caution
|
gromet should be run on at most one system at a time. So be sure to stop it on the machine that it was running on before starting it on another. |
-
On the machine where metclient, and gromet, are running, disable and stop them:
NoteOmit the commands for gromet if it is not being used on your system. CautionIf this machine isn’t available, enter these commands once it becomes available again. systemctl disable metclient systemctl stop metclient systemctl disable gromet systemctl stop gromet
-
On the machine where you want to run metclient, and gromet, enable and start them:
NoteOmit the commands for gromet if it is not being used on your system. systemctl enable gromet systemctl start gromet systemctl enable metclient systemctl start metclient