可能的问题是CloudEndure Manger服务或CloudEndure DR复制实例故障。事实上,如果应用程序是托管在Amazon EC2实例上的,则您可以使用CloudWatch创建一个基于Amazon CloudWatch Events的调度程序,这样可以监视CloudEndure Manger服务和CloudEndure DR复制实例的运行状况。如果监视到任何故障,则可以使用AWS Systems Manager Automation文档的CloudEndure-recover-from-service-failure脚本重新启动CloudEndure Manger服务和CloudEndure DR复制实例。
以下示例代码演示如何在Amazon EC2实例上使用CloudWatch Events处理CloudEndure Manger服务和CloudEndure DR复制实例的故障检测和自动恢复:
{
"source": [ "aws.ec2" ],
"detail-type": [ "EC2 Instance State-change Notification" ],
"detail": {
"state": [ "stopped" ]
},
"resources": [ "arn:aws:ec2:us-east-1:123456789012:instance/i-01234567890abcdef" ],
"action": [ "aws:ssm:send-command" ],
"parameters": {
"DocumentName": [ "AWS-AutomationCloudEndure-recover-from-service-failure" ],
"InstanceIds": [ "i-01234567890abcdef" ]
}
}
在此示例中,CloudWatch Events会检测CloudEndure Manger服务和CloudEndure DR复制实例的状态变化,并在检测到失败时使用AWS Systems Manager Automation文档自动将服务和实例重新启动。此文档是根据CloudEndure官方提供的脚本创建的,可确保您正确地将云复原和镜像更改应用于CloudEndure复原实例。