Mserver: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Pagelinks}}
= Purpose =
The MIDAS remote server (<span style="color:darkcyan;">''mserver''</span>) provides [[Remote Access to a Midas experiment|remote access]] to any MIDAS client. Changes to {{Utility|name=mserver}}  (August 2015) make the '''default behaviour to reject all external network connections''' ([https://midas.triumf.ca/elog/Midas/1090 Note 1090]), so that only programs running on the localhost will be allowed.
{{Utility|name=mserver}} is needed when one or more of an experiment's MIDAS clients are running on a different host. In this case,
<ol>
<li> a <span style="color:darkcyan;">''mserver''</span> client must be started on the host where the experiment resides </li>
<li> the user must take action to allow programs on remote machines to run on the host machine by following these instructions: [[Security#MIDAS programs on remote machines|MIDAS programs on remote machines]]. Without this action, only programs running on the local host will be allowed. </li>
</ol>


The MIDAS remote server (<span style="color:darkcyan;">''mserver''</span>) provides remote access to any MIDAS client.  
The <span style="color:darkcyan;">''mserver''</span> utility  usually runs in the background. In the case where debugging is required, {{Utility|name=mserver}} can be started with the -d flag which will write an entry for each transaction to a log file  {{Filepath|path=/tmp/mserver.log}}. The log entry contains the time stamp and RPC call request.


It is needed when one or more of an experiment's MIDAS clients are running on a different host. In this case, a <span style="color:darkcyan;">''mserver''</span> client must be started on the host where the experiment resides (see [[#example|example]]).
More than one copy of <span style="color:darkcyan;">''mserver''</span> can be started on a system, provided they use different tcp ports. This is useful if, for example, [[exptab|different experiments]] are in use on a single host at the same time.


= Arguments =
        [-e ] : experiment to connect to (see [[Common Parameters to MIDAS Utilities#Midas experiment (exptname)|MIDAS experiment]])
        [-h ] : help
        [-m ] : Multi process server (default)
        [-p ] : Port; listen for connections on specified tcp port. If -p argument is not specified, default port is used (see [[#Usage]]).
        [-d ] : Write debug info to <span style="color:green; font-weight:normal; font-style:italic ">/tmp/mserver.log</span>
        [-D ] : Become a Daemon


The <span style="color:darkcyan;">''mserver''</span> utility  usually runs in the background and doesn't need to be modified. In the case where debugging is required, the mserver can be started with the -d flag which will write an entry for each transaction to a log file /tmp/mserver.log . The log entry contains the time stamp and RPC call request.
= Usage =
<ol>
<li>Start  {{Utility|name=mserver}} on the default port as a Daemon. Port number is stored in ODB key <span style="color: purple; font-style:italic;">/Experiment/midas server port</span>. Default port is 1175.
<pre>  > mserver -D</pre> 
</li>


More than one copy of <span style="color:darkcyan;">''mserver''</span> can be started on a system, provided they use different tcp ports. This is useful if, for example, [[exptab|different experiments]] are in use on a single host at the same time. To start a version of <span style="color:darkcyan;">''mserver''</span> on a different port, use the -p argument, e.g.
<li>Start {{Utility|name=mserver}} on port 1176. This will not change the default port. To change the default port, edit the ODB key <span style="color: purple; font-style:italic;">/Experiment/midas server port</span>.
<pre> > mserver -p 1176 </pre>   
</li></ol>


mserver -p XXXX -D
;IMPORTANT NOTE
mserver -p 7071 -D -a localhost -a node01 -a node02 -a node03
: Starting an [[mserver]] client is not sufficient to obtain remote access to an experiment (see [[#Purpose|above]]). To allow access to localhost from remote machines follow these [[Security#MIDAS programs on remote machines|instructions]].  This security change replaces the [-a] option in older versions (see below).


To connect a client to this version of mserver, use the format "hostname:port", e.g.
<br>
----------
<br>


# frontend started from client node
= Old version of mserver (pre-August 2015) =
fe_test -h node01:7071 -e test
The MIDAS remote server (<span style="color:darkcyan;">''mserver''</span>) provides [[Remote Access to a Midas experiment|remote access]] to any MIDAS client.  
#
#
# frontend started from the backend node00
ssh -n node01 /home/expt/online/fe_test.exe -h node00:7071 -e test -i 0 -D


== Starting mserver ==
It is needed when one or more of an experiment's MIDAS clients are running on a different host. In this case, a <span style="color:darkcyan;">''mserver''</span> client must be started on the host where the experiment resides. To start a version of <span style="color:darkcyan;">''mserver''</span> on a different port, use the -p argument (see [[#Usage (old version)|usage]]). To restrict access to the remote host to certain nodes, use the -a argument as shown below.


    Arguments
==  Arguments (old version) ==
         [-h ] : help
         [-h ] : help
         [-s ] : Single process server
         [-s ] : Single process server
         [-t ] : Multi thread server
         [-t ] : Multi thread server
         [-m ] : Multi process server (default)
         [-m ] : Multi process server (default)
         [-p ] : Port number; listen for connections on non-default tcp port
         [-p ] : Port number; listen for connections on specified tcp port.
        [-a ] : Hostname: only allow access for a specified host. Multiple -a arguments can be used (see [[#Usage (old version)|Usage]]).
         [-d ] : Write debug info to /tmp/mserver.log
         [-d ] : Write debug info to /tmp/mserver.log
         [-D ] : Become a Daemon
         [-D ] : Become a Daemon
    Usage
      >mserver -D


== Example ==
== Usage (old version) ==
If an mserver client is '''not''' running on host dasdevpc2, then an attempt to run a client on dasdevpc2 from a remote computer (isdaq01) will result in an error message:
>mserver -D
 
>mserver -p 7072 -D
>mserver -p 7071 -D -a localhost -a node01 -a node02 -a node03


:[bnmr@isdaq01 ~/online]$ odb -e t2kgas -h dasdevpc2
:Cannot connect to remote host
If a mserver client is now started on host dasdevpc2,


:[suz@dasdevpc2 ~]$ mserver -D
To connect a client to this version of mserver, use the format "hostname:port", e.g.
:mserver started interactively
:Becoming a daemon...


Now one can connect to the remote experiment :
# frontend started from client node
fe_test -h node01:7071 -e test
 
# frontend started from the backend node00
ssh -n node01 /home/expt/online/fe_test.exe -h node00:7071 -e test -i 0 -D


:[bnmr@isdaq01 ~/online]$ odb -e t2kgas -h dasdevpc2
[[Category:Remote Access Server]] [[Category:Utilities]] [[Category:Experiment]]
:[dasdevpc2:t2kgas:S]/>quit

Latest revision as of 16:15, 12 November 2015


Purpose

The MIDAS remote server (mserver) provides remote access to any MIDAS client. Changes to mserver (August 2015) make the default behaviour to reject all external network connections (Note 1090), so that only programs running on the localhost will be allowed.

mserver is needed when one or more of an experiment's MIDAS clients are running on a different host. In this case,

  1. a mserver client must be started on the host where the experiment resides
  2. the user must take action to allow programs on remote machines to run on the host machine by following these instructions: MIDAS programs on remote machines. Without this action, only programs running on the local host will be allowed.

The mserver utility usually runs in the background. In the case where debugging is required, mserver can be started with the -d flag which will write an entry for each transaction to a log file /tmp/mserver.log. The log entry contains the time stamp and RPC call request.

More than one copy of mserver can be started on a system, provided they use different tcp ports. This is useful if, for example, different experiments are in use on a single host at the same time.

Arguments

       [-e ] : experiment to connect to (see MIDAS experiment)
       [-h ] : help
       [-m ] : Multi process server (default)
       [-p ] : Port; listen for connections on specified tcp port. If -p argument is not specified, default port is used (see #Usage).
       [-d ] : Write debug info to /tmp/mserver.log
       [-D ] : Become a Daemon

Usage

  1. Start mserver on the default port as a Daemon. Port number is stored in ODB key /Experiment/midas server port. Default port is 1175.
      > mserver -D
  2. Start mserver on port 1176. This will not change the default port. To change the default port, edit the ODB key /Experiment/midas server port.
     > mserver -p 1176 
IMPORTANT NOTE
Starting an mserver client is not sufficient to obtain remote access to an experiment (see above). To allow access to localhost from remote machines follow these instructions. This security change replaces the [-a] option in older versions (see below).




Old version of mserver (pre-August 2015)

The MIDAS remote server (mserver) provides remote access to any MIDAS client.

It is needed when one or more of an experiment's MIDAS clients are running on a different host. In this case, a mserver client must be started on the host where the experiment resides. To start a version of mserver on a different port, use the -p argument (see usage). To restrict access to the remote host to certain nodes, use the -a argument as shown below.

Arguments (old version)

       [-h ] : help
       [-s ] : Single process server
       [-t ] : Multi thread server
       [-m ] : Multi process server (default)
       [-p ] : Port number; listen for connections on specified tcp port.
       [-a ] : Hostname: only allow access for a specified host. Multiple -a arguments can be used (see Usage).
       [-d ] : Write debug info to /tmp/mserver.log
       [-D ] : Become a Daemon

Usage (old version)

>mserver -D
>mserver -p 7072 -D
>mserver -p 7071 -D -a localhost -a node01 -a node02 -a node03


To connect a client to this version of mserver, use the format "hostname:port", e.g.

# frontend started from client node
fe_test -h node01:7071 -e test
 
# frontend started from the backend node00 
ssh -n node01 /home/expt/online/fe_test.exe -h node00:7071 -e test -i 0 -D