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).
Restoring AS Data

Restoring AS Data

Background

Roll back the system if any of the following failures occurs. During the rollback, you need to restore data.

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

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

Prerequisites

  • A PC that can communicate with the database nodes is available.
  • You have obtained IP addresses of the active and standby nodes and the passwords of OS accounts root, admin, and dbadmin as well as database administrator account dbadmin if the database nodes are deployed in active/standby mode.
    NOTE:

    The default password of user root is Cloud12#$, that of user admin is IaaS@OS-CLOUD9!, that of OS user dbadmin is Manager@123, and that of database administrator account dbadmin is Manager@123.

  • System services are running properly.
  • The following conditions are met if the backup file stored on the third-party server is used to restore data:
    • The local PC communicates with the third-party backup server properly.
    • You have obtained the IP address of the third-party backup server.
    • You have obtained the user root password for logging in to the third-party backup server.
  • An application, such as PuTTY, which can be used for remote access on various platforms, is available.
  • A file transfer tool, such as WinSCP, is available.

Procedure

Prepare data.

  1. Use PuTTY to log in to a database node using the management IP address.

    The default username is admin. The default password is IaaS@OS-CLOUD9!.

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

    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 2-7 is displayed:

    Figure 2-7 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

  6. Run the following command to check the backup files in the backup file storage directory:

    ll /opt/backup/DB

  7. Check whether the backup file that meets the requirements exists on the active node based on the command output in Step 6.

  8. Run the following command to log in to the third-party backup server:

    sftp Username for logging in to the third-party backup server@IP address of the third-party backup server

  9. Run the following command to query the files on the third-party backup server and locate the file to be downloaded:

    cd /sftpuser/

    sftpuser indicates the backup file path of the third-party backup server.

  10. Run the following command to download the file queried in Step 9 to the specified directory on the current node:

    get Backup data compression file /tmp/

    For example, run the following command:

    get XXFAT-METERTICKET-VPC-CCS-TASKMGR-CONSOLE-TASKCENTER-20180418D001.tar.gz /tmp/

Restore data.

  1. Use PuTTY to log in to the active database node.

    The default username is admin. The default password is IaaS@OS-CLOUD9!.

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

    sudo su - root

    The default password is Cloud12#$.

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

    source /etc/profile

  4. Run the following command to stop the database service:

    haStopAll -a

    The database service stops if information similar to the following is displayed:

    stop ha successful

  5. Stop the database service on the standby node by performing Step 11 to Step 14.
  6. Run the following command on the active database node to restore the database:

    dbRestore -f Relative or absolute path in which the backup file is stored

    For example, run the following command:

    dbRestore -f /opt/backup/DB/XXFAT-METERTICKET-VPC-CCS-TASKMGR-CONSOLE-TASKCENTER-20180418D001.tar.gz

    NOTE:

    Run the dbRestore -h command to view the command help.

    The database is restored if information similar to the following is displayed:

    Recovery successfully!

Verify the result.

  1. Run the following command to enable the HA service:

    haStartAll -a

  2. Run the following command to switch to the dbadmin user:

    su - dbadmin

  3. Run the following command and enter the password (default password: Manager@123) of database administrator account dbadmin as prompted to connect to the database:

    gsql

  4. Run the following command to check whether the database is restored:

    \l

    Check whether all databases are displayed in the List of databases column.

  5. Run the following command to exit the database:

    \q

  6. Run the following command to log in to the specified database:

    gsql -d Database name -U Username -W Password

  7. Run the following command to check whether the database contains all tables:

    \d

    Check whether all tables of the database are displayed in the command output.

  8. Run the following command to exit the database:

    \q

  9. Run the following command to log out OS account dbadmin:

    exit

Translation
Download
Updated: 2019-06-14

Document ID: EDOC1100062366

Views: 838

Downloads: 10

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