
# 还原DBService HA模块的SSL配置
#### 操作场景
本任务将对安装DBService的集群进行还原DBService服务HA模块SSL的操作。
#### 前提条件
DBService服务HA模块已开启SSL配置。
![](https://support.huaweicloud.com/cmpntguide-lts-mrs/public_sys-resources/note_3.0-zh-cn.png)
检查DBService服务HA模块是否开启SSL配置：
查看"$BIGDATA_HOME/FusionInsight_BASE_*x.x.x*/install/FusionInsight-dbservice-2.7.0/ha/module/hacom/conf/hacom.xml"，如果包含"\<hadataprotocol value="ssl"\>\</hadataprotocol\>"，则已开启SSL。
#### 操作步骤
1. 以**omm**用户登录到需要还原的DBService节点。
2. 执行以下命令恢复DBService的"hacom_local.xml"配置文件： 
   **cd $BIGDATA_HOME/FusionInsight_BASE_** *x.x.x* **/install/FusionInsight-dbservice-2.7.0/ha/local/hacom/conf/**
   **cp** **hacom_local.xml** **$BIGDATA_HOME/tmp/**
   **cat** **hacom_local.xml** **\| grep "ssl\>" -n \| cut -d':' -f1 \| xargs \| sed 's/ /,/g' \|xargs -n 1 -i sed -i '{}d' hacom_local.xml**
   
   
3. 依次执行如下命令恢复DBService的"hacom.xml"配置文件： 
   **cd $BIGDATA_HOME/FusionInsight_BASE_** *x.x.x* **/install/FusionInsight-dbservice-2.7.0/ha/module/hacom/conf/**
   **cp** **hacom.xml** **$BIGDATA_HOME/tmp/**
   **sed -i 's#\<hadataprotocol.\*#\<hadataprotocol value="tcp"/\>#g' hacom.xml**
   **sed -i 's#\<rpcsupportssl.\*#\<rpcsupportssl value="true"/\>#g' hacom.xml**
   ![](https://support.huaweicloud.com/cmpntguide-lts-mrs/public_sys-resources/note_3.0-zh-cn.png)
   "$BIGDATA_HOME/FusionInsight_BASE_*x.x.x*/install/FusionInsight-dbservice-2.7.0/"为DBService工作区的安装目录，请按照实际升级环境进行修改。
   
   
4. 进入"$BIGDATA_HOME/FusionInsight_BASE_*x.x.x* /install/FusionInsight-dbservice-2.7.0/ha/module/hacom/script/"目录，执行以下命令重启HA：
   
   **./stop_ha.sh**
   **./start_ha.sh**
   
   
5. 执行以下命令获取HA进程的"pid"： 
   **ps -ef \|grep "ha.bin" \|grep DBSERVICE**
   
   
6. 执行以下命令，查看协议是否全部变更为TCP： 
   **netstat -nap \| grep** *pid* **\|** **grep -v unix**
   - 是，结束操作。
   
   - 否，请联系运维人员。
   
   
   ```
   [omm@host03]\>netstat -nap | grep 49989
   (Not all processes could be identified, non-owned process info 
    will not be shown, you would have to be root to see it all.) 
   tcp        0      0 127.0.0.1:20054         0.0.0.0:*               LISTEN      49989/ha.bin         
   tcp        0      0 10.10.10.10:20052       0.0.0.0:*                           49989/ha.bin         
   tcp       0      0 10.10.10.10:20053       0.0.0.0:*                           49989/ha.bin
   ```
   
   
 
