

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 与 AWS CloudHSM 集群的连接中断
<a name="troubleshooting-lost-connection"></a>

[配置 AWS CloudHSM 客户端](cmu-install-and-configure-client-linux.md#cmu-edit-client-configuration)时，您提供了集群中第一个 HSM 的 IP 地址。此 IP 地址保存在 AWS CloudHSM 客户端的配置文件中。当客户端启动时，它会尝试连接到此 IP 地址。如果无法执行此操作（例如因为 HSM 失败或您已将其删除），您可能会看到与以下内容类似的错误：

```
LIQUIDSECURITY: Daemon socket connection error
```

```
LIQUIDSECURITY: Invalid Operation
```

要解决这些错误，请使用群集中可访问的活动 HSM 的 IP 地址更新配置文件。

**更新 AWS CloudHSM 客户机的配置文件**

1. 使用以下方式之一查找群集中活动 HSM 的 IP 地址。
   + 在[AWS CloudHSM 控制台](https://console.aws.amazon.com/cloudhsm/home)中查看集群详细信息页面上的**HSMs**选项卡。
   + 使用 AWS Command Line Interface (AWS CLI) 发出[https://docs.aws.amazon.com/cli/latest/reference/cloudhsmv2/describe-clusters.html](https://docs.aws.amazon.com/cli/latest/reference/cloudhsmv2/describe-clusters.html)命令。

   在后续步骤中，您将需要此 IP 地址。

1. 使用以下命令停止客户端。

------
#### [ Amazon Linux ]

   ```
   $ sudo stop cloudhsm-client
   ```

------
#### [ Amazon Linux 2 ]

   ```
   $ sudo service cloudhsm-client stop
   ```

------
#### [ CentOS 7 ]

   ```
   $ sudo service cloudhsm-client stop
   ```

------
#### [ CentOS 8 ]

   ```
   $ sudo service cloudhsm-client stop
   ```

------
#### [ RHEL 7 ]

   ```
   $ sudo service cloudhsm-client stop
   ```

------
#### [ RHEL 8 ]

   ```
   $ sudo service cloudhsm-client stop
   ```

------
#### [ Ubuntu 16.04 LTS ]

   ```
   $ sudo service cloudhsm-client stop
   ```

------
#### [ Ubuntu 18.04 LTS ]

   ```
   $ sudo service cloudhsm-client stop
   ```

------
#### [ Windows ]
   + 对于 Windows 客户端 1.1.2 以上版本：

     ```
     C:\Program Files\Amazon\CloudHSM>net.exe stop AWSCloudHSMClient
     ```
   + 对于 Windows 客户端 1.1.1 及更低版本：

     在启动 AWS CloudHSM 客户端的命令窗口中使用 **C **trl** \$1 C**。

------

1. 使用以下命令可更新客户端的配置文件，并提供您在上一步中找到的 IP 地址。

   ```
   $ sudo /opt/cloudhsm/bin/configure -a <IP address>
   ```

1. 使用以下命令启动 客户端。

------
#### [ Amazon Linux ]

   ```
   $ sudo start cloudhsm-client
   ```

------
#### [ Amazon Linux 2 ]

   ```
   $ sudo service cloudhsm-client start
   ```

------
#### [ CentOS 7 ]

   ```
   $ sudo service cloudhsm-client start
   ```

------
#### [ CentOS 8 ]

   ```
   $ sudo service cloudhsm-client start
   ```

------
#### [ RHEL 7 ]

   ```
   $ sudo service cloudhsm-client start
   ```

------
#### [ RHEL 8 ]

   ```
   $ sudo service cloudhsm-client start
   ```

------
#### [ Ubuntu 16.04 LTS ]

   ```
   $ sudo service cloudhsm-client start
   ```

------
#### [ Ubuntu 18.04 LTS ]

   ```
   $ sudo service cloudhsm-client start
   ```

------
#### [ Windows ]
   + 对于 Windows 客户端 1.1.2 以上版本：

     ```
     C:\Program Files\Amazon\CloudHSM>net.exe start AWSCloudHSMClient
     ```
   + 对于 Windows 客户端 1.1.1 及更低版本：

     ```
     C:\Program Files\Amazon\CloudHSM>start "cloudhsm_client" cloudhsm_client.exe C:\ProgramData\Amazon\CloudHSM\data\cloudhsm_client.cfg
     ```

------