
# 配置云容灾网关
#### 操作场景
初次使用的云容灾网关及容灾机器，需要配置。
#### 前提条件
- 云容灾网关建议起始规格为8U16G，操作系统只支持Linux，建议使用Huawei Cloud EulerOS 2.0或欧拉2.9/2.10，或参考[支持的操作系统版本](https://support.huaweicloud.com/productdesc-sdrs/sdrs_pro_0007.html)。
- 云容灾网关服务器所在的区域、可用区、VPC 需要和生产站点服务器保持一致。
- 云容灾网关和代理客户端建议放在同一安全组内，安全组配置为仅允许安全组内弹性云服务器互通。
- 由于安全要求，配置网关时使用的AK/SK账号需归属于当前使用BRS服务的账号，否则将无法创建保护实例。
- 若24.6.0及之前的旧版本要实现自动配置容灾网关功能（即在反向重保护及重保护过程不再需要配置容灾站点和生产站点服务器），需要将网关及生产站点服务器的BRS软件升级至24.9.0及之后版本，并按照如下"24.9.0及之后版本操作步骤"重新配置网关。
 
#### 24.6.0及之前版本操作步骤
以下操作以配置"24.6.0"版本的容灾网关"***sdrs_linux_amd64_24.6.0.20240627203949.tar.gz***"为例。
1. 在**/opt/cloud/sdrs** 目录下，执行以下命令，配置云容灾网关。
   
   **sh register_gateway.sh**
   图1执行脚本   
   ![](https://support.huaweicloud.com/usermanual-sdrs/zh-cn_image_0000002081132065.png)
   1. 跨AZ场景配置参数：
      图2跨AZ场景脚本执行参数示例   
      ![](https://support.huaweicloud.com/usermanual-sdrs/zh-cn_image_0000002081131661.png)
      表1跨AZ场景参数说明 
      | 参数                   | 参数说明           | 获取方法                                                                                                                                                                                                                                                                                                                                                                                                                   | 参数示例                                     |
      |:---|:---|:---|:---|
      | DR Scene             | 复制场景           | - **0 -** IDC容灾到华为云  - **1 -**华为云跨AZ容灾  - 2 - 华为云跨Region容灾  - 3 - IDC-VMware容灾到华为云   | 1                                        |
      | source platform type | 生产云平台类型        | - **0 -** 华为云公有云  - **1 -**华为云私有云  - 2 - VMware平台                                                                                                             | 0                                        |
      | source project id    | 生产区域项目ID       | 在生产区域控制台"我的凭证 \> API凭证"页面，查看"项目ID"。                                                                                                                                                                                                                                                                                                                                                                                    | 51af777371904892a49a0c3e3e53de44         |
      | source region code   | 生产区域的Region ID | 通过[BRS服务终端节点](https://console.huaweicloud.com/apiexplorer/#/endpoint/SDRS)页面查询。                                                                                                                                                                                                                                                                                                                                        | cn-east-2                                |
      | source ecs endpoint  | 生产区域ECS终端节点    | 通过[ECS服务终端节点](https://console.huaweicloud.com/apiexplorer/#/endpoint/ECS)页面查询。                                                                                                                                                                                                                                                                                                                                         | -                                        |
      | source evs endpoint  | 生产区域EVS终端节点    | 通过[EVS服务终端节点](https://console.huaweicloud.com/apiexplorer/#/endpoint/EVS)页面查询。                                                                                                                                                                                                                                                                                                                                         | -                                        |
      | source iam ak        | 生产区域访问密钥ID     | 获取方式见[如何获取访问密钥AK/SK](https://support.huaweicloud.com/iam_faq/iam_01_0618.html)。                                                                                                                                                                                                                                                                                                                                        | RZSAMHULWKKE71N0XHUT                     |
      | source iam sk        | 生产区域访问密钥       | 获取方式见[如何获取访问密钥AK/SK](https://support.huaweicloud.com/iam_faq/iam_01_0618.html)。                                                                                                                                                                                                                                                                                                                                        | K7bXplAT0pEpy4SAiN2fHUwEtxvgmK3IqyhqnMTA |
      | target sdrs endpoint | 容灾区域BRS服务终端节点  | 通过[BRS服务终端节点](https://developer.huaweicloud.com/endpoint?SDRS)页面查询。                                                                                                                                                                                                                                                                                                                                                    | sdrs.cn-east-2.myhuaweicloud.com         |
         
      
   
   2. 跨region场景配置参数：
      图3跨Region场景脚本执行参数示例   
      ![](https://support.huaweicloud.com/usermanual-sdrs/zh-cn_image_0000002081131713.png)
      表2跨region场景参数说明 
      | 参数                   | 参数说明           | 获取方法                                                                                                                                                                                                                                                                                                                                                                                                                    | 参数示例                             |
      |:---|:---|:---|:---|
      | DR Scene             | 复制场景           | - **0 -** IDC容灾到华为云  - **1 -**华为云跨AZ容灾  - 2 - 华为云跨Region容灾  - 3 - IDC-VMware容灾到华为云   | 2                                |
      | source platform type | 生产区域云平台类型      | - **0 -** 华为云公有云  - **1 -**华为云私有云  - 2 - VMware平台                                                                                                            | 0                                |
      | source project id    | 生产区域项目ID       | 在控制台"我的凭证 \> API凭证"页面，查看"项目ID"。                                                                                                                                                                                                                                                                                                                                                                                         | 51af777371904892a49a0c3e3e53de44 |
      | source region code   | 当前区域的Region ID | 通过[BRS服务终端节点](https://console.huaweicloud.com/apiexplorer/#/endpoint/SDRS)页面查询。                                                                                                                                                                                                                                                                                                                                         | cn-east-2                        |
      | source ecs endpoint  | 生产区域ECS终端节点    | 通过[ECS服务终端节点](https://console.huaweicloud.com/apiexplorer/#/endpoint/ECS)页面查询。                                                                                                                                                                                                                                                                                                                                          | -                                |
      | source evs endpoint  | 生产区域EVS终端节点    | 通过[EVS服务终端节点](https://console.huaweicloud.com/apiexplorer/#/endpoint/EVS)页面查询。                                                                                                                                                                                                                                                                                                                                          | -                                |
      | source iam ak        | 生产区域访问密钥ID     | 获取方式见[如何获取访问密钥AK/SK](https://support.huaweicloud.com/iam_faq/iam_01_0618.html)。                                                                                                                                                                                                                                                                                                                                         | -                                |
      | source iam sk        | 生产区域访问密钥       | 获取方式见[如何获取访问密钥AK/SK](https://support.huaweicloud.com/iam_faq/iam_01_0618.html)。                                                                                                                                                                                                                                                                                                                                         | -                                |
      | target sdrs endpoint | 容灾区域BRS服务终端节点  | 通过[BRS服务终端节点](https://developer.huaweicloud.com/endpoint?SDRS)页面查询。                                                                                                                                                                                                                                                                                                                                                     | sdrs.cn-east-2.myhuaweicloud.com |
      | target platform type | 容灾区域云平台类型      | - **0 -** 华为云公有云  - **1 -**华为云私有云                                                                                                                                                                                                      | 0                                |
      | target project id    | 容灾区域项目ID       | 在控制台"我的凭证 \> API凭证"页面，查看"项目ID"。                                                                                                                                                                                                                                                                                                                                                                                         | 51af777371904892a49a0c3e3e53de44 |
      | target iam ak        | 容灾区域访问密钥ID     | 获取方式见[如何获取访问密钥AK/SK](https://support.huaweicloud.com/iam_faq/iam_01_0618.html)。                                                                                                                                                                                                                                                                                                                                         | -                                |
      | target iam sk        | 容灾区域访问密钥       | 获取方式见[如何获取访问密钥AK/SK](https://support.huaweicloud.com/iam_faq/iam_01_0618.html)。                                                                                                                                                                                                                                                                                                                                         | -                                |
         
      
   
   
   
   
 
#### 24.9.0及之后版本操作步骤
以下操作以配置"24.9.0"版本的容灾网关"***sdrs_xxxx_24.9.0.xxxx.tar.gz***"为例。
1. 在**/opt/cloud/sdrs** 目录下，执行以下命令，配置云容灾网关。
   
   **sh register_gateway.sh**
   图4执行脚本   
   ![](https://support.huaweicloud.com/usermanual-sdrs/zh-cn_image_0000002006013778.png)
   1. 跨AZ场景配置参数：
      图5跨AZ场景脚本执行参数示例   
      ![](https://support.huaweicloud.com/usermanual-sdrs/zh-cn_image_0000002042174749.png)
      表3跨AZ场景参数说明 
      | 参数                   | 参数说明          | 获取方法                                                                                                                                                                                                                                                                                                                                                                                                            | 参数示例                                     |
      |:---|:---|:---|:---|
      | DR Scene             | 复制场景          | - **0 -** IDC容灾到华为云  - **1 -**华为云跨AZ容灾  - 2 - 华为云跨Region容灾  - 3 - IDC-VMware容灾到华为云   | 1                                        |
      | source platform type | 生产云平台类型       | - **0 -** 华为云公有云  - **1 -**华为云私有云                                                                                                                                                                                             | 0                                        |
      | source project id    | 生产区域项目ID      | 在控制台"我的凭证 \> API凭证"页面，查看"项目ID"。                                                                                                                                                                                                                                                                                                                                                                                 | 51af777371904892a49a0c3e3e53de44         |
      | source ecs endpoint  | 生产区域ECS终端节点   | 通过[ECS服务终端节点](https://developer.huaweicloud.com/endpoint?ECS)页面查询。                                                                                                                                                                                                                                                                                                                                              | -                                        |
      | source evs endpoint  | 生产区域EVS终端节点   | 通过[EVS服务终端节点](https://developer.huaweicloud.com/endpoint?EVS)页面查询。                                                                                                                                                                                                                                                                                                                                              | -                                        |
      | source iam ak        | 生产区域访问密钥ID    | 获取方式见[如何获取访问密钥AK/SK](https://support.huaweicloud.com/iam_faq/iam_01_0618.html)。                                                                                                                                                                                                                                                                                                                                 | RZSAMHULWKKE71N0XHUT                     |
      | source iam sk        | 生产区域访问密钥      | 获取方式见[如何获取访问密钥AK/SK](https://support.huaweicloud.com/iam_faq/iam_01_0618.html)。                                                                                                                                                                                                                                                                                                                                 | K7bXplAT0pEpy4SAiN2fHUwEtxvgmK3IqyhqnMTA |
      | target sdrs endpoint | 容灾区域BRS服务终端节点 | 通过[BRS服务终端节点](https://developer.huaweicloud.com/endpoint?SDRS)页面查询。                                                                                                                                                                                                                                                                                                                                             | sdrs.cn-east-2.myhuaweicloud.com         |
         
      
   
   2. 跨region场景配置参数：
      图6跨Region场景脚本执行参数示例   
      ![](https://support.huaweicloud.com/usermanual-sdrs/zh-cn_image_0000002006134996.png)
      表4跨Region参数说明 
      | 参数                   | 参数说明          | 获取方法                                                                                                                                                                                                                                                                                                                                                                                                                  | 参数示例                             |
      |:---|:---|:---|:---|
      | DR Scene             | 复制场景          | - **0 -** IDC容灾到华为云  - **1 -**华为云跨AZ容灾  - 2 - 华为云跨Region容灾  - 3 - IDC-VMware容灾到华为云   | 2                                |
      | source platform type | 生产区域云平台类型     | - **0 -** 华为云公有云  - **1 -**华为云私有云                                                                                                                                                                                                     | 0                                |
      | source project id    | 生产区域项目ID      | 在生产区域控制台"我的凭证 \> API凭证"页面，查看"项目ID"。                                                                                                                                                                                                                                                                                                                                                                                   | 51af777371904892a49a0c3e3e53de44 |
      | source ecs endpoint  | 生产区域ECS终端节点   | 通过[ECS服务终端节点](https://developer.huaweicloud.com/endpoint?ECS)页面查询。                                                                                                                                                                                                                                                                                                                                                    | -                                |
      | source evs endpoint  | 生产区域EVS终端节点   | 通过[EVS服务终端节点](https://developer.huaweicloud.com/endpoint?EVS)页面查询。                                                                                                                                                                                                                                                                                                                                                    | -                                |
      | source iam ak        | 生产区域访问密钥ID    | 获取方式见[如何获取访问密钥AK/SK](https://support.huaweicloud.com/iam_faq/iam_01_0618.html)。                                                                                                                                                                                                                                                                                                                                       | -                                |
      | source iam sk        | 生产区域访问密钥      | 获取方式见[如何获取访问密钥AK/SK](https://support.huaweicloud.com/iam_faq/iam_01_0618.html)。                                                                                                                                                                                                                                                                                                                                       | -                                |
      | target sdrs endpoint | 容灾区域BRS服务终端节点 | 通过[BRS服务终端节点](https://developer.huaweicloud.com/endpoint?SDRS)页面查询。                                                                                                                                                                                                                                                                                                                                                   | sdrs.cn-east-2.myhuaweicloud.com |
      | target platform type | 容灾区域云平台类型     | - **0 -** 华为云公有云  - **1 -**华为云私有云                                                                                                                                                                                                     | 0                                |
      | target project id    | 容灾区域项目ID      | 在容灾区域控制台"我的凭证 \> API凭证"页面，查看"项目ID"。                                                                                                                                                                                                                                                                                                                                                                                   | 51af777371904892a49a0c3e3e53de44 |
      | target ecs endpoint  | 容灾区域ECS终端节点   | 通过[ECS服务终端节点](https://developer.huaweicloud.com/endpoint?ECS)页面查询。                                                                                                                                                                                                                                                                                                                                                    | -                                |
      | target evs endpoint  | 容灾区域EVS终端节点   | 通过[EVS服务终端节点](https://developer.huaweicloud.com/endpoint?EVS)页面查询。                                                                                                                                                                                                                                                                                                                                                    | -                                |
      | target iam ak        | 容灾区域访问密钥ID    | 获取方式见[如何获取访问密钥AK/SK](https://support.huaweicloud.com/iam_faq/iam_01_0618.html)。                                                                                                                                                                                                                                                                                                                                       | -                                |
      | target iam sk        | 容灾区域访问密钥      | 获取方式见[如何获取访问密钥AK/SK](https://support.huaweicloud.com/iam_faq/iam_01_0618.html)。                                                                                                                                                                                                                                                                                                                                       | -                                |
         
      
   
   
   
   
 
