### Install PgSmart for High Availability Source: https://docs.tecnisys.com.br/pgsys/docs/instalacao-ha Use this command to initiate the interactive installation of PgSmart for a High Availability setup. Parameters can be passed, but the execution remains interactive without the quiet option. ```bash pgsmart install --service=ha ``` -------------------------------- ### Interactive PostgreSQL Installation with Version Source: https://docs.tecnisys.com.br/pgsys/docs/inicializa-instancia-db Initiates an interactive PostgreSQL installation, specifying the major version (e.g., 15). The process remains interactive, requiring confirmation of default or provided parameters. ```bash pgsmart db init --pgversion 15 ``` -------------------------------- ### Start PostgreSYS Environment with Docker Compose Source: https://docs.tecnisys.com.br/pgsys/docs/execucao-via-docker-cli-web Initiates the PostgreSYS environment by starting all defined services in detached mode. Ensure Docker Compose version 2.30+ is installed. ```bash docker-compose up -d ``` -------------------------------- ### Start Proxy Service Source: https://docs.tecnisys.com.br/pgsys/docs/ha-adm-proxy Initiates the high availability proxy service. Ensure the PgSmart Agent is selected or registered. ```bash pgsmart ha proxy start ``` -------------------------------- ### PgSmart Interactive DB Initialization Source: https://docs.tecnisys.com.br/pgsys/docs/inicializa-instancia-db Initiates the interactive setup process for a new PostgreSQL instance. Follow the prompts to configure essential parameters such as agent selection, PostgreSQL version, data and log directories, character encoding, locale, port, and network interfaces. ```bash pgsmart db init ``` -------------------------------- ### Start PostgreSYS Environment with Docker Compose Source: https://docs.tecnisys.com.br/pgsys/docs_comuns/execucao-via-docker Execute this command in the directory containing your compose.yml file to start the PostgreSYS environment. Ensure Docker Compose version 2.30 or higher is installed and environment variables are set. ```bash docker-compose up -d ``` -------------------------------- ### Template-Based Database Instance Initialization Source: https://docs.tecnisys.com.br/pgsys/docs/inicializa-instancia-db Initializes a database instance using a pre-saved JSON template. This allows for faster setup by reusing configuration from previous initializations stored in the PgSmart templates directory. ```bash pgsmart db init -t ``` -------------------------------- ### Run PgSmart Configuration Command Source: https://docs.tecnisys.com.br/pgsys/docs/pgsmart-agente-config This command initiates the PgSmart CLI configuration interface. Ensure PgSmart-Client and PgSmart-Agent are installed. ```bash pgsmart config ``` -------------------------------- ### Interactive Node Exporter Configuration Source: https://docs.tecnisys.com.br/pgsys/docs/config-exporter-node Execute this command to start the interactive configuration for the Node Exporter. Follow the prompts to set up the exporter. ```bash pgsmart obs exporter config ``` -------------------------------- ### Instalar Agente PgSmart com APT Source: https://docs.tecnisys.com.br/pgsys/docs_comuns/instalacao-agente-pgsmart Instala o pacote do Agente PgSmart em sistemas Debian/Ubuntu usando os comandos apt-get update e apt-get install. ```bash sudo apt-get update sudo apt-get install pgsmart-agent-4.1-amd64.deb ``` -------------------------------- ### Instalação Interativa do Serviço de Backup (Com Versão PostgreSQL) Source: https://docs.tecnisys.com.br/pgsys/docs/instalacao-backup Inicia a instalação interativa do serviço de backup, especificando a versão majoritária do PostgreSQL. A instalação ainda será interativa, mas com a versão pré-selecionada. ```bash pgsmart install --pgversion=15 ``` -------------------------------- ### Enable and start TSA service Source: https://docs.tecnisys.com.br/pgsys/docs_comuns/suporte Activates and starts the Tecnisys Support Agent service after installation. ```bash systemctl enable --now tecnisys-support-agent.service ``` -------------------------------- ### Monitor PgSmart Client Installation Log Source: https://docs.tecnisys.com.br/pgsys/docs/instalacao-ha Track the installation progress of the PgSmart client by monitoring its log file. This command is essential for observing the client-side setup during HA installation. ```bash tail -f /var/log/pgsmart-client/pgsmart.log ``` -------------------------------- ### Monitor PgSmart Agent Installation Log Source: https://docs.tecnisys.com.br/pgsys/docs/instalacao-ha Follow the installation progress of the PgSmart agent by tailing its log file. This is useful for real-time monitoring and troubleshooting during the HA setup. ```bash tail -f /var/log/pgsmart-agent/pgsmart.log ``` -------------------------------- ### Instalação Interativa do Serviço de Backup (Com Parâmetros) Source: https://docs.tecnisys.com.br/pgsys/docs/instalacao-backup Inicia a instalação interativa do serviço de backup, fornecendo o parâmetro de serviço. A instalação ainda será interativa, mas com o serviço pré-selecionado. ```bash pgsmart install --service=backup ``` -------------------------------- ### Instalação Interativa do Serviço de Backup (Comando Base) Source: https://docs.tecnisys.com.br/pgsys/docs/instalacao-backup Inicia o processo de instalação interativa do serviço de backup. O sistema solicitará as informações necessárias durante a execução. ```bash pgsmart install ``` -------------------------------- ### Instalar Firewalld em OpenSUSE Source: https://docs.tecnisys.com.br/pgsys/docs_comuns/configuracao-firewall Instala o pacote firewalld em distribuições OpenSUSE usando o gerenciador de pacotes zypper. ```bash sudo zypper install firewalld ``` -------------------------------- ### Interactive Pool Configuration Source: https://docs.tecnisys.com.br/pgsys/docs/config-pool-parametros-usu Initiates the interactive configuration process for PgSmart pools. This command is used to start the non-interactive setup. ```bash pgsmart pool config ``` -------------------------------- ### Instalar PgSmart Web via CLI Source: https://docs.tecnisys.com.br/pgsys/docs_comuns/instalacao-via-pacotes Utilize o PgSmart CLI para iniciar a instalação do PgSmart Web. ```bash pgsmart install ``` -------------------------------- ### Instalar IPTables em OpenSUSE Source: https://docs.tecnisys.com.br/pgsys/docs_comuns/configuracao-firewall Instala o pacote iptables em distribuições OpenSUSE. ```bash sudo zypper install iptables ``` -------------------------------- ### HA Agent Configuration Command Source: https://docs.tecnisys.com.br/pgsys/docs/ha-agente-config This is the base command for configuring the High Availability Agent. Interactive prompts will guide you through the setup process. ```bash pgsmart ha agent config [Flags] ``` -------------------------------- ### Get Agent Connection Key Source: https://docs.tecnisys.com.br/pgsys/docs/pgsmart-agente-reg-web Use this command on the server where the agent is installed to retrieve the connection key. This key is required for registering the agent via PgSmart Web. ```bash cat /opt/pgsmart-agent/pgsmart.yml | grep connectionKey ``` -------------------------------- ### Instalação Não-Interativa do Serviço de Backup Source: https://docs.tecnisys.com.br/pgsys/docs/instalacao-backup Instala o serviço de backup em modo não interativo, especificando o agente e a opção 'quiet'. Requer que o agente já esteja configurado. ```bash pgsmart install -a -q --service=backup ``` -------------------------------- ### Instalar o serviço de Backup (Sintaxe Curta) Source: https://docs.tecnisys.com.br/pgsys/docs/instalacao-backup Comando para instalar o serviço de backup usando a sintaxe curta para o flag de serviço. ```bash pgsmart install -s backup [Flags] ``` -------------------------------- ### Install PgSmart HA with Agent Component Source: https://docs.tecnisys.com.br/pgsys/docs/instalacao-ha This command installs PgSmart for High Availability, specifically including the agent component. The installation process will still be interactive unless the quiet option is used. ```bash pgsmart install --ha-components=agent ``` -------------------------------- ### Instalar Serviço de Administração (Forma Curta) Source: https://docs.tecnisys.com.br/pgsys/docs/instalacao-pgsmart-metadados-web Comando para instalar o serviço de administração e operação do ambiente PostgreSYS usando a forma curta do flag de serviço. ```bash pgsmart install -s adm [Flags] ``` -------------------------------- ### Example Backup Repository Parameter Source: https://docs.tecnisys.com.br/pgsys/docs/config-repo-param-backup This example shows a parameter configured specifically for the backup repository. ```text ─── [ repo01 ] ─── (site) pg1-host = 192.168.56.237 ``` -------------------------------- ### Example Command Parameter for Backup Source: https://docs.tecnisys.com.br/pgsys/docs/config-repo-param-backup This example illustrates a parameter configured for a specific command within the backup context. ```text ─── [ site01:archive-push ] ─── (cmd) archive-push-queue-max = 1B ``` -------------------------------- ### Habilitar Serviço Firewalld no Boot Source: https://docs.tecnisys.com.br/pgsys/docs_comuns/configuracao-firewall Configura o serviço firewalld para iniciar automaticamente quando o sistema for inicializado. ```bash sudo systemctl enable firewalld ``` -------------------------------- ### Install TSA on SUSE systems using zypper Source: https://docs.tecnisys.com.br/pgsys/docs_comuns/suporte Installs the Tecnisys Support Agent package on SUSE systems using the zypper command. ```bash sudo zypper install tecnisys-support-agent-1.0.0-0.x86_64.rpm ``` -------------------------------- ### Instalação Interativa com Serviço e Versão Pré-definidos Source: https://docs.tecnisys.com.br/pgsys/docs/instalacao-obs Exemplo de comando para iniciar a instalação interativa, com o serviço e a versão do PostgreSQL já especificados. O sistema ainda solicitará confirmação e outros parâmetros. ```bash pgsmart install --service=obs --pg-version=15 ``` -------------------------------- ### Install TSA on RHEL-based systems using dnf Source: https://docs.tecnisys.com.br/pgsys/docs_comuns/suporte Installs the Tecnisys Support Agent package on RHEL-like systems using the dnf command. ```bash sudo dnf install tecnisys-support-agent-1.0.0-0.x86_64.rpm ``` -------------------------------- ### Download de Pacotes de Componentes via Wget Source: https://docs.tecnisys.com.br/pgsys/docs_comuns/pacotes-instalacao Baixe todos os pacotes de componentes da plataforma de uma só vez usando este comando. O arquivo baixado é um tar.gz. ```bash wget https://repo.tecnisys.com.br/yum/pgsys/components/4.1/pgsys-components-4.1-rhel-8-x86-64.tar.gz ``` -------------------------------- ### Authorized User Parameters Example Source: https://docs.tecnisys.com.br/pgsys/docs/config-pool-parametros-usu Displays example configurations for authorized user parameters, showing user-defined and default values for pool settings. ```plaintext ─── [ postgres ] ─── (user) max_user_connections = 3 (default) pool_size = 20 ─── [ usu2 ] ─── (user) max_user_connections = 10 (default) pool_size = 20 ``` -------------------------------- ### Instalar PgSmart CLI com APT Source: https://docs.tecnisys.com.br/pgsys/docs/instalacao-pgsmart-manual Use estes comandos para atualizar o cache de pacotes e instalar o cliente PgSmart em sistemas Debian ou Ubuntu usando o gerenciador de pacotes APT. ```bash sudo apt-get update sudo apt-get install pgsmart-client-4.1-amd64.deb ``` -------------------------------- ### Example HA Environment Access Test Source: https://docs.tecnisys.com.br/pgsys/docs/config-ha-proxy An example demonstrating how to test access to the HA environment using specific credentials and network details. ```bash psql -U patroni -h 192.168.200.135 -p 5432 postgres ``` -------------------------------- ### Instalar PgSmart CLI com Zypper Source: https://docs.tecnisys.com.br/pgsys/docs/instalacao-pgsmart-manual Use este comando para instalar o pacote do cliente PgSmart em sistemas SUSE usando o gerenciador de pacotes Zypper. ```bash sudo zypper install pgsmart-client-4.1-1.el8.x86_64.rpm ``` -------------------------------- ### Install TSA on Debian/Ubuntu systems using apt-get Source: https://docs.tecnisys.com.br/pgsys/docs_comuns/suporte Installs the Tecnisys Support Agent package on Debian or Ubuntu systems using the apt-get command. ```bash sudo apt-get install tsa_1.0.0-0_amd64.deb ``` -------------------------------- ### Download de Pacotes de Utilitários via Wget Source: https://docs.tecnisys.com.br/pgsys/docs_comuns/pacotes-instalacao Baixe todos os pacotes de utilitários e dependências de uma só vez usando este comando. O arquivo baixado é um tar.gz. ```bash wget https://repo.tecnisys.com.br/yum/pgsys/utils/4.1/pgsys-utils-4.1-rhel-8-x86-64.tar.gz ``` -------------------------------- ### Load Environment Variables After Installation Source: https://docs.tecnisys.com.br/pgsys/docs/inicializa-instancia-db Loads PgSmart environment variables into the current Linux session. This command should be executed once after installation to make the variables immediately available. ```bash source ~/.bash_profile ``` -------------------------------- ### Install TSA on RHEL-based systems using rpm Source: https://docs.tecnisys.com.br/pgsys/docs_comuns/suporte Installs the Tecnisys Support Agent package on RHEL, CentOS, Rocky Linux, AlmaLinux, SUSE, or openSUSE using the rpm command. ```bash sudo rpm -ivh tecnisys-support-agent-1.0.0-0.x86_64.rpm ``` -------------------------------- ### Baixar Imagem Docker do PgSmart Client Source: https://docs.tecnisys.com.br/pgsys/docs/execucao-via-docker-cli-web Baixa a última versão da imagem Docker do PgSmart Client, que inclui a interface CLI e Web. Use este comando para obter a versão mais recente. ```bash docker pull repo.tecnisys.com.br/pgsys/pgsmart-client:latest ``` -------------------------------- ### Example Site Backup Parameter Source: https://docs.tecnisys.com.br/pgsys/docs/config-site-param-backup Displays a site-specific backup parameter configuration. ```plaintext ─── [ site01 ] ─── (site) pg1-host = 192.168.56.237 ``` -------------------------------- ### Permitir Conexões de Rede para PostgreSQL Source: https://docs.tecnisys.com.br/pgsys/docs_comuns/configuracao-selinux Ativa a política SELinux que permite ao PostgreSQL estabelecer conexões de rede. ```bash sudo setsebool -P postgresql_can_network_connect 1 ``` -------------------------------- ### Instalação Não-Interativa do Serviço HA Source: https://docs.tecnisys.com.br/pgsys/docs/instalacao-ha Executa a instalação do serviço HA de forma não-interativa usando a flag '--quiet'. Requer que os parâmetros como agente, serviço e componentes HA sejam fornecidos. ```bash pgsmart install -q -a --service=ha --ha-components={agent|dcs|proxy) ``` -------------------------------- ### Viewing Backup Repository Parameters Source: https://docs.tecnisys.com.br/pgsys/docs/config-repo-param-backup This snippet shows an example of how backup repository parameters are displayed, including their origin and value. ```text ─── [ repo01 ] ─── (site) pg1-host = 192.168.56.237 ``` -------------------------------- ### Aplicar Contexto de Segurança Source: https://docs.tecnisys.com.br/pgsys/docs_comuns/configuracao-selinux Este comando aplica recursivamente os contextos de segurança definidos para um diretório. Substitua `` pelo caminho do diretório. ```bash sudo restorecon -Rv ``` -------------------------------- ### Instalar PgSmart CLI com RPM Source: https://docs.tecnisys.com.br/pgsys/docs/instalacao-pgsmart-manual Use este comando para instalar o pacote do cliente PgSmart em sistemas RHEL, CentOS, Rocky, Alma, SUSE ou openSUSE usando o gerenciador de pacotes RPM. ```bash sudo rpm -ivh pgsmart-client-4.1-1.el8.x86_64.rpm ``` -------------------------------- ### Configurar Contextos de Segurança para Diretórios PostgreSQL Source: https://docs.tecnisys.com.br/pgsys/docs_comuns/configuracao-selinux Este script adiciona e aplica contextos de segurança específicos para os diretórios do PostgreSQL, garantindo que o SELinux permita o acesso adequado aos dados. ```bash DIRETORIOS=("/var/lib/pgsql" "/var/lib/pgsql/data") for DIR in "${DIRETORIOS[@]}"; do sudo semanage fcontext -a -t postgresql_db_t "${DIR}(/.*)?" sudo restorecon -Rv ${DIR} done ``` -------------------------------- ### Run PgSmart Client Container Source: https://docs.tecnisys.com.br/pgsys/docs/execucao-via-docker-cli-web Start the PgSmart Client container, which includes the CLI and Web interface. This container exposes the web interface on port 4435. ```bash docker run -p 4435:4435 -d https://repo.tecnisys.com.br/pgsmart-client:latest ``` -------------------------------- ### Interactive Backup Restore Execution Source: https://docs.tecnisys.com.br/pgsys/docs/restaura-backup Initiate an interactive backup restore process. The tool will guide you through selecting the agent, backup site, specific backup, and restore options. ```bash pgsmart backup restore ``` -------------------------------- ### Verificar versão do PgSmart CLI Source: https://docs.tecnisys.com.br/pgsys/docs/instalacao-pgsmart-manual Execute este comando para verificar se a instalação do PgSmart CLI foi bem-sucedida, exibindo a versão instalada. ```bash pgsmart -v ``` -------------------------------- ### Load PgSmart Environment Variables Source: https://docs.tecnisys.com.br/pgsys/docs/instalacao-ha After installation, PgSmart sets environment variables like PGDATA and PGBIN in the bash_profile. Execute this command to load these variables immediately into the current session. ```bash source ~/.bash_profile ``` -------------------------------- ### Instalação Interativa com Serviço e Versão do PostgreSQL Pré-definidos Source: https://docs.tecnisys.com.br/pgsys/docs/instalacao-pool Execute este comando para uma instalação interativa onde tanto o serviço de pool de conexões quanto a versão específica do PostgreSQL (neste caso, 15) já estão pré-selecionados. ```bash pgsmart install --service=pool --pg-version=15 ```