【发布时间】:2016-11-09 08:58:25
【问题描述】:
在 AWS 上,我可以运行云形成脚本来执行诸如周末关闭计算机或运行 EMR 作业等操作。
如何在不创建小实例作为任务管理器的情况下在 google 上安排任务?
【问题讨论】:
标签: google-cloud-platform gcloud gsutil
在 AWS 上,我可以运行云形成脚本来执行诸如周末关闭计算机或运行 EMR 作业等操作。
如何在不创建小实例作为任务管理器的情况下在 google 上安排任务?
【问题讨论】:
标签: google-cloud-platform gcloud gsutil
CloudFormation 的替代品是 Google Cloud Deployment Manager。 它们非常相似。
作为记录,您可以找到 AWS 服务和 GCP 服务的映射here。
【讨论】:
如果我没听错的话,App Engine 允许您使用Cron Service,基本上可以根据您的目的进行配置。但它需要一些编程语言的知识,如 Go、PHP、Java 或 Python。
【讨论】:
方法一:
如何安排机器只在特定时间段运行 请参考gcloud计算命令start和stop
然后 crontab -e 按照您的预期添加以下任务,例如:
00 06 * * * /usr/bin/gcloud compute instances start instance-1
00 07 * * * /usr/bin/gcloud compute instances stop instance-1
方法二:
建议你使用谷歌容器引擎
然后 crontab -e 按照您的预期添加以下任务,例如:
00 06 * * * /usr/bin/gcloud compute instance-groups managed resize instance-group-1 --size=1
00 07 * * * /usr/bin/gcloud compute instance-groups managed resize instance-group-1 --size=0
您需要将您的任务放入您的 vm 实例中,并从您刚刚创建的实例中创建一个模板实例,然后基于该实例模板创建一个实例组
【讨论】: