Starting and Stopping on Linux

DBmarlin Sensors

Database Sensors can be started and stopped via the Instance settings screen. If you see the green shield icon next to the Database target then the sensors is running. If the status icon is red with a question mark then you can mouseover the icon to see the reason it failed to start. The most likely reasons are connectivity issues due to incorrect connection details being entered or lack of connectivity between the DBmarlin server and the taget database instance.

Host Sensors can be started and stopped via the Host settings screen. If you see the green shield icon next to the Database target then the sensors is running. If the status icon is red with a question mark then you can mouseover the icon to see the reason it failed to start. The most likely reasons are connectivity issues due to incorrect connection details being entered or lack of connectivity between the DBmarlin server and the taget host.

DBmarlin Server Processes

The DBmarlin server is made up of 3 processes: Nginx, Tomcat and PostgreSQL. See the architecture page for more deails. All 3 proceses can be started via a single command start.sh and stopped via stop.sh. You can, if needed, start and stop individual processes using the -n , -t and -p parameters for Nginx, Tomcat and PostgreSQL respectively.

info

The start.sh, stop.sh and status.sh scripts must be run as a dbmarlin user account or other non-root user account with access to the DBmarlin install directory.

start.sh

Start the 3 DBmarlin server processes.

./start.sh
# Or to start the processes individually
./start.sh -n
./start.sh -t
./start.sh -p

stop.sh

Stop the 3 DBmarlin server processes.

./stop.sh
# Or to stop the processes individually
./stop.sh -n
./stop.sh -t
./stop.sh -p

status.sh

Check the status of the 3 DBmarlin server processes.

./status.sh
nginx (Running)
tomcat (Running)
postgres (Running)

systemd startup for Linux

Systemd is a modern SysV-style init and rc replacement for Linux systems which makes use of many modern Linux kernel features. It provides a system and service manager that runs as PID 1 and starts the rest of the system. Systemd is what is responsible for controlling how services are started, stopped, restarted and otherwise managed on modern Linux distributions.

info

The standard Systemd Service unit files that come with the Linux system or installed by third party applications usually run as root or system user account.

Installing systemd unit files for DBmarlin

  1. Login as the root user.

  2. DBmarlin comes with 3 Systemd Service unit files for each of the 3 processes and can be found in the scripts/systemd directory wherever you installed DBmarlin.

    cd scripts/systemd
    ls -l
    -rw-rw-r-- 1 dbmarlin dbmarlin 796 Dec 2 01:07 dbmarlin-nginx.service
    -rw-r--r-- 1 dbmarlin dbmarlin 437 Dec 2 01:07 dbmarlin-postgresql.service
    -rw-r--r-- 1 dbmarlin dbmarlin 511 Dec 2 01:07 dbmarlin-tomcat.service
  3. Important. You will first need to edit the file so that they contain the correct path where you have installed DBmarlin. The unit files assume the installation directory to be /opt/dbmarlin but if that is not the case you should replace all references to /opt/dbmarlin with the correct location.

  4. Copy the 3 service unit files to /etc/systemd/system and then run systemctl daemon-reload

    cd scripts/systemd
    cp dbmarlin*.service /etc/systemd/system
    systemctl daemon-reload
  5. systemctl list-unit-files | grep dbmarlin - you should see them listed but disabled which means they won't automatically start on a machine reboot but can be started and stopped manually via systemctl

    systemctl list-unit-files | grep dbmarlin
    dbmarlin-nginx.service disabled
    dbmarlin-postgresql.service disabled
    dbmarlin-tomcat.service disabled
  6. systemctl start - to start the services

    systemctl start dbmarlin-nginx
    systemctl start dbmarlin-tomcat
    systemctl start dbmarlin-postgresql
  7. systemctl status - to get the current status of the services

    systemctl status dbmarlin-nginx
    systemctl status dbmarlin-tomcat
    systemctl status dbmarlin-postgresql
  8. systemctl stop - to stop the services

    systemctl stop dbmarlin-nginx
    systemctl stop dbmarlin-tomcat
    systemctl stop dbmarlin-postgresql
  9. systemctl enable dbmarlin-nginx - to make the service automatically restart on reboot

    systemctl enable dbmarlin-nginx
    systemctl enable dbmarlin-tomcat
    systemctl enable dbmarlin-postgresql

For more on systemd see https://www.redhat.com/sysadmin/getting-started-systemctl