Help Center> GaussDB> User Guide> Instance Modifications> Changing the Deployment Model of a Single-Replica Instance
Updated on 2024-05-07 GMT+08:00

Changing the Deployment Model of a Single-Replica Instance

Scenarios

You can change the deployment model of a single-replica GaussDB instance to an instance with multiple replicas.

To apply for the permissions needed, submit an application by choosing Service Tickets > Create Service Ticket in the upper right corner of the management console.

The following table lists the available deployment models.
Table 1 Deployment models

DB Instance Type

Deployment Model

Supported Underlying Resource Type

Target Deployment Model to Change

Primary/Standby

Single replica

ECS

1 primary + 2 standby

ECS

1 primary + 1 standby + 1 log

Precautions

  • Currently, the following deployment model change scenarios are supported:
    • Change a single-replica primary/standby instance to a 1 primary + 2 standby instance.
    • Change a single-replica primary/standby instance to a 1 primary + 1 standby + 1 log instance.
  • Before changing the deployment model, ensure that the instance status is normal.
  • The following operations cannot be performed when the deployment model of an instance is being changed: scaling up storage, changing specifications, backing up data, resetting passwords, rebooting the instance, and deleting the instance.
  • Changing the deployment model will interrupt services. Therefore, perform this operation during off-peak hours.
  • After the deployment model is changed, the specifications of the new nodes are the same as those of the original nodes. The specifications of the log node use the configured specifications for log nodes.
  • After a single-replica primary/standby instance is changed to a 1 primary + 1 standby + 1 log instance, its replica consistency protocol changes to Paxos.
  • After the deployment model is changed, an automated backup will be triggered and log archiving will be enabled.
  • Only the deployment model of single-replica instances whose version is 8.0 or later can be changed.
  • Currently, only the deployment model of pay-per-use instances can be changed.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and project.

  3. Click in the upper left corner of the page and choose Databases > GaussDB.
  4. On the Instances page, click the name of the target instance to go to the Basic Information page.
  5. On the Basic Information page, click Change in the Deployment Model field. The Change Deployment Model page is displayed.

  6. On the Change Deployment Model page, select the new deployment model and AZ, and click Next.

    Figure 1 Changing the deployment model

  7. Confirm the displayed details.

    • If you need to modify your settings, click Previous.
    • If the information is correct, click Submit to submit the change request.
    Figure 2 Submitting the request

    After the task is submitted, the instance status will be Changing deployment model.

Verification After the Change

After the change is complete, check the instance status, backup creation status, and instance connectivity, and whether you can add, delete, update, and query data in the instance.

  1. On the Instances page, check whether Status of the target instance is Available.
  2. Click the name of the target instance to go to the Basic Information page. In the Nodes area, check that the statuses of all nodes are normal.
  3. Check that the automated backup triggered after the change is successfully created.

    1. On the Instances page, click the name of the target instance to go to the Basic Information page.
    2. In the navigation pane, choose Backups. Check that a backup has been created and the backup status is Completed.

  4. Check that the instance is properly connected and you can add, delete, update, and query data in the instance.

    1. Log in to the database. For details, see Connecting to an Instance Through DAS.
    2. Go to the SQL Query page.
      Figure 3 SQL query
    3. Create a database.

      CREATE DATABASE database name;

      In this example, run the following command to create a database named db_tpcds:

      CREATE DATABASE db_tpcds;

      Switch to the newly created database in the upper left corner.

      Figure 4 Switching to the new database
    4. Create a table and add, delete, update, and query data in the table.
      1. Create a schema.

        CREATE SCHEMA myschema;

      2. Create a table named mytable that has only one column. The column name is firstcol and the column type is integer.

        CREATE TABLE myschema.mytable (firstcol int);

      3. Insert data to the table.

        INSERT INTO myschema.mytable values (100);

      4. View data in the table.

        SELECT * FROM myschema.mytable;

           | firstcol | 
        ---+----------+
        1  |   100    |
      5. Update data in the table.

        UPDATE myschema.mytable SET firstcol = 200;

      6. View the data in the table again.

        SELECT * FROM myschema.mytable;

           | firstcol | 
        ---+----------+
        1  |   200    |
      7. Delete the table.

        DROP TABLE myschema.mytable;