简体   繁体   English

如何在 AWS ECS 任务定义中配置日志

[英]How to configure logentries in AWS ECS Task definition

I'm trying to configure logentries for a Task Definition on AWS ECS As you can see here "logentries" is available for container instances.我正在尝试为AWS ECS 上的任务定义配置日志如您在此处看到的,“日志”可用于容器实例。

However I can not find any documentation or example about how to configure it.但是我找不到任何关于如何配置它的文档或示例。 I've seen examples of other drivers: https://docs.aws.amazon.com/AmazonECS/latest/userguide/example_task_definitions.html我看过其他驱动程序的示例: https://docs.aws.amazon.com/AmazonECS/latest/userguide/example_task_definitions.html

So I've tried to set the needed parameters defined in this documentation in the aws console:因此,我尝试在 aws 控制台中设置 本文档中定义的所需参数: 在此处输入图像描述

However when I try to run a task with this configuration I get:但是,当我尝试使用此配置运行任务时,我得到:

service my-service was unable to place a task because no container instance met all of its requirements. service my-service 无法放置任务,因为没有容器实例满足其所有要求。 The closest matching container-instance is missing an attribute required by your task.最接近的匹配容器实例缺少您的任务所需的属性。 For more information, see the Troubleshooting section.有关详细信息,请参阅故障排除部分。

Any ideas?有任何想法吗?

In the case of splunk logging in ECS (with EC2 instances as hosts with the ECS optimized image, and not Fargate), you had to explicitly boot the instance with splunk logging enabled, by setting ENV variable ECS_AVAILABLE_LOGGING_DRIVERS at boot time (you can use userdata for this).对于 ECS 中的 splunk 日志记录(EC2 实例作为具有 ECS 优化映像的主机,而不是 Fargate),您必须通过在启动时设置 ENV 变量 ECS_AVAILABLE_LOGGING_DRIVERS 来显式启动启用了 splunk 日志记录的实例(您可以使用userdata为了这)。 There is a similar option for logentries. logentries 也有类似的选项。

See https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html请参阅https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html

Your error message is not about the configuration of logentries being incorrect, rather that logentries is unavailable altogether in the environment.您的错误消息不是关于 logentries 的配置不正确,而是 logentries 在环境中完全不可用。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM