Skip to main content
Version: I2023.4.1

For AtScale Clusters Only: Switching the Master AtScale Database Instance to a Different Node

If you need to bring down an AtScale node that is running the master database instance in a two-node AtScale cluster, you must first change the master database instance to a standby database instance and the original standby database instance to the new master database instance.

About this task

In an AtScale cluster, a master database instance must always be running on one of the nodes. However, there are times when the node that is running the master database instance needs to be brought offline for maintenance or for other reasons.

By following this procedure, you can cause a standby database instance to become the master, and cause the current master database instance to become a standby. After making this switch, you can take offline the node that formerly was running the master database instance.

warning

Restriction: This procedure works only for AtScale clusters that have no more than two nodes.

Procedure

  1. On each node (the order of nodes does not matter), run the following commands to terminate all connections to the AtScale database:

    /opt/atscale/bin/atscale_stop_apps
    /opt/atscale/bin/atscale_service_control stop egress
  2. On either node, run the following command to find out which node is currently running the master (Leader) database instance:

    /opt/atscale/current/bin/database/postgres_nodes

    The output is a table that looks like this:

Cluster


Member


Host


Role


State

TL
Lag in MB


atscale_postgres_cluster
atscale-01
atscale-01:10520
Leader
running

1




atscale_postgres_cluster
atscale-02
atscale-02:10520

running

1
  1. On either node, run the following command to move the master (Leader) to the other node:

    /opt/atscale/current/bin/database/standby_switchover
  2. Once the master (Leader) has been moved to the other node, run the following commands on both nodes to restart the AtScale egress and apps services:

    1. First, run this command:

      /opt/atscale/bin/atscale_service_control start egress
    2. Then, run this command:

      /opt/atscale/bin/atscale_start_apps

What to do next

You can now take offline the node that was previously running the master database instance. To do this, see the section Starting and Stopping AtScale Services Manually in the topic Managing AtScale Services.