简体   繁体   English

aws 自动缩放组 ec2 实例每分钟运行一次脚本

[英]aws autoscaling group ec2 instance to run script every minute

I want to have my ec2 instances to start running some automation script within the server once they are launched in the auto scaling group.我想让我的 ec2 实例在 Auto Scaling 组中启动后开始在服务器中运行一些自动化脚本。 This script will need to run every minute so userdata is probably not a good option.该脚本需要每分钟运行一次,因此 userdata 可能不是一个好的选择。 I wonder if there is a way to do this with ssm document.我想知道是否有办法用 ssm 文档做到这一点。 Any ideas would be much appreciated!任何想法将不胜感激!

Do you need to store the logs of the script on either S3 or Cloudwatch?您是否需要将脚本日志存储在 S3 或 Cloudwatch 上? Then use an EventBridge rule and a SSM Run Command document.然后使用 EventBridge 规则和 SSM 运行命令文档。

Do you not care about such logs?你不关心这样的日志吗? Then use your operating system native tools: cron on Linux or task scheduler on Windows.然后使用您的操作系统本机工具:Linux 上的 cron 或 Windows 上的任务调度程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 aws 自动缩放组 ec2 实例在销毁之前创建 - aws autoscaling group ec2 instance create before destroy 在 ec2 免费实例上每分钟执行一次 AWS cronjob - AWS cronjob for every minute on ec2 free instance 终止自动缩放组中的特定 ec2 实例 - Terminate specific ec2 instance in an autoscaling group 如何使用Terraform配置AWS自动伸缩组/启动配置以仅在一个EC2实例上运行cron作业? - How can I configure an AWS autoscaling group/launch configuration with Terraform to only run a cron job on one EC2 instance? 当实例连接到自动扩展组时,AWS EC2 如何更改实例类型? - AWS EC2 how to change instance type when the instance is connected to an autoscaling group? AWS Ec2 自动缩放 - AWS Ec2 Autoscaling 如何仅在AWS EC2自动缩放组中的一个tomcat实例中启动Web流程 - How to start a web process in only one tomcat instance in AWS EC2 autoscaling group 如何将AWS EC2实例CPU利用率提高到100%以测试自动缩放组创建新实例? - How to increase AWS EC2 instance CPU utilization to 100% to test autoscaling group creating new instances? 用于在 ec2 实例上运行 bash 脚本的 AWS cloudformation json 脚本 - AWS cloudformation json script to run bash script on ec2 instance 在每次重启 ec2 实例时运行 shell 脚本 - run shell script on every restart of ec2 instance
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM