Skip to main content
Version Next

Database Service Installation

PostgreSYS, via PgSmart, provides a streamlined and customizable approach to installing PostgreSQL and the PostGIS extension for georeferencing.

In addition to offering all necessary installation packages in one place, PgSmart allows a single guided operation to install PostgreSQL binaries, initialize a database instance or cluster, and create the corresponding system service.

Prerequisites
Command Syntax
Terminal input
   pgsmart install -s db [Flags]
Terminal input
    pgsmart install --service=db [Flags]

Flags:

  • -M, --pg-version=11–17 => Defines the PostgreSQL major version to install. The latest available release will be used.
  • -a, --agent=<agent> => Defines the alias, hostname, or IP address where a PgSmart Agent is installed.
  • -h, --help => Shows help.
  • -q, --quiet => Non-interactive execution for service installation. Used with --service, --pg-version, and --agent.
  • -s, --service=db => PostgreSYS Platform Database Service.
  • --geo-component => Installs the Georeferencing component (PostGIS), used with the --quiet option.
Non-Interactive Installation

This installation mode is activated by the quiet option (--quiet, -q) and uses default values for parameters not provided. However, this option is disabled during the first installation due to the need to create the PostgreSYS package repository based on information requested interactively.

Database Management System Installation

Terminal input
    pgsmart install -a <agent> -q --service=db --pg-version=(11|12|13|14|15|16)
Figure 1 - Database Installation - Non-Interactive
Figure 1 - Database Installation - Non-Interactive

Geo-Component Extension Installation

Terminal input
    pgsmart install -a <agent> -q --geo-component -M 15
Figure 2 - Extension Installation - Non-Interactive
Figure 2 - Extension Installation - Non-Interactive
Interactive Installation
Terminal input
    pgsmart install

Database Service Installation

  1. Select the PgSmart Agent (or Register a new Agent).

    1.1 Select Banco de Dados.

    1.2 Select Sistema de Gerenciamento de Banco de Dados.

    1.3 Select the PostgreSQL Major Version.

    1.4 Select the Release of the selected major version.

    1.5 Confirm whether to update the PostgreSYS package repository.

    1.5.1 If yes, select Provide and enter:

    • Repository URL

    • Identification code

    • Repository name

    • Repository user (optional)

    • Repository password (optional)

    • Confirm whether to enable GPG key verification

      • If yes, provide the path to the GPG key file

        note
        • For a local installation, don't forget to download and import the public GPG key of the repositories (RPM-GPG-KEY-PGSYS).

          For example, for RHEL 8 distributions, access:

          File path
              https://repo.tecnisys.com.br/repository/yum/pgsys/repos/4.0.0/rhel-8-x86_64/RPM-GPG-KEY-PGSYS
        • The compressed tar.gz installation packages already include the GPG public key.

    1.6 Database Instance Initialization

    • After completing the component installation, the next step is to initialize a database instance. This is crucial to prepare the database for use by configuring and starting the necessary services.

    • Confirm whether to initialize a database instance now.

    • If confirmed, the system will proceed with the Instance Initialization process.

      Figure 3 - Interactive Database Installation
      Figure 3 - Interactive Database Installation

Database Extension Installation

  1. Select the Extensões de Banco de Dados and the component to be installed.

    2.1 Confirm extension installation.

    2.2 Confirm whether to install/update the PostgreSYS package repository (required if not yet configured).

    2.3 If yes, provide the repository URL.

    note

    The package repository installation will not be executed if the pgsys-utils repositories are already present or mapped on the machine.

    Figure 4 - Interactive Extension Installation
    Figure 4 - Interactive Extension Installation

Command Variations for Interactive Installation

Some parameters may be passed in advance through the command, but without the quiet option (--quiet, -q), execution remains interactive, and these parameters will be used as default values in the prompts.

Examples:

Terminal input
    pgsmart install --service=db
Terminal input
    pgsmart install --pg-version=15
Final Notes

Remember to check the installation logs for any warnings or errors during the process. These log files may provide valuable information in case of problems or for fine-tuning configurations.

Terminal input
    tail -f /var/log/pgsmart-agent/pgsmart.log
Terminal input
    tail -f /var/log/pgsmart-client/pgsmart.log
note

PgSmart defines environment variables (PGDATA, PGBIN, among others) in the current user's bash_profile, which will be loaded in new sessions. Run the following command to apply them immediately:

Terminal input
    source ~/.bash_profile