All Products
Search
Document Center

Add a backup gateway

Last Updated: May 06, 2020

DBS provides a backup gateway to help you back up an on-premises database to OSS. You can download the installation package from the DBS console and install the backup gateway on your database server.

Concept

The backup gateway is the client of DBS. It is an agent installed on your database server to help you back up on-premises databases to OSS.

Features

Feature Description Supported
Physical backup 1. Basic concept: Physical backup refers to backing up database files in the operating system.
2. Operating conditions: Physical backup tasks must be scheduled and run on your database server. You must install a backup gateway. The backup gateway will start a process on your database server to receive tasks created in the DBS console or scheduled based on the backup schedule configuration, implementing database backup and restore.
Yes
Backup over a private network 1. Basic concept: Some databases are deployed on private networks, for example, in on-premises IDCs or on private networks provided by third-party cloud service providers. DBS cannot directly access and back up these databases.
2. Operating conditions: To back up these databases, you must install a backup gateway. The backup gateway will proactively access the DBS server and OSS to enable DBS to back up these databases to OSS.
Supported

Install a backup gateway

You can install a backup gateway on your database server without purchasing a DBS instance. However, the backup gateway cannot run backup tasks without a DBS instance. After purchasing a DBS instance, you can directly select the installed backup gateway when configuring a backup schedule. To install a backup gateway, follow these steps:

  1. Go to the Backup Gateways page
  2. Obtain the command for installing the backup gateway
  3. Install the backup gateway
  4. Check the installation result

Linux

1. Go to the Backup Gateways page

Log on to the DBS console. In the left-side navigation pane, click Backup Gateways.

2. Obtain the command for installing the backup gateway

Click Install Backup Gateway to obtain the command for installing the backup gateway. You can run the command on your database server. Then, the installation package will be automatically downloaded, and the backup gateway will be automatically installed and run on your database server. You can run the command on multiple database servers to install multiple backup gateways at the same time.

3. Install the backup gateway

Copy the command for installing the backup gateway and run the command on your database server.

(1) Install the JRE

  • Running environment of the backup gateway: Java Runtime Environment (JRE) 1.8 or later. If the JRE is already installed, skip this step.
  • Command for installing the JRE: yum install java-1.8.0-openjdk -y
  • Command for installing the JRE on Ubuntu: apt-get install openjdk-8-jre

(2) Obtain the AccessKey

You must enter the AccessKey while installing the backup gateway.

The AccessKey must have the read and write permissions on OSS.

(3) Install the backup gateway

Copy the command for installing the backup gateway and run the command on your database server.

4. Check the installation result

Log on to the DBS console. In the left-side navigation pane, click Backup Gateways. Then, click Refresh to view the backup gateway that you just installed.

Manage a backup gateway

  • Start a backup gateway

/usr/local/aliyun/dbs_agent/bin/aliyun-dbs-agent.sh start

  • Stop a backup gateway

/usr/local/aliyun/dbs_agent/bin/aliyun-dbs-agent.sh stop

  • Restart a backup gateway

/usr/local/aliyun/dbs_agent/bin/aliyun-dbs-agent.sh restart

Windows

1. Go to the Backup Gateways page

Log on to the DBS console. In the left-side navigation pane, click Backup Gateways.

2. Obtain the command for installing the backup gateway

Click Install Backup Gateway to obtain the command for installing the backup gateway.

3. Install the backup gateway

Method 1: One-click installation

Run the command for installing the backup gateway in the Run window. It takes several minutes to download the installation package and install the backup gateway.

The backup gateway is automatically upgraded. The version number changes accordingly. You can get the latest version number in the DBS console. The following is an example of the command for installing the backup gateway:

  1. cmd /c bitsadmin /transfer 1 /priority foreground http://aliyun-dbs.oss-cn-hangzhou.aliyuncs.com/installer/xx.xx.xx/aliyunDBSAgentInstaller-xx.xx.xx.jar "%USERPROFILE%\dbs.jar" && java -Dregion=cn-hangzhou -jar "%USERPROFILE%\dbs.jar"

Method 2: Manual installation

If one-click installation fails, obtain the download URL of the installation package from the command for installing the backup gateway. Enter the download URL in the address bar of a browser and press Enter. Download the installation package and install the backup gateway on your Windows server.

(1) Install the JRE

  • Running environment of the backup gateway: JRE 1.8 or later. If the JRE is already installed, skip this step.

You can download JRE package from Java official website.

(2) Obtain the AccessKey

You must enter the AccessKey while installing the backup gateway.

The AccessKey must have the read and write permissions on OSS.

The AccessKey is stored in plain text in C:\Program Files\aliyun\dbs_agent\config\dbs-agent.conf.

(3) Install the backup gateway

Follow the installation wizard to install the backup gateway.

4. Manage the backup gateway service

After the installation is successful, run services.msc in the Run window to open the Services console. You can view, enable, or disable the AliyunDBSAgent service.

5. Configure the backup account

The default account for starting the AliyunDBSAgent service, that is, the backup account, is NT AUTHORITY\SYSTEM. To successfully back up and restore an SQL Server database, make sure that the backup account has the sysadmin permissions.

  • SQL
  1. ALTER SERVER ROLE [sysadmin] ADD MEMBER [NT AUTHORITY\SYSTEM]
  2. GO
  • GUI

If the account for starting the AliyunDBSAgent service does not have the sysadmin permissions, you must reconfigure the AliyunDBSAgent service in the Services console, specify an account with the preceding permissions on the Log On tab, and then restart the service.

6. Check the installation result

Log on to the DBS console. In the left-side navigation pane, click Backup Gateways. Then, click Refresh to view the backup gateway that you just installed. You can also check whether the service is successfully started on the Windows server.

FAQ

Why does the connection test fail?

The backup account does not have the required permissions.

The default account for starting the AliyunDBSAgent service, that is, the backup account, is NT AUTHORITY\SYSTEM. To successfully back up and restore an SQL Server database, make sure that the backup account has the sysadmin permissions.

  • SQL
  1. ALTER SERVER ROLE [sysadmin] ADD MEMBER [NT AUTHORITY\SYSTEM]
  2. GO
  • GUI

If the account for starting the AliyunDBSAgent service does not have the sysadmin permissions, you must reconfigure the AliyunDBSAgent service in the Services console, specify an account with the preceding permissions on the Log On tab, and then restart the service.

The version of the backup gateway is too old.

Scheme: Install the latest backup gateway.

Where is the installation directory of the backup gateway?

The default installation directory of AliyunDBSAgent is C:\Program Files\aliyun\dbs_agent, containing the following folders:

  • bin: stores startup scripts.
  • config: stores configuration files, including AliyunDBSAgent configuration files and output log configuration files.
  • framework: stores the main framework program files.
  • plugin: stores plug-in files.
  • logs: stores operational logs of programs.
  • metastore: stores temporary metadata information.
  • Uninstaller: stores the uninstaller.