Skip to main content

Introduction

postgresql_cluster automates the deployment and management of highly available PostgreSQL clusters in production environments. This solution is tailored for use on dedicated physical servers, virtual machines, and within both on-premises and cloud-based infrastructures.

Supported setups of Postgres Cluster

Scheme

For a detailed description of the cluster components, visit the Architecture page.

Getting Started

You have the option to easily deploy Postgres clusters using the Console (UI) or from the command line with the ansible-playbook command.

The Console (UI) is the recommended method for most users. It is designed to be user-friendly, minimizing the risk of errors and making it easier than ever to set up your PostgreSQL clusters. This method is suitable for both beginners and those who prefer a visual interface for managing their PostgreSQL clusters.

Run the Console container

To run the PostgreSQL Cluster Console, execute the following command:

docker run -d --name pg-console \
--publish 80:80 \
--publish 8080:8080 \
--env PG_CONSOLE_API_URL=http://localhost:8080/api/v1 \
--env PG_CONSOLE_AUTHORIZATION_TOKEN=secret_token \
--volume console_postgres:/var/lib/postgresql \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /tmp/ansible:/tmp/ansible \
--restart=unless-stopped \
vitabaks/postgresql_cluster_console:2.0.0
tip

It is recommended to run the console in the same network as your database servers to enable monitoring of the cluster status. In this case, replace localhost with your server's IP address in the PG_CONSOLE_API_URL variable.

Open the Console UI

Go to http://localhost/ and use secret_token for authorization.

note
  • If you have set up the console on a different server, replace 'localhost' with the server's address.
  • Use the value of your token if you have redefined it in the PG_CONSOLE_AUTHORIZATION_TOKEN variable.

Cluster creation demo

Refer to the Deployment section to learn more about the different deployment methods.