Starting the Postgres database in the Management subsystem on different environments

Restart or unfence the Postgres database in the Management subsystem to restore connectivity, resume normal operations after maintenance or failover, and ensure system availability across development, staging, and production environments.

About this task

Important:

The procedure that is provided in this document is intended to restart a shut down database. Use the steps provided in this document only when the database is in a stable state and is ready to be restarted. For more information about shutting down the database, see Shutting down the Postgres database in the Management subsystem on different environments.

A database is shut down for various reasons as mentioned below.
  • At times, the system automatically shuts down the database to prevent corruption when a critical error occurs.
  • Sometimes, an administrator manually shuts down the database before performing maintenance, such as a server restart.
Restart the database manually only in the following circumstances.
  • The underlying issue that caused the database to be shut down is resolved.
  • You are certain that restarting the database will not reintroduce risk to the system.
To start the Postgres database:
Note: The OVA package includes API Connect with the CNP plug-in preinstalled. For other environments, install the CNP plug-in from https://github.com/EnterpriseDB/kubectl-cnp.

Procedure

If you have the CNP plug-in preinstalled, to start the Postgres database:
  1. Get the cluster name by running the following command.
    kubectl get clusters.postgresql.k8s.enterprisedb.io
  2. Start the cluster by running the following command.
    kubectl cnp fencing off <cluster_name_from_above_command> "*"
Tip: You can start the Postgres database even if you don't have the CNP plug-in preinstalled.
  1. Get the cluster name by running the following command.
    kubectl get clusters.postgresql.k8s.enterprisedb.io
  2. Start the cluster by running the following command.
    kubectl annotate cluster <cluster_name_from_above_command> k8s.enterprisedb.io/fencedInstances- -n <namespace>
    Remember: Remember to replace <cluster_name_from_above_command> and <namespace>, as required.

Results

The Postgres database in the Management subsystem is successfully started.