Running on multiple machines
There is always one "host" machine where core midas services live (shared memory, data files etc). However clients may run on other machines, and talk to the host machine via the mserver program.
The midas client libraries are designed so that the same code works on both the host machine and remote machines - you do not need to recompile anything to run remotely.
Disabled by default
Remote programs are blocked by default. If a remote client tries to connect, you will get a message in the message log informing you of the hostname that tried to connect:
rejecting connection from unallowed host 'somewhere.lab.ca'
Allowing programs to run on other machines
You must perform steps on both the main host machine and the remote machine.
On the main host machine
- Set the ODB key
/Experiment/Security/Enable non-localhost RPCtoy. Programs only read this key when they start, so restart any midas programs that are already running - Edit the ODB array
/Experiment/Security/RPC hosts/Allowed hoststo include the hostnames of the remote machine and of the main host machine. The main host machine is needed because programs on the remote machine also check where their connections come from (e.g. for run transitions). You can expand the array if you need to connect from more than 10 different hosts. See RPC hosts for more details. - Start the
mserverprogram (mserver -Dis the most common invocation so it will continue running in the background)
On the remote machine
- Unset the environment variable
MIDAS_EXPTAB(if set) - Set the environment variable
MIDAS_SERVER_HOSTto<main_hostname>:1175(e.g.daq.lab.ca:1175) - Start your program
If you don't want to set an environment variable, you can instead pass the -h argument to many midas clients to directly specify the hostname to connect to, e.g. odbedit -h daq.lab.ca:1175. This is supported for all built-in midas programs and all user-written frontends, and may be supported by other user-written programs.
Changing the port number
The default port number used for mserver connections is 1175. You can change this using either the ODB key /Experiment/Midas server port or the -p argument to mserver.
If you use a different port, you must also change it in the MIDAS_SERVER_HOST environment variable on the remote machine.