
# 配置容灾站点服务器
#### 操作场景
通过管理控制台进行反向重保护操作前，需要先在待反向重保护的保护实例中的容灾站点服务器上进行配置，配置完成后才能执行反向重保护操作。
![](https://support.huaweicloud.com/usermanual-sdrs/public_sys-resources/note_3.0-zh-cn.png)
24.6.0及之前版本需要执行该配置，24.9.0及之后版本支持自动配置容灾网关功能，无需执行该配置。
#### 操作步骤
1. 登录待配置的容灾站点服务器
2. 运行以下脚本进行网关配置 
   - Linux服务器： **sh /opt/cloud/sdrs/register_gateway.sh**
     
   
   - Windows服务器： 进入**C:\\cloud\\sdrs** 目录，双击运行**register_gateway.bat**脚本
     图1windows配置脚本   
     ![](https://support.huaweicloud.com/usermanual-sdrs/zh-cn_image_0000001868348754.png) 
   
   
   
   
3. 脚本参数填写说明： 
   1. **跨AZ场景：**
      图2linux跨AZ场景配置示例   
      ![](https://support.huaweicloud.com/usermanual-sdrs/zh-cn_image_0000001914348453.png)
      图3windows跨AZ场景配置示例   
      ![](https://support.huaweicloud.com/usermanual-sdrs/zh-cn_image_0000001914228121.png)
      命令中使用到的变量参数说明如[表1]所示。
       表1跨AZ场景参数说明 
      | 站点      | 参数               | 参数说明             | 获取方法                                                                                                                                                                                                                                                                                   | 参数示例                                     |
      |:---|:---|:---|:---|:---|
      | 复制场景    | replicationScene | 复制场景(目前支持三种复制场景) | - **0-** IDC容灾到华为云  - **1-**华为云跨AZ容灾  - **2-**华为云跨Region容灾   | 1                                        |
      | 华为云容灾站点 | platform_type    | 云平台类型            | - 0 - 华为云公有云  - 1 - 华为云私有云                                                                                            | 0                                        |
      | 华为云容灾站点 | sourceProjectId  | 项目ID             | 在控制台"我的凭证 \> API凭证"页面，查看"项目ID"。                                                                                                                                                                                                                                                        | 51af777371904892a49a0c3e3e53de44         |
      | 华为云容灾站点 | sourceEcs        | ECS终端节点          | 通过[ECS服务终端节点](https://developer.huaweicloud.com/endpoint?ECS)页面查询。                                                                                                                                                                                                                     | -                                        |
      | 华为云容灾站点 | sourceEvs        | EVS终端节点          | 通过[EVS服务终端节点](https://developer.huaweicloud.com/endpoint?EVS)页面查询。                                                                                                                                                                                                                     | -                                        |
      | 华为云容灾站点 | sourceIamAk      | 访问密钥ID           | 获取方式见[如何获取访问密钥AK/SK](https://support.huaweicloud.com/iam_faq/iam_01_0618.html)。                                                                                                                                                                                                        | -                                        |
      | 华为云容灾站点 | sourceIamSk      | 访问密钥             | 获取方式见[如何获取访问密钥AK/SK](https://support.huaweicloud.com/iam_faq/iam_01_0618.html)。                                                                                                                                                                                                        | -                                        |
      | 华为云容灾站点 | targetProjectId  | 项目ID             | 在控制台"我的凭证 \> API凭证"页面，查看"项目ID"。                                                                                                                                                                                                                                                        | 0605767cb280d5762fd6c0133d6bea3f         |
      | 华为云容灾站点 | targetSdrs       | BRS服务终端节点        | 通过[BRS服务终端节点](https://developer.huaweicloud.com/endpoint?SDRS)页面查询。                                                                                                                                                                                                                    | sdrs.cn-east-2.myhuaweicloud.com         |
      | 华为云容灾站点 | targetIamAk      | 访问密钥ID           | 获取方式见[如何获取访问密钥AK/SK](https://support.huaweicloud.com/iam_faq/iam_01_0618.html)。                                                                                                                                                                                                        | RZSAMHULWKKE71N0XHUT                     |
      | 华为云容灾站点 | targetIamSk      | 访问密钥             | 获取方式见[如何获取访问密钥AK/SK](https://support.huaweicloud.com/iam_faq/iam_01_0618.html)。                                                                                                                                                                                                        | K7bXplAT0pEpy4SAiN2fHUwEtxvgmK3IqyhqnMTA |
         
      
   
   2. 跨Region场景：
      表2跨region场景参数说明 
      | 参数                          | 参数说明                 | 获取方法                                                                                                                                                                                                                                                                                  | 参数示例                             |
      |:---|:---|:---|:---|
      | DR Scene                    | 复制场景                 | - **0 -** IDC容灾到华为云  - **1-**华为云跨AZ容灾  - **2-**华为云跨Region容灾   | 2                                |
      | source/target platform type | 容灾云平台类型              | - 0 - 华为云公有云  - 1 - 华为云私有云                                                                                               | 0                                |
      | source/target project id    | 容灾站点服务器所在区域项目ID      | 在控制台"我的凭证 \> API凭证"页面，查看"项目ID"。                                                                                                                                                                                                                                                       | 51af777371904892a49a0c3e3e53de44 |
      | source region code          | 目的区域的Region ID       | 通过[BRS服务终端节点](https://developer.huaweicloud.com/endpoint?SDRS)页面查询。                                                                                                                                                                                                                   | sdrs.cn-east-2.myhuaweicloud.com |
      | source ecs endpoint         | 容灾站点服务器所在区域ECS终端节点   | 通过[ECS服务终端节点](https://developer.huaweicloud.com/endpoint?ECS)页面查询。                                                                                                                                                                                                                    | -                                |
      | source evs endpoint         | 容灾站点服务器所在区域EVS终端节点   | 通过[EVS服务终端节点](https://developer.huaweicloud.com/endpoint?EVS)页面查询。                                                                                                                                                                                                                    | -                                |
      | source/target iam ak        | 容灾站点服务器所在区域的访问密钥ID   | 获取方式见[如何获取访问密钥AK/SK](https://support.huaweicloud.com/iam_faq/iam_01_0618.html)。                                                                                                                                                                                                       | -                                |
      | source/target 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 |
         
      
   
   
   
   
4. 配置华为云容灾站点服务器代理客户端的网关地址。 
   1. Linux容灾机器： **su** **- service** **-c** "**/opt/cloud/sdrs/hostagent/bin/agent_config.sh --drm-ip=127.0.0.1** **--ha-ip=127.0.0.1**"
      
   
   2. Windows容灾机器： 打开cmd窗口执行以下命令：
      **C:\\cloud\\sdrs\\hostagent\\bin\\agent_config.bat --drm-ip=127.0.0.1 --ha-ip=127.0.0.1**
      ![](https://support.huaweicloud.com/usermanual-sdrs/zh-cn_image_0000001868188914.png)
      
   
   
   
   
 
