EC2 实例的 AWS 应用程序一致性快照
AWS application consistent snapshots of EC2 instances
我目前正在设置一个小型 Lambda 来为我们的 EC2 实例的所有重要卷拍摄快照。为了保证应用程序的一致性,我需要在实例内部触发操作:一个是在快照之前停止应用程序,另一个是在快照完成后再次唤醒它。到目前为止,我不知道该怎么做。
我考虑过使用 SNS 或 SQS 来通知实例快照的启动和停止,但这有几个问题:
- 我需要在实例中安装(和开发)自定义侦听器。
- 如果 quiescing/wake-up 完成,我不会得到反馈。
所以这是我的问题:如何从 Lambda 触发实例内的操作?
但也许我是从错误的方向来处理这个问题的。真的没有简单的备份方案吗?我知道 azure 有一个基于快照的备份服务,可以进行应用程序一致性备份。我是不是错过了等效的 AWS 服务?
编辑 1:
好的,看来 AWS Systems Manager 的功能 'Run Command' 是我真正需要的。它允许我在 EC2 实例中 运行 脚本、Ansible 剧本等。当我找到可行的解决方案后,我将 post 执行必要的步骤。
您可以按需触发 Lambda 函数:
Using AWS Lambda with Amazon API Gateway (On-Demand Over HTTPS)
You can invoke AWS Lambda functions over HTTPS. You can do this by
defining a custom REST API and endpoint using Amazon API Gateway, and
then mapping individual methods, such as GET and PUT, to specific
Lambda functions. Alternatively, you could add a special method named
ANY to map all supported methods (GET, POST, PATCH, DELETE) to your
Lambda function. When you send an HTTPS request to the API endpoint,
the Amazon API Gateway service invokes the corresponding Lambda
function. For more information about the ANY method, see Step 3:
Create a Simple Microservice using Lambda and API Gateway.
我目前正在设置一个小型 Lambda 来为我们的 EC2 实例的所有重要卷拍摄快照。为了保证应用程序的一致性,我需要在实例内部触发操作:一个是在快照之前停止应用程序,另一个是在快照完成后再次唤醒它。到目前为止,我不知道该怎么做。
我考虑过使用 SNS 或 SQS 来通知实例快照的启动和停止,但这有几个问题:
- 我需要在实例中安装(和开发)自定义侦听器。
- 如果 quiescing/wake-up 完成,我不会得到反馈。
所以这是我的问题:如何从 Lambda 触发实例内的操作?
但也许我是从错误的方向来处理这个问题的。真的没有简单的备份方案吗?我知道 azure 有一个基于快照的备份服务,可以进行应用程序一致性备份。我是不是错过了等效的 AWS 服务?
编辑 1:
好的,看来 AWS Systems Manager 的功能 'Run Command' 是我真正需要的。它允许我在 EC2 实例中 运行 脚本、Ansible 剧本等。当我找到可行的解决方案后,我将 post 执行必要的步骤。
您可以按需触发 Lambda 函数:
Using AWS Lambda with Amazon API Gateway (On-Demand Over HTTPS)
You can invoke AWS Lambda functions over HTTPS. You can do this by defining a custom REST API and endpoint using Amazon API Gateway, and then mapping individual methods, such as GET and PUT, to specific Lambda functions. Alternatively, you could add a special method named ANY to map all supported methods (GET, POST, PATCH, DELETE) to your Lambda function. When you send an HTTPS request to the API endpoint, the Amazon API Gateway service invokes the corresponding Lambda function. For more information about the ANY method, see Step 3: Create a Simple Microservice using Lambda and API Gateway.