Skip to main content
Version 3.1.1

Control of the Instance Service

PgSmart allows you to manage your database cluster, enabling you to view the service status, start, stop, restart and reload instance configurations.

Command Syntax
Terminal input
pgsmart cluster [OPERATIONS] [Flags]

OPERATIONS :

  • Check the cluster status.
  • Initialize the service on the cluster.
  • Stop the service on the cluster.
  • Restart the service on the cluster.
  • Reload the configuration parameters of the instance.

Flags:

  • -D, --pgdata=<path> => Data directory of the PostgreSQL instance.
  • -M, --pgversion=(11|12|13|14|15) => Major version of PostgreSQL.
  • -a, --agent=<agent> => Alias, hostname or IP of the server where a PgAgent is installed.
  • -h, --help => Help.
  • -q, --quiet => Non-interactive execution for control of your component (status|start|stop|restart|reload).
note
  • The binary and data directories are automatically identified by PgSmart, which will present them for selection when there is more than one registered.

  • The -D and -M options can be used to directly identify the data directory of the instance and the major version of PostgreSQL.

  • With this information, it is possible to find the configuration file, extract the port, and find the operating system service that relates to it.

Non-interactive Execution
Terminal input
  pgsmart cluster status|start|stop|restart|reload -q -a 192.168.56.232 -D /var/lib/pgsql/15/data
Interactive Execution

Check the cluster status

Terminal input
  pgsmart cluster status
Terminal input
  pgsmart cluster status -a <server-id> --pgdata=<PGDATA>
  1. Select the PgSmart agent or Register a new Agent.

  2. Select the data directory of the PostgreSQL instance (PGDATA).

    Figure 1 - Cluster Status
    Figure 1 - Cluster Status
    note

    To add a data directory not created by PgSmart, select Add.

Stop the service on the cluster

Terminal input
  pgsmart cluster stop
  1. Select the PgSmart agent or Register a new Agent.

  2. Select the data directory of the PostgreSQL instance (PGDATA).

    Figure 2 - Cluster Stop
    Figure 2 - Cluster Stop
    :::note

    note

    It is possible to add a data directory not created by PgSmart. For this, select the option "Add".

Initialize the service on the cluster

Terminal input
  pgsmart cluster start
  1. Select the PgSmart agent or Register a new Agent.

  2. Select the data directory of the PostgreSQL instance (PGDATA).

    Figure 3 - Cluster Start
    Figure 3 - Cluster Start
    note

    It is possible to add a data directory not created by PgSmart. For this, select the option Add.

Restart the service on the cluster

Terminal input
  pgsmart cluster restart
  1. Select the PgSmart agent or Register a new Agent.

  2. Select the data directory of the PostgreSQL instance (PGDATA).

Figure 4 - Cluster Restart
Figure 4 - Cluster Restart
note

It is possible to add a data directory not created by PgSmart. For this, select the option "Add".

Reload the configuration parameters of the instance

Terminal input
pgsmart cluster reload
  1. Select the PgSmart agent or Register a new Agent.
  2. Select the data directory of the PostgreSQL instance (PGDATA).
Figure 5 -  Cluster Reload
Figure 5 - Cluster Reload