Skip to content

Tools and Tips

This chapter lists various useful commands and tips to analyse or debug deployment issues.

Netstat - Network

netstat

Debug tool to check port open in a device

listing all TCP opening ports :

sudo netstat -tnlp
# or, depending on your setup :
sudo ss -tnlp

Pacemaker/corosync - System for managing clustered resources (like Virtual IPs)

crm_mon

This tool shows : all corosync cluster nodes, and their status (online/offline) all managed pacemaker resources (Virtual IPS), and the node they run on

crm

This is the tool used to configure/manage resources in pacemaker cluster. It can be run on any node of the cluster, and will configure the whole cluster.

listing configuration

crm configure show

listing managed resources and their status

crm resource show

migrate a resource to another node

crm resource migrate adm2t

note that this migration will respect colocalisation constraints configured in crm (i.e. associated services will follow their VIP if the VIP is migrated)

help

crm help

ps - System

ps

Debug tool to check running process

ps -faux

Supervisor - System

Supervisord

This is a service managed by init daemon. Supervisord configuration is read from /etc/supervisord.conf and all files in /etc/supervisor/conf.d directory (one by supervised process)

supervisorctl

This is the control tool to monitor/start/stop processes managed by Supervisord

listing processes and their state

sudo supervisorctl status

restarting a given service

sudo supervisorctl restart <serviceName>

stopping all monitored processes
while leaving supervisord alive (useful to stop service, while preventing pacemaker from switching services to the other node in an active/passive cluster)

sudo supervisorctl stop all

Systemd - System

Systemd

This is a service. For Ubuntu 15 init daemon is depreciated in favor of system daemon.

systemctl

This is the control tool to monitor/start/storm processes managed by Systemd

listing processes and their state

    sudo systemctl status

restart a given service :

sudo systemctl <serviceName>.service status

stopping a given service :

    sudo systemctl <serviceName>.service stop

Telnet - Network

Telnet

Debug tool to established a TCP connection

telnet <host> <port>