Skip to main content
Version 4.0.0

Instance Service Control

PgSmart allows managing the database instance, enabling viewing of service status, starting, stopping, restarting, and reloading instance configuration parameters.

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

Operations:

  • Status — Allows checking the current status of the instance service
  • Start — Allows starting the database instance service
  • Stop — Allows stopping the database instance service
  • Restart — Allows restarting the database instance service
  • Reload — Allows reloading the configuration parameters of the instance

Flags:

  • -D, --pgdata=<value> => PostgreSQL instance data directory.
  • -M, --pgversion=(11|12|13|14|15) => PostgreSQL major version.
  • -a, --agent=<agent> => Alias, hostname, or IP of the server where the PgSmart Agent is installed.
  • -h, --help => Help.
  • -q, --quiet => Non-interactive execution to control your component (status|start|stop|restart|reload).
note
  • Binary and data directories are automatically detected by PgSmart and will be presented for selection if more than one is registered.
  • Options -D and -M can be used to directly specify the data directory and PostgreSQL version.
  • With this information, PgSmart locates the configuration file, extracts the port, and finds the corresponding operating system service.
Non-Interactive Execution
Terminal input
    pgsmart db status|start|stop|restart|reload -q -a 192.168.56.232 -D /var/lib/pgsql/15/data
Interactive Execution

Check the status of the database instance

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

  2. Select the PostgreSQL instance Data Directory (PGDATA).

    Figure 1 - Database instance service status
    Figure 1 - Database instance service status
    note

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

Stop the database instance service

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

  2. Select the PostgreSQL instance Data Directory (PGDATA).

    Figure 2 - Stopping the database instance service
    Figure 2 - Stopping the database instance service
    note

    You can add a data directory not created by PgSmart. To do this, select the Add option.

Start the database instance service

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

  2. Select the PostgreSQL instance Data Directory (PGDATA).

    Figure 3 - Starting the database instance service
    Figure 3 - Starting the database instance service
    note

    You can add a data directory not created by PgSmart. To do this, select the Add option.

Restart the database instance service

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

  2. Select the PostgreSQL instance Data Directory (PGDATA).

    Figure 4 - Restarting the database instance service
    Figure 4 - Restarting the database instance service
    note

    You can add a data directory not created by PgSmart. To do this, select the Add option.

Reload the configuration parameters of the database instance

Terminal input
    pgsmart db reload
  1. Select the PgSmart Agent or Register a new Agent.

  2. Select the PostgreSQL instance Data Directory (PGDATA).

    Figure 5 - Reloading the database instance service
    Figure 5 - Reloading the database instance service