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 :

1
2
3
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

1
crm configure show

listing managed resources and their status

1
crm resource show

migrate a resource to another node

1
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

1
crm help

ps - System

ps

Debug tool to check running process

1
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

1
sudo supervisorctl status

restarting a given service

1
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)

1
sudo supervisorctl stop all

Systemd - System

Systemd

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

1
systemctl

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

listing processes and their state

1
    sudo systemctl status

restart a given service :

1
sudo systemctl <serviceName>.service status

stoppping a given service :

1
    sudo systemctl <serviceName>.service stop

Telnet - Network

Telnet

Debug tool to etablished a TCP connection

1
telnet <host> <port>