本页内容
如何续订 CSO 组件的证书
您可以使用 manage_certificate.sh 脚本续订或查看 CSO 组件的证书。
实际输出可能与基于部署方案显示的示例输出不同。
-
以 root 用户身份登录到 startupserver1 VM。
-
导航到 startupserver1 VM 中的 CSO 目录。
例如:
root@startupserver1:~/# cd Contrail_Service_Orchestration_6.2.0 root@host:~/Contrail_Service_Orchestration_6.2.0#
-
运行 manage_certificate.sh 脚本以检查 CSO 组件的状态或续订证书。
root@startupserver1:~/Contrail_Service_Orchestration_6.2.0# ./manage_certificate.sh ************************************************************ This tool assists you to renew CSO components certificate ************************************************************ Certificate renew sequence need to be followed: Kubernetes -> Haproxy -> Elasticsearch 0: List all certificate expiry date 1: Schedule cron for email notification Following component's certificate can be renewed 2: Haproxy, Nginx, Rsyslog 3: Telemetry Agent Select a option (In Number) :
注意:要检查可用于 manage_certificate.sh 脚本的选项,请输入
manage_certificate.sh -h
或manage_certificate.sh --help
。root@startupserver1:~/Contrail_Service_Orchestration_6.2.0# ./manage_certificate.sh -h Usage: ./manage_certificate.sh -> to check/renew CSO components's certificate ./manage_certificate.sh [options] options: -c | --check to only check and list expiry dates of CSO components -n | --notify to list and send email notification with CSO components and its expiry dates --cron to schedule cron job -h | --help this help
-
您可以选择执行以下任一任务:
-
若要查看证书到期日期,请参阅 如何查看证书到期日期。
-
若要计划 cron 作业,请参阅 如何计划 cron 作业。
-
要续订组件的证书,请参阅 如何续订证书。
-
如何查看证书到期日期
若要列出所有证书及其到期日期,请在提示符下键入 0 ,然后按 Enter。您还可以使用 ./manage_certificate.sh -c 或 ./manage_certificate.sh --check查看相同的输出。
Select a option (In Number) : 0 INFO Fetching certificate details... +----------------+---------------------+----------------+-------------+ | Component Name | Expiry Date | Days to Expire | Status | +----------------+---------------------+----------------+-------------+ | Haproxy | 2022-08-24 09:58:20 | 240 | Not Expired | | Nginx | 2022-08-24 09:58:20 | 240 | Not Expired | | Rsyslog | 2022-08-24 09:58:20 | 240 | Not Expired | +----------------+---------------------+----------------+-------------+
如何安排 Cron 作业
要安排 cron 作业,请执行以下作:
如何续订证书
仅当证书的状态为“已过期”或“即将过期”时,才能续订证书。
您只能续订自签名证书。第三方证书无法续订。
Following component's certificate can be renewed 2: Haproxy, Nginx, Rsyslog 3: Telemetry Agent Select a option (In Number) :
系统会检查证书的状态:
- 如果状态为“已过期”或即将过期,则将启动证书续订过程。证书续订后,系统会进行运行状况检查。
注意:
续订 HA 代理证书时,将在 CSO 上预配的所有设备的遥测代理证书会自动续订。
如果 HA 代理证书已续订,并且由于失败而无法完成遥测代理续订,则可以单独续订遥测代理证书。运行 manage_certificate.sh 脚本并提供与遥测代理对应的编号(示例输出中的 3)以续订证书。
- 如果状态为“未过期”,则证书不会续订。
证书状态为“未过期”时的示例输出:
************************************************************ This tool assists you to renew CSO components certificate ************************************************************ Certificate renew sequence need to be followed: Kubernetes -> Haproxy -> Elasticsearch 0: List all certificate expiry date 1: Schedule cron for email notification Following component's certificate can be renewed 2: Haproxy, Nginx, Rsyslog 3: Telemetry Agent Select a option (In Number) : 2 INFO Started check and renew haproxy component's certificate at 2021-12-27 02:19:10.974535 ... INFO Checking haproxy certificate expiry date INFO Checking nginx certificate expiry date INFO Checking rsyslog certificate expiry date INFO Haproxy certificate is Not Expired INFO Nginx certificate is Not Expired INFO Rsyslog certificate is Not Expired INFO Certificate is not about to expire, So renewal is not required INFO Completed check and renew haproxy component's certificate at 2021-12-27 02:19:13.638765 . INFO Time taken to renew haproxy component's certificate : 0:00:02.664230