Working on Remote Systems - secondo-database/secondo GitHub Wiki
This page contains tips for the execution of long-running queries in SECONDO on a remote system. Executing queries on a large data set in SECONDO can take some time. Usually, the secure shell (SSH) is used to connect to a remote system. Keeping an SSH connection open for a long time can be challenging. The following tips can be used to keep a connection open or prevent the termination of SECONDO when the SSH connection is terminated.
Enabling the 'ServerAliveInterval' in the SSH Client
IP Gateways (such as firewalls) can terminate idle TCP connections after some time. To prevent a TCP connection from becoming idle, the SSH can send some keep-alive packages in the background on the TCP connection automatically. To enable the feature, add the following lines to your SSH client configuration (e.g., /etc/ssh/ssh_config or ~/.ssh/ssh_config):
Host *
ServerAliveInterval 60
The setting will send a keep-alive packet every 60 seconds. If the connection is terminated earlier, please reduce the setting to a lower value (e.g., 15). Please note this is a setting for the SSH client ssh_config not for the SSH server sshd_config.
Using screen to Execute SECONDO
screen is a terminal multiplexer for Linux. It allows the execution of multiple terminal sessions within one window or SSH connection. Besides, the screen session (an all from the session started programs) is not terminated when the SSH connection is lost. Another SSH session can be used to re-attach to the previously opened session. screen can be used to start SECONDO and to re-attach to the same SECONDO session when the connection was lost. A complete overview of the functionality of screen can be found here.
Example:
# Connect to the remote system
$ ssh [email protected]
# Start a new screen session and run SECONDO
$ screen
$ cd ~/secondo/bin
$ ./SecondoTTYBDB
# You can now detach from the SECONDO session by pressing CTRL-a and d
# (press CTRL-a first, then press d)
# Re-attach to the previously opened screen session
# This can also be done from another SSH session if the connection was lost
$ screen -x