可以在控制台中设置AWS ECS服务自动缩放

发布于 2025-01-23 17:00:04 字数 132 浏览 0 评论 0原文

我正在尝试AWS CLI进行应用-Autoscalsing,并想查看如何在AWS控制台中反映CLI的更改。

我将新的最小值和最大值设置为“寄存器”量目标。当我在AWS控制台中更新相同的服务时,为什么没有选项可以设置自动化最小值和最大值?

I am experimenting with the AWS CLI for application-autoscaling, and wanted to view how making changes in the CLI were reflected in the AWS console.

I set register-scalable-target with new a new minimum and maximum. When I updated the same service in the AWS Console, why is there no option to set autoscaling minimum and maximum values?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小鸟爱天空丶 2025-01-30 17:00:04

找到答案! “新ECS体验”中还没有(尚未?)。如果您通过在左上角上翻转切换到OFF位置来切换“经典”体验,然后编辑服务,您将看到自动级别的页面。

(该页面还将显示使用AWS CLI“应用程序Autoscal-Scalable-target”命令的值。)

Found the answer! The autoscaling page is not (yet?) available in the "New ECS Experience." If you switch to the "classic" experience by flipping the toggle in the upper-left corner to the off position, then edit the service, you will see the autoscaling page.

(The page will also show the values set with the AWS CLI 'application-autoscaling register-scalable-target' command.)

℉服软 2025-01-30 17:00:04

向任何发现这个问题的人求助。接受的答案不再起作用,因为您无法切换到经典的ECS控制台。

您首先要运行此命令以确保您拥有正确的策略名称。

aws application-autoscaling describe-scaling-policies --service-namespace ecs --resource-id service/$ECS_CLUSTER/$SERVICE_NAME

这将为您提供策略名称的打印输出。确保在下一个命令中使用确切的名称。

更新它们

aws application-autoscaling put-scaling-policy --policy-name YOUR_POLICY_NAME --service-namespace ecs --resource-id service/YOUR_CLUSTER_NAME/YOUR_SERVICE_NAME --scalable-dimension ecs:service:DesiredCount --policy-type TargetTrackingScaling --target-tracking-scaling-policy-configuration file://policy.json

并删除它们,

aws application-autoscaling delete-scaling-policy --policy-name POLICY_NAME --service-namespace ecs --resource-id service/YOUR_CLUSTER_NAME/YOUR_SERVICE_NAME --scalable-dimension ecs:service:DesiredCount

如果您真的想使用Web控制台,请描述它们然后删除它们。然后,您可以在Web控制台中更新它。

A heads up for anyone who finds this question. The accepted answer no longer works because you can't switch to the classic ECS console.

You first want to run this command to make sure you have the right policy name.

aws application-autoscaling describe-scaling-policies --service-namespace ecs --resource-id service/$ECS_CLUSTER/$SERVICE_NAME

This will give you a printout of the policy names. Make sure to use the exact names in the next commands.

Update them

aws application-autoscaling put-scaling-policy --policy-name YOUR_POLICY_NAME --service-namespace ecs --resource-id service/YOUR_CLUSTER_NAME/YOUR_SERVICE_NAME --scalable-dimension ecs:service:DesiredCount --policy-type TargetTrackingScaling --target-tracking-scaling-policy-configuration file://policy.json

and delete them

aws application-autoscaling delete-scaling-policy --policy-name POLICY_NAME --service-namespace ecs --resource-id service/YOUR_CLUSTER_NAME/YOUR_SERVICE_NAME --scalable-dimension ecs:service:DesiredCount

In general if you really want to use the web console just describe them and then delete them. Then you can update it in the web console.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文