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 Auto Scaling Data

Backing Up Auto Scaling Data

Configuring a Backup Policy

Context

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.

The AutoScaling-Server and AutoScaling-Schedule database nodes use GaussdbHA as the backend database which is deployed in active/standby mode. The methods for configuring backup policies on each database node are the same.

Prerequisites
  • You have obtained the IP addresses of the active and standby nodes as well as the passwords of users root and admin (OS accounts) if the node is deployed in active/standby mode.
    NOTE:

    The default password of user root is Cloud12#$, and that of user admin is IaaS@OS-CLOUD9!.

  • A PC that can communicate with the database nodes is available.
  • You have obtained configuration information about the third-party backup server.
Procedure

Configuring the Backup Configuration File and the Parameters for Connecting the Third-Party Backup Server

  1. Use PuTTY to log in to the AS-SVRDB-SVRDB01 node of AutoScaling-Server.

    Default username: admin; default password: IaaS@OS-CLOUD9!

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

    sudo su - root

    The default password is Cloud12#$.

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

    service had query

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

    Figure 3-25 Database status

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

  5. Run the following command to disable PuTTY logout on system timeout:

    TMOUT=0

  1. Run the following command to go to the directory where the backup configuration file is stored:

    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-23 describes the parameters in the configuration file.

    Table 3-23 Parameters in the configuration file

    Parameter

    Description

    LOCATION

    Specifies the region ID in the backup file name.

    MAX_BACKUP_NUM

    Specifies the maximum number of backup files that can be stored.

    SN_BACKUP_NUM

    Specifies the serial number of the latest backup file.

    SERVICE_NAME

    Specifies the database node of a service.

    UPLOAD_FTP_MODE

    Specifies the backup type. Use the default value.

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

  2. Press i to enter the editing mode.
  3. Change the parameter values based on service requirements.
  4. Press Esc, enter :wq, and press Enter.

    The system saves the settings and exits the vi editor.

Configure third-party backup server interconnection information.

  1. Use PuTTY to log in to the master database node of AutoScaling-Server. For details about how to determine the master database node, see steps Step 1 to Step 3.

    Default username: admin; default password: IaaS@OS-CLOUD9!

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

    sudo su - root

    The default password is Cloud12#$.

  3. Run the following command to disable PuTTY logout on system timeout:

    TMOUT=0

  4. 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

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

    vi Upload_Server.cfg

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

    Table 3-24 Parameters in the configuration file for third-party backup server interconnection

    Parameter

    Description

    FTP_SERVER_IP

    Specifies the IP address of the third-party backup server.

    FTP_SERVER_PORT

    Specifies the port number of the third-party backup server.

    FTP_SERVER_USER

    Specifies the username for logging in to the third-party backup server.

    FTP_SERVER_PASSWD

    Specifies the password ciphertext for logging in to the third-party backup server. The password is encrypted using SHA256.

    FTP_SERVER_FILEPATH

    Specifies the directory on the third-party backup server for storing the uploaded backup files.

    • If the current GaussDB node already has an SFTP backup server deployed, you can obtain the ciphertext required in Table 3-24 from the following directory: /opt/gaussdb/ha/tools/backupAndRestore/Upload_Server.cfg.
    • If the ciphertext of the FTP server cannot be obtained, perform the following operations to encrypt the plaintext:
      1. Log in to the database node as a service user.
      2. Run the sudo su command to switch to user root and enter the password of user root.
      3. Run the following commands:

        source /etc/profile

        pwswitch -e Plaintext password

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

    The system saves the changes and exits the vi editor.

Viewing Automatic Backup Data

Context

After an automatic backup task is executed, the system saves the backup data package to the local host and uploads the package to the third-party server periodically. This section describes how to view the automatic backup data package.

The AutoScaling-Server and AutoScaling-Schedule database nodes use GaussdbHA as the backend database which is deployed in active/standby mode. The methods for viewing automatic backup data on each database node are the same.

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 which are stored locally, the following conditions need to be met:
    • You have configured the backup file by following the steps provided in Configuring a Backup Policy.
    • You have obtained the IP addresses of the active and standby nodes as well as the passwords of users root and admin (OS accounts) if the node is deployed in active/standby mode.
      NOTE:

      The default password of user root is Cloud12#$, and that of user admin is IaaS@OS-CLOUD9!.

    • A PC that can communicate with the database nodes is available.
  • To view the backup data on the third-party backup server, the following conditions need to be met:
    • The database node can communicate with the third-party backup server.
    • Information about the third-party backup server has been configured on the database node. For details, see Configuring a Backup Policy.
    • A PC that can communicate with the database nodes is available.
Procedure

View the automatic backup data packages which are stored locally.

  1. Use PuTTY to log in to the AS-SVRDB-SVRDB01 node of AutoScaling-Server.

    Default username: admin; default password: IaaS@OS-CLOUD9!

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

    sudo su - root

    The default password is Cloud12#$.

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

    service had query

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

    Figure 3-26 Database status

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

  5. Run the following command to disable PuTTY logout on system timeout:

    TMOUT=0

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

    ll /opt/backup/DB

    Check whether the latest automatic backup file exists.

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

    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.

Check the automatic backup data packages which are 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.

    Login address: FTP_SERVER_IP

    Login account: FTP_SERVER_USER and password: FTP_SERVER_PASSWD

    NOTE:

    FTP_SERVER_IP is the IP address of the third-party backup server, and FTP_SERVER_USER is the username of the third-party backup server.

    FTP_SERVER_PASSWD is the user password for backing up the data to the SFTP server.

  1. View the files in the directory for storing backup files.

    Obtain the directory from the FTP_SERVER_FILEPATH in Table 3-24.

    Check whether the latest automatic backup file exists.
    • If yes, no further action is required.
    • If no, contact technical support for assistance.

Manually Backing Up Data

Context

Manually back up data on the database node to ensure that services can be restored if any of the following failures occurs:

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

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

The AutoScaling-Server and AutoScaling-Schedule database nodes use GaussdbHA as the backend database which is deployed in active/standby mode. The methods for manually backing up data on each database node are the same.

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 Configuring a Backup Policy.
  • You have obtained the IP addresses of the active and standby nodes as well as the passwords of users root and admin (OS accounts) if the node is deployed in active/standby mode.
    NOTE:

    The default password of user root is Cloud12#$, and that of user admin is IaaS@OS-CLOUD9!.

  • A PC that can communicate with the database nodes is available.
  • The third-party component JDK has been installed.
  • The following conditions are met if data is to be backed up to a third-party backup server:
    • The database node can communicate with the third-party backup server.
    • Information about the third-party backup server has been configured on the database node. For details, see Configuring a Backup Policy.
Procedure
  1. Use PuTTY to log in to the AS-SVRDB-SVRDB01 node of AutoScaling-Server.

    Default username: admin; default password: IaaS@OS-CLOUD9!

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

    sudo su - root

    The default password is Cloud12#$.

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

    service had query

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

    Figure 3-27 Database status

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

  5. Run the following command to disable PuTTY logout on system timeout:

    TMOUT=0

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

    source /etc/profile

  2. Run the following command to back up data:

    dbBackupManual

    After the data is backed up to a local directory, the system automatically uploads the backup files to the third-party backup server.

    The data is backed up and the backup files are uploaded to the third-party backup server if information similar to the following is displayed:

    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 the files in the directory for storing backup files:

    ll /opt/backup/DB

    Check whether the latest automatic backup file exists.

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

Translation
Download
Updated: 2019-06-14

Document ID: EDOC1100062366

Views: 837

Downloads: 10

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