Installing a PostgreSQL Cluster from the Marketplace

You can easily locate the PostgreSQL Master-Slave Cluster package in the Marketplace.

PostgreSQL Master-Slave Cluster

Modify the database version, environment name, and destination region as needed within the installation window.

PostgreSQL Automatic Clustering Mode

In AccuWeb.Cloud, enabling auto-clustering is made simple with a dedicated switch designed to streamline the clustering process.

To activate it, access the topology wizard in the dashboard, select your software stack (e.g., PostgreSQL 15), and toggle the Auto-Clustering switch to the on position.

Automatic Clustering Mode

Cluster Topology

The database cluster topology resulting from both deployments is depicted as follows:

Cluster Topology

Once the database cluster installation is finished, you will receive a confirmation message containing the master node URL and database access credentials. Additionally, this information will be sent to you via email for your records.

Cluster Deployed Successfully

Now, let’s activate the master database to verify the successful replication of data to the slave.

Testing PostgreSQL Database Replication Functionality

To verify proper data replication, we will create a new database instance in the master container and confirm its presence in the slave.

Create a New Database

Step 1. Click on “Open in Browser” next to the PostgreSQL Master node to access the phpPgAdmin web interface.

Open in Browser

Step 2. Navigate to Servers, select PostgreSQL, and log in using the credentials provided during cluster installation.

Login to PostgreSQL

Step 3. Select “Create database” from the menu.

Create Database

Step 4. Enter a name in the Name box (e.g., test) and click on the Create button.

Enter Name

Now that the database is created on the master node, let’s verify the replicated data on the slave node.

Check the Replication

Step 1. Open the phpPgAdmin web interface by clicking on “Open in Browser” next to the PostgreSQL Slave node.

Check the Replication

Step 2. Log in to the admin interface using the same username and password that you used to access the master node

Access Admin Interface

Once logged in, you’ll find the replicated database (e.g., test) visible.

Congratulations! Your PostgreSQL environment with master-slave asynchronous replication is now operational and ready for data processing.

Next, connect this PostgreSQL replicated database to your project. Follow the instructions below based on your application specifics:

  • For Java applications
  • For PHP applications

Configure PostgreSQL Replication