ecs通过创建的EC2实例启动服务(ECS service launching through created EC2 instance)

编程入门 行业动态 更新时间:2024-10-10 17:28:08
ecs通过创建的EC2实例启动服务(ECS service launching through created EC2 instance)

我在aws中创建了自己的EC2实例。 该AMI是AWS ECS优化的AMI,用于从我的EC2实例启动ecs服务。 我以前讨论过同样的事情。 并尝试用这种方法。 链接在下面,

使用AWS ECS服务的微服务部署

我创建了我的群集并配置了该群集名称,我正在通过在高级userdata部分中的代码段创建优化的AMI,

#!/bin/bash echo ECS_CLUSTER=your_cluster_name >> /etc/ecs/ecs.config

我遵循以下链接创建集群的文档,

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create_cluster.html

但是,没有结果 - 创建集群和ECS任务定义时,它创建并启动到一个EC2中。 通过指定上述代码再次创建另一个EC2。 所以总共2 Ec2。 我已经创建了我自己的ECS优化。

我发现从我自己的AMI(我创建的)启动ecs服务。实际上,我需要从我的Ec2启动我的ecs服务(我创建了我的计算机Amazon优化的AMI)。

这个要求背后的原因是我不想在别人拥有的机器上启动我的服务。 我需要从我的机器启动。 而且我还需要在我的机器中托管我的角度应用程序。 所以我需要控制我的机器。

任何人都可以帮助解决如何从我创建的机器启动ecs服务?

I have created my own EC2 instance in AWS. That AMI is AWS ECS optimized AMI for launching ecs service from my EC2 instance. I previously discussed the same thing. And tried with that approach. The link is below,

Microservice Deployment Using AWS ECS Service

I created my cluster and configured that cluster name when I am creating optimized AMI by following code snippet in advanced userdata section,

#!/bin/bash echo ECS_CLUSTER=your_cluster_name >> /etc/ecs/ecs.config

I followed the documentation of cluster creation from following link,

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create_cluster.htmlecs

But, no result - when creating cluster and ECS task definitions it creates and launches into one EC2. And again creating another EC2 by specifying above code. So total 2 Ec2. I already created my own ECS optimized.

I am finding for launching ECS service from my own AMI (that I created). Actually I need to launch my ECS service from my Ec2 (I had created my machine Amazon optimized AMI).

The reason behind this requirement is I don't want to launch my services in machine that owned by others. I need to launch from my machine. And also I need to host my angular application in the same my machine. So I need control of my machine. How can I do this?

最满意答案

听起来就像你只需要创建一个启动配置 。 通过此功能,您可以指定安装主机时应应用的用户数据设置。

创建启动配置后,基于它创建一个新的Auto Scaling组 (有一个下拉列表可选择要使用的启动配置)。

从这里,在该ASG下启动的任何新实例都将应用您在相关启动配置中配置的设置。

Sounds like you just need to create a Launch Configuration. With this you can specify the User Data settings that should be applied when a host is setup.

After you create your Launch Configuration, create a new Auto Scaling Group based off of it (there's a drop-down to select the launch configuration you want to use).

From here, any new instances launched under that ASG will apply the settings you've configured in the associated Launch Configuration.

更多推荐

本文发布于:2023-08-07 17:58:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465320.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:实例   ECS   ecs   created   instance

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!