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 Simple Message Notification (full version) Service Data

Backing Up Simple Message Notification (full version) Service Data

Configuring Backup Policies

Configure the maximum number of backup files to be stored, backup file names, and parameters for interconnecting with third-party backup servers based on service requirements.

Context

Before an automatic or manual backup, you need to define the number of backup files, naming rules of backup files, and IP addresses and paths of third-party servers that store backup files.

Prerequisites
  • You have obtained the IP addresses of the active and standby database nodes as well as the passwords of users root and hermes if the database is deployed in active/standby mode.
  • A PC that can communicate with the database node is available.
  • You have obtained the configuration information of the third-party backup server.
Procedure

Modifying the Backup File Configuration

  1. Use PuTTY to log in to the SMNALL-PS-NS-DB-MEM01 node.

    The default username is hermes, and the default password is Hermes@123.

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

    sudo su - root

    The default username is root, and the default password is Cloud12#$.

  3. Run the following command to add environment variables to the etc/profile file:

    export PATH=$PATH:$HA_DIR/bin:/usr/local/bin

  4. Run the following command to check the database status:

    service had query

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

    Figure 3-28 Database status

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

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

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

    vi backup.conf

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

    Table 3-25 Parameters in the configuration file

    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.

    • Value 1 indicates that data is backed up to an FTP server.
    • Value 0 indicates that data is backed up to an OBS bucket.

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

    The system saves the settings and exits the vi editor.

Configuring the Third-Party Backup Server Interconnection Information

  1. Use PuTTY to log in to the SMNALL-PS-NS-DB-MEM01 node.

    The default username is hermes, and the default password is Hermes@123.

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

    sudo su - root

    The default password of user root is Cloud12#$.

  3. 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 configuration file for interconnecting the third-party backup server:

    cd /opt/gaussdb/ha/tools/backupAndRestore

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

    vi Upload_Server.cfg

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

    Table 3-26 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

    Encrypted password of the third-party backup server. You can encrypt the password using pwswitch.

    FTP_SERVER_FILEPATH

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

    endpoint

    IP address or domain name of the OBS server

    ak

    Encrypted access key (AK) of the OBS server

    sk1

    Encrypted security key (SK) of the OBS server. The ciphertext is too long so it is divided into two parts.

    sk2

    Encrypted SK of the OBS server. The ciphertext is too long so it is divided into two parts.

    bucket

    Backup directory name on the OBS server

    If the current GaussDB node already has OBS or FTP backup server deployed, you can obtain the ciphertext required in Table 3-26 from the following directory: /opt/gaussdb/ha/tools/backupAndRestore/Upload_Server.cfg.

    If the ciphertext is not available, perform the following operations to encrypt the plaintext:

    1. Log in the database node using the service account.
    2. Run the sudo su command and enter the password of user root to switch to user root.
    3. Run the following commands:

      source /etc/profile

      pwswitch -e Plaintext password

  3. Press i to enter the editing mode.
  4. Modify the parameters in the configuration file based on the obtained configurations of the third-party backup server.
  5. Press Esc, enter :wq, and press Enter.

    The system saves the changes and exits the vi editor.

  6. Repeat Step 1 to Step 19 to log in to the SMNALL-PS-NS-DB-MEM02 node and configure interconnection information.

Viewing Automatic Backup Data

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

Prerequisites
  • An application, such as PuTTY, which can be used for remote access across various platforms, is available.
  • To view the local automatic backup data package, the following conditions need to be met:
    • You have configured the backup file by following the steps provided in section Configuring Backup Policies.
    • You have obtained the IP addresses of the active and standby database nodes as well as the passwords of users root and hermes if the database is deployed in active/standby mode.
    • A PC that can communicate with the database node 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 section Configuring Backup Policies.
    • A PC that can communicate with the database node is available.
Procedure

Viewing the automatic backup data packages which are locally stored

  1. Use PuTTY to log in to the SMNALL-PS-NS-DB-MEM01 node.

    The default username is hermes, and the default password is Hermes@123.

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

    sudo su - root

    The default password of user root is Cloud12#$.

  3. Run the following command to check the database status:

    service had query

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

    Figure 3-29 Database status

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

    ll /opt/backup/DB

    Check whether the directory contains the latest backup files.

Viewing the automatic backup data packages which are stored on a third-party backup server

  1. In the address box of a browser, enter the IP address of the third-party backup server (FTP server) and press Enter.

    Login address: ftp://FTP_SERVER_IP

    Login account: FTP_SERVER_USER, password: FTP_SERVER_PASSWD

    NOTE:

    FTP_SERVER_IP indicates the IP address of the third-party backup server. FTP_SERVER_USER indicates the username for logging in to the third-party backup server. FTP_SERVER_PASSWD indicates the password for backing up data to the FTP server.

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

    Obtain the directory from the FTP_SERVER_FILEPATH value in Table 3-26.

    Check whether the directory contains the latest backup files.

Manually Backing Up Data

Context
Manually back up data on the active DMK node to ensure that services can be restored if any of the following failures occurs:
  • 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 the active and standby database nodes are faulty, and the node data is lost.
  • Data is corrupted due to misoperations.

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

Prerequisites
  • You have configured the backup file by following the steps provided in section Configuring Backup Policies.
  • You have obtained the IP addresses of the active and standby database nodes as well as the passwords of users root and hermes if the database is deployed in active/standby mode.
  • A PC that can communicate with the database node is available.
  • An application, such as PuTTY, which can be used for remote access across various platforms, is available.
  • The following conditions are met if data is to be backed up to a third-party backup server:
    • The third-party component JDK has been installed.
    • 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 section Configuring Backup Policies.
    • You have obtained the user root password of the third-party backup server.
    • The FTP user of the third-party backup server has the following rights: read, write, and delete a file, add permissions for a file, create, delete, and access a directory, and create a sub-directory under a directory.
Procedure
  1. Use PuTTY to log in to the SMNALL-PS-NS-DB-MEM01 node.

    The default username is hermes, and the default password is Hermes@123.

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

    sudo su - root

    The default password of user root is Cloud12#$.

  3. Run the following command to check the database status:

    service had query

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

    Figure 3-30 Database status

  4. Determine 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 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 the following information is displayed:

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

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

    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.

Translation
Download
Updated: 2019-06-14

Document ID: EDOC1100062366

Views: 744

Downloads: 9

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