No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

HUAWEI CLOUD Stack 6.5.0 Backup and Restoration Guide 03

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Backing Up Combined API/VPC/API Gateway/TaskCenter/SDR/CCS Data

Backing Up Combined API/VPC/API Gateway/TaskCenter/SDR/CCS Data

Introduction

This section describes how to back up database nodes.

  • For API Gateway, Combined API, Task Center, Service Detail Record (SDR), Virtual Private Cloud (VPC), and Cloud Configuration Service (CCS) that are deployed on the PUB-DB01 and PUB-DB02 nodes, the backup data of these services is stored in the same backup file. Therefore, the backup policy applies to all the data of services deployed on the database nodes.
  • You need to separately back up data of services whose database is deployed separately.

Backup Policy

Scenarios
Before performing critical operations, such as a system upgrade or critical data modification, back up the database in advance to ensure that data can be restored once an exception occurs or the operation has not achieved the expected result.
  • Disks or OSs of both the active and standby database nodes are faulty, and the data is lost.
  • Data is damaged due to incorrect operations.
Backup Mechanism
  • Both automatic backup and manual backup are supported.
  • Automatic backup supports the following backup modes:
    • Full backup: The system automatically performs a full backup at 00:00 every day.
    • Incremental backup: The system automatically performs an incremental backup at an interval of 4 hours starting from 04:00 every day. (At 00:00, the system performs a full backup and does not perform an incremental backup.)
    NOTE:

    One automatic backup file package is generated each day. The package contains both the full and incremental backup files.

  • A maximum of 30 manual or automatic backup files can be retained by default. This default value can be changed. For details, see section Configuring Backup Policies. If the number of backup files exceeds the configured maximum value, the system automatically deletes the earliest ones.
Backup File Name
  • The backup file name cannot contain Chinese characters.
  • The backup file is named in the following format:

    [Region ID][Backup mode]-[Service name]-[Year][Month][Day][SN]

    Some parameters are described as follows:

    • Region ID: indicates the ID of the region.
    • Backup mode: indicates the backup method, which can be FAT (automatic backup) or FMT (manual backup).
    • Service name: indicates the database node of a service. Typically, the value is Service name.
      NOTE:

      The names of the services that are deployed together are separated by hyphen (-). For example: "METERTICKET-VPC-CCS-TASKMGR-CONSOLE-TASKCENTER".

    • SN: indicates the serial number. The value is in D+Three-digit number format, and the three-digit number ranges from 001 to 999.

    For example:

  • XXFAT-METERTICKET-VPC-CCS-TASKMGR-CONSOLE-TASKCENTER-20180418D001.tar.gz

    It indicates that an automatic backup is created on April 18, 2018 for the database node of the SDR, VPC, CCS, Combined API, API Gateway, and Task Center deployed together in the XX region and that the backup file SN is 001.

  • XXFAT-YY-20150601D004.tar.gz

    It indicates that an automatic backup is created on June 1, 2015 for the database node of the YY service in the XX region and that the backup file SN is 004.

Backup File Storage Path

Backup files can be stored in a local directory or be uploaded to a third-party backup server.

If a third-party backup server is configured, the system automatically uploads backup files to the third-party backup server after required data is automatically or manually backed up to the local directory.

Table 3-9 lists the paths for storing backup files.
Table 3-9 Backup file storage paths

Backup Type

Backup Item

Automatic Backup Path

Manual Backup Path

Local backup

Database files

/opt/backup/DB on the database node

/opt/backup/DB on the database node

Third-party backup server

Database files

Directory configured on the third-party backup server

Directory configured on the third-party backup server

Configuring Backup Policies

This section describes how to configure the maximum number of backup files to be stored, backup file names, and parameters for connecting to the third-party backup server based on service requirements.

Background

Before an automatic or manual backup, you need to specify the backup file quantity, naming rules, and the IP address and storage path of backup files on the third-party server.

Prerequisites
  • You have obtained IP addresses of the active and standby nodes and the passwords of OS account root and OS service account gaussdb if the database is deployed in active/standby mode.
    NOTE:

    The default password of the root user is Cloud12#$, and that of the gaussdb user is Huawei@123.

    • The OS service account of the database nodes of the services that are deployed together is gaussdb.
    • Services that are not deployed together with other services have their own OS service accounts.
  • You have obtained a local PC that can communicate with the database nodes.
  • You have obtained the configuration information of the third-party backup server.
Procedure

Configuring the Interconnection Information Between the Backup Configuration Files and the Third-Party Backup Server

Configure the maximum number of backup files that can be saved and the interconnection information of the third-party backup server. You can perform the operations on DMK or log in to the database nodes to modify configuration parameters. You are recommended to use DMK.

DMK

  1. Log in to DMK at https://IP address of DMK:8443.

    • The default account of the services that are deployed together is gaussdb, and the default password is Cloud12#$.
    • For services that are deployed separately, you need to obtain their own accounts to log in to DMK.

  1. In the navigation pane on the left, choose Deploy Guide.
  2. On the Service Configuration page, select GaussdbHA, as shown in Figure 3-5.

    Figure 3-5 Service Configuration

  3. Set the following parameters:

    • Select Version: 1.2.5
    • Select Action: Upgrade
    • Select Region: local
    • Host Repository: NO
    • Blue-Green Deployment: NO

  4. Click Next to go to the Hosts and User Configuration page.
  5. Select the team and added account.

    • The team of the services that are deployed together is SDR, and the account is gaussdb.
    • For services that are deployed separately, you need to select their own teams and accounts.

  6. Modify the configuration file.

    The configuration file defines parameters for backup configurations and information for interconnecting with the third-party backup server.
    1. Click beside Configuration File. The Configuration File area and the Configuration File Template area are displayed. Then, modify the parameter values in the Configuration File area as required, as shown in Figure 3-6.
    2. Copy the content in Backup Info and SFTP config in the Configuration File Template area to the blank area at the bottom of the Configuration File area. Then, modify the parameter values in the Configuration File area as required, as shown in Figure 3-7.
    Figure 3-6 Configuration file a
    Figure 3-7 Configuration file b
    NOTE:

    Table 3-10 and Table 3-11 describe the parameters in the configuration file. For those not listed, retain their default values.

    Table 3-10 Parameter description

    Parameter

    Description

    LOCATION

    Region ID in the backup file name

    MAX_BACKUP_NUM

    Maximum number of backup files that can be stored

    SN_BACKUP_NUM

    Serial number of the latest backup file

    UPLOAD_FTP_MODE

    Backup type. Retain the default value.

    1: indicates that data is backed up to a third-party backup server using SFTP.

    Table 3-11 Parameters for interconnecting with the third-party backup server

    Parameter

    Description

    SFTP_SERVER_IP

    IP address of the third-party backup server

    SFTP_SERVER_PORT

    Port number of the third-party backup server

    SFTP_SERVER_USER

    Username of the third-party backup server

    SFTP_SERVER_PASSWD

    Ciphertext password for logging in to the third-party backup server. The password is encrypted using SHA-256.

    SFTP_SERVER_FILEPATH

    Directory on the third-party backup server for storing backup files

  7. Click Execute to start upgrading.
  8. Check the task status.

    1. In the navigation pane on the left, choose Task Board.
    2. Locate the task and view the status before the task name. The task is successful if the status changes to .
    3. Click Details in the Operation column to view details about the task.

Logging in to the Database Node and Changing the Password

  1. Use PuTTY to log in to the PUB-DB01 node.

    The default account is gaussdb. The default password is Huawei@123.

  2. Run the following command and enter the password of user root to switch to user root:

    sudo su - root

  3. Run the following command to view the database status and check whether the currently logged-in node is the active one:

    service had query

    Information similar to that shown in Figure 3-8 is displayed. The node for which active is displayed under the ROLE column is active.

    Figure 3-8 Database status

  4. Check whether the currently logged-in node is the active one based on the command output in Step 3.

  5. Run the following command to disable user logout upon system timeout:

    TMOUT=0

  1. Run the following command to switch to the directory containing the backup configuration file:

    cd /opt/gaussdb/ha/tools/backupAndRestore

  1. Run the following command to open the backup configuration file using the vi editor:

    vi backup.conf

    Table 3-12 describes the parameters in the configuration file.

    Table 3-12 Parameter description

    Parameter

    Description

    LOCATION

    Region ID in the backup file name

    MAX_BACKUP_NUM

    Maximum number of backup files that can be stored

    SN_BACKUP_NUM

    Serial number of the latest backup file

    SERVICE_NAME

    Service name of the database node

    UPLOAD_FTP_MODE

    Backup type. Retain the default value.

    • 1: indicates that data is backed up to a third-party backup server using SFTP.

  2. Press i to enter the editing mode.
  3. Configure the parameters as required.
  4. Press Esc, enter :wq, and press Enter.

    The system saves the configurations and exits the vi editor.

Configuring the Third-Party Backup Server Interconnection Information

  1. Use PuTTY to log in to the PUB-DB01 node.

    The default account is gaussdb. The default password is Huawei@123.

  2. Run the following command and enter the password of user root to switch to user root:

    sudo su - root

  3. Run the following command to view the database status and check whether the currently logged-in node is the active one:

    service had query

    Information similar to that shown in Figure 3-9 is displayed. The node whose ROLE is active is the active node.

    Figure 3-9 Database status

  4. Check whether the currently logged-in node is the active one based on the command output in Step 3.

  5. Run the following command to disable user logout upon system timeout:

    TMOUT=0

  6. Run the following command to switch to the directory containing the configuration file for interconnecting with the third-party backup server:

    cd /opt/gaussdb/ha/tools/backupAndRestore

  7. Run the following command to open the configuration file using the vi editor:

    vi Upload_Server.cfg

    Table 3-13 describes the parameters in the configuration file.

    Table 3-13 Parameters for interconnecting with the third-party backup server

    Parameter

    Description

    FTP_SERVER_IP

    IP address of the third-party backup server

    FTP_SERVER_PORT

    Port number of the third-party backup server

    FTP_SERVER_USER

    Username of the third-party backup server

    FTP_SERVER_PASSWD

    Ciphertext password for logging in to the third-party backup server. The password is encrypted using SHA-256.

    FTP_SERVER_FILEPATH

    Directory on the third-party backup server for storing backup files

    NOTE:

    Parameters in the DMK configuration file listed in Table 3-11 and Table 3-13 are also contained in the configuration file on the database node, but their parameter names are different. For example, parameter SFTP_SERVER_IP on DMK has the same meaning as FTP_SERVER_IP in the configuration file on the database node.

    • If the current GaussDB node already has SFTP backup server deployed, you can obtain the ciphertext required in Table 3-13 from the following directory: /opt/gaussdb/ha/tools/backupAndRestore/Upload_Server.cfg.
    • If you cannot obtain the existing ciphertext of SFTP server, perform the following operations to encrypt the password plaintext:
      1. Log in the database node using the service account.
      2. Run the following command and enter the password of the root user to switch to the root user:

        sudo su - root

      3. Run the following commands:

        source /etc/profile

        pwswitch -e "Plaintext password"

  8. Press i to enter the editing mode.
  9. Modify the parameters in the configuration file based on the obtained information about the third-party backup server.
  10. Press Esc, enter :wq, and press Enter.

    The system saves the change and exits the vi editor.

Checking Automatic Backup Data

After the system periodically performs the automatic backup task, it will save the backup data packages locally and periodically upload them to a third-party server. This section describes how to view the automatic backup data packages.

Prerequisites
  • An application, such as PuTTY, which can be used for remote access on various platforms, is available.
  • To view the automatic backup data packages, the following operations need to be performed:
    • You have configured the backup file by following the steps provided in section Configuring Backup Policies.
    • You have obtained IP addresses of the active and standby nodes and the passwords of OS account root and OS service account gaussdb if the database is deployed in active/standby mode.
      NOTE:

      The default password of user root is Cloud12#$, and that of user gaussdb is Huawei@123.

      • The OS service account of the database nodes of the services that are deployed together is gaussdb.
      • Services that are not deployed together with other services have their own OS service accounts.
    • You have obtained a local PC that can communicate with the database nodes.
  • To view the backup data on the third-party backup server, the following conditions need to be met:
    • The database nodes can properly communicate with the third-party backup server.
    • Information about the third-party backup server has been configured on the database nodes. For details, see section Configuring Backup Policies.
    • You have obtained a local PC that can communicate with the database nodes.
Procedure

Viewing the Local Automatic Backup Data Packages

  1. Use PuTTY to log in to the PUB-DB01 node.

    The default account is gaussdb. The default password is Huawei@123.

  2. Run the following command and enter the password of user root to switch to user root:

    sudo su - root

  3. Run the following command to view the database status and check whether the currently logged-in node is the active one:

    service had query

    Information similar to that shown in Figure 3-10 is displayed. The node for which active is displayed under the ROLE column is active.

    Figure 3-10 Database status

  4. Check whether the currently logged-in node is the active one based on the command output in Step 3.

  5. Run the following command to disable user logout upon system timeout:

    TMOUT=0

  1. Run the following command to view backup files in the directory:

    ll /opt/backup/DB

    Check whether the directory contains the latest backup files based on the check time.

    NOTE:
    • The system automatically performs a full backup at 00:00 every day and performs an incremental backup at an interval of 4 hours starting from 04:00 every day.
    • Each time the backup package is incrementally backed up, the time is updated.
    • Check whether the latest backup package is generated based on the current time.
    • If yes, no further action is required.
    • If no, contact technical support for assistance.

Checking the Automatic Backup Data Packages Stored on the Third-Party Backup Server

  1. Use PuTTY and the IP address of the SFTP server to log in to the SFTP server.

    The login address is SFTP_SERVER_IP.

    The login account is SFTP_SERVER_USER, and the password is SFTP_SERVER_PASSWD.

    NOTE:

    SFTP_SERVER_IP is the IP address of the third-party backup server, and SFTP_SERVER_USER is the username of the third-party backup server.

    SFTP_SERVER_PASSWD is the password used for backing up data to the SFTP server.

  1. View backup files in the directory.

    Obtain the directory from the SFTP_SERVER_FILEPATH in Table 3-11.

    Check whether the directory contains the latest backup files.

    • If yes, no further action is required.
    • If no, contact technical support for assistance.

Manually Backing Up Data

This section describes how to manually back up data.

Background

You need to manually back up data on the database node in any of the following scenarios:

  • After an important operation, such as a system upgrade or critical data modification, an exception occurs or the operation has not achieved the expected result.
  • The disks or OSs of both active and standby database nodes are faulty, and the node data is lost.
  • Data is damaged due to incorrect operations.
    NOTE:

    If the database is deployed in active/standby mode, you need to manually back up data only on the active node.

Prerequisites
  • An application, such as PuTTY, which can be used for remote access on various platforms, is available.
  • You have configured the backup file by following the steps provided in section Configuring Backup Policies.
  • You have obtained IP addresses of the active and standby nodes and the passwords of OS account root and OS service account gaussdb if the database is deployed in active/standby mode.
    NOTE:

    The default password of the root user is Cloud12#$, and that of the gaussdb user is Huawei@123.

    • The OS service account of the database nodes of the services that are deployed together is gaussdb.
    • Services that are deployed separately have their own OS service accounts.
  • You have obtained a local PC that can communicate with the database nodes.
  • The third-party component JDK has been installed.
  • The following requirements must be met if data is to be backed up to a third-party backup server:
    • The database nodes can properly communicate with the third-party backup server.
    • Information about the third-party backup server has been configured on the database nodes. For details, see section Configuring Backup Policies.
Procedure
  1. Use PuTTY to log in to the PUB-DB01 node.

    The default account is gaussdb. The default password is Huawei@123.

  2. Run the following command and enter the password of user root to switch to user root:

    sudo su - root

  3. Run the following command to view the database status and check whether the currently logged-in node is the active one:

    service had query

    Information similar to that shown in Figure 3-11 is displayed. The node for which active is displayed under the ROLE column is active.

    Figure 3-11 Database status

  4. Check whether the currently logged-in node is the active one based on the command output in Step 3.

  5. Run the following command to disable user logout upon system timeout:

    TMOUT=0

  1. Run the following command to make environment variables take effect:

    source /etc/profile

  2. Run the following command to back up data:

    dbBackupManual

    After the data backup finishes, the system automatically uploads the backup file to a third-party backup server.

    If the command output contains the following information, the data backup has finished, and the backup file is uploaded to a third-party backup server:

    b0(backup success)u0(upload success)
    Successfully, backup file is in /opt/backup/DB like xxx.tar.gz

  1. Run the following command to view backup files in the directory:

    ll /opt/backup/DB

    Check whether the directory contains the latest backup files.

    • If yes, no further action is required.
    • If no, contact technical support for assistance.

Translation
Download
Updated: 2019-06-14

Document ID: EDOC1100062366

Views: 2073

Downloads: 15

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next