Managing an EDB Postgres Advanced Server installation v14
Unless otherwise noted, the commands and paths noted in the following section assume that you have performed an installation using the native packages.
Starting and stopping services
A service is a program that runs in the background and requires no user interaction (in fact, a service provides no user interface); a service can be configured to start at boot time, or manually on demand. Services are best controlled using the platform-specific operating system service control utility. Many of the EDB Postgres Advanced Server supporting components are services.
The following table lists the names of the services that control EDB Postgres Advanced Server and services that control EDB Postgres Advanced Server supporting components:
EDB Postgres Advanced Server component name | Linux service Name | Debian service name |
---|---|---|
EDB Postgres Advanced Server | edb-as-14 | edb-as@14-main |
pgAgent | edb-pgagent-14 | edb-as14-pgagent |
PgBouncer | edb-pgbouncer-1.14 | edb-pgbouncer114 |
pgPool-II | edb-pgpool-4.1 | edb-pgpool41 |
Slony | edb-slony-replication-14 | edb-as14-slony-replication |
EFM | edb-efm-4.0 | edb-efm-4.0 |
You can use the Linux command line to control EDB Postgres Advanced Server's database server and the services of EDB Postgres Advanced Server's supporting components. The commands that control the EDB Postgres Advanced Server service on a Linux platform are host specific.
Controlling a service on RHEL/Rocky Linux/AlmaLinux 8.x
If your installation of EDB Postgres Advanced Server resides on version 8.x of RHEL, you must use the systemctl
command to control the EDB Postgres Advanced Server service and supporting components.
The systemctl
command must be in your search path and must be invoked with superuser privileges. To use the command, open a command line, and enter:
Where:
service_name
specifies the name of the service.
action
specifies the action taken by the service command. Specify:
start
to start the service.stop
to stop the service.restart
to stop and then start the service.status
to discover the current status of the service.
Controlling a service on Ubuntu 20.04
If your installation of EDB Postgres Advanced Server resides on version 20.04 of Ubuntu, assume superuser privileges and invoke the following commands (using bundled scripts) to manage the service. Use the following commands to:
Discover the current status of a service:
Stop a service:
Restart a service:
Reload a service:
Control the component services:
Using pg_ctl to control EDB Postgres Advanced Server
You can use the pg_ctl
utility to control an EDB Postgres Advanced Server service from the command line on any platform. pg_ctl
allows you to start, stop, or restart the EDB Postgres Advanced Server database server, reload the configuration parameters, or display the status of a running server. To invoke the utility, assume the identity of the cluster owner, navigate into the home directory of EDB Postgres Advanced Server, and issue the command:
data_directory
is the location of the data controlled by the EDB Postgres Advanced Server cluster.
action
specifies the action taken by the pg_ctl
utility. Specify:
start
to start the service.stop
to stop the service.restart
to stop and then start the service.reload
sends the server aSIGHUP
signal, reloading configuration parametersstatus
to discover the current status of the service.
For more information about using the pg_ctl
utility or the command-line options available, see the official PostgreSQL Core Documentation.
Choosing Between pg_ctl and the service Command
You can use the pg_ctl
utility to manage the status of an EDB Postgres Advanced Server cluster, but it is important to note that pg_ctl
does not alert the operating system service controller to changes in the status of a server, so it is beneficial to use the service
command whenever possible.
Configuring component services to autostart at system reboot
After installing, configuring, and starting the services of EDB Postgres Advanced Server supporting components on a Linux system, you must manually configure your system to autostart the service when your system reboots. To configure a service to autostart on a Linux system, open a command line, assume superuser privileges, and enter the following command.
On a Redhat-compatible Linux system, enter:
Where service_name
specifies the name of the service.
Connecting to EDB Postgres Advanced Server with edb-psql
edb-psql
is a command line client application that allows you to execute SQL commands and view the results. To open the edb-psql
client, the client must be in your search path. The executable resides in the bin
directory, under your EDB Postgres Advanced Server installation.
Use the following command and options to start the edb-psql
client:
Where:
-d
specifies the database to which edb-psql
connects.
-U
specifies the identity of the database user to use for the session.
edb-psql
is a symbolic link to a binary called psql
, a modified version of the PostgreSQL community psql
, with added support for Advanced Server features. For more information about using the command line client, see the PostgreSQL Core Documentation.
Managing authentication on a Debian or Ubuntu host
By default, the server is running with the peer or md5 permission on a Debian or Ubuntu host. You can change the authentication method by modifying the pg_hba.conf
file, located under /etc/edb-as/14/main/
.
For more information about modifying the pg_hba.conf
file, see the PostgreSQL core documentation.
Configuring a package installation
The packages that install the database server component create a unit file (on version 7.x or 8.x hosts) and service startup scripts.
Creating a database cluster and starting the service
The PostgreSQL initdb
command creates a database cluster; when installing EDB Postgres Advanced Server with an RPM package, the initdb
executable is in /usr/edb/asx.x/bin
. After installing EDB Postgres Advanced Server, you must manually configure the service and invoke initdb
to create your cluster. When invoking initdb
, you can:
- Specify environment options on the command line.
- Include the
systemd
service manager on RHEL/Rocky Linux/AlmaLinux 8.x and use a service configuration file to configure the environment.
For more information, see the initdb documentation.
After specifying any options in the service configuration file, you can create the database cluster and start the service; these steps are platform specific.
On RHEL/Rocky Linux/AlmaLinux 8.x
To invoke initdb
on a Rocky Linux/AlmaLinux 8.x system, with the options specified in the service configuration file, assume the identity of the operating system superuser:
To initialize a cluster with the non-default values, you can use the PGSETUP_INITDB_OPTIONS
environment variable by invoking the edb-as-14-setup
cluster initialization script that resides under EPAS_Home/bin
.
To invoke initdb
export the PGSETUP_INITDB_OPTIONS
environment variable with the following command:
After creating the cluster, use systemctl
to start, stop, or restart the service: