amazon-web-services - 对于 AWS Elastic Beanstalk 中的多容器 Docker 配置,增强型运行状况概览未正确报告

标签 amazon-web-services docker cloud amazon-elastic-beanstalk

我上传了一个项目 multi-containers docker platform有两个容器说 xyzabcaws elastic-beanstalk . xyz其中包含 tomcat 服务器。我的项目中有以下配置 Dockerrunner.aws.json文件。

{
  "AWSEBDockerrunVersion": 2,
  "containerDefinitions": [
    {
      "name": "xyz",
      "image": "<PLACEHOLDER_REPLACED_BY_CICD_TOOLS>",
      "essential": true,
      "memory": 2048,
      "links": [
        "abc"
      ],
      "environment": [
        {
          "name": "ENVIRONMENT",
          "value": "QA"
        },
        {
          "name": "LOG_HOME",
          "value": "/usr/local/tomcat/logs"
        },
        .
        .
        .
      ],
      "mountPoints": [
        {
          "sourceVolume": "awseb-logs-xyz",
          "containerPath": "/usr/local/tomcat/logs"
        }
      ],
      .
      .
    },
    {
      "name": "abc",
      "image": "image123",
      "essential": true,
      .
      .
      .
    }
  ]
}

但是,我无法查看 elastic-beanstalk 的健康部分中的数据。
enter image description here

到目前为止,我为解决此问题所做的工作:
  • 我阅读了 ( https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-serverlogs.html ) 并了解到弹性 beantalk 具有特殊的日志记录格式,可让多容器健康页面正常工作。
  • 为了测试建议,我通过访问 ec2 实例手动创建了一个相同格式的错误日志文件。我在 ec2 实例主机中创建的文件位于 /var/log/containers/xyz (其中健康代理读取日志)也被正确映射到 /usr/local/tomcat/logs 中 tomcat 的日志文件的位置(即 xyz )码头容器。

  • 但是,我仍然看不到增强健康概览部分的变化。

    最佳答案

    来自 this AWS support site :

    From the Elastic Beanstalk console, verify that enhanced health reporting is enabled:

    1. Choose Configuration, and then on the Health panel under Web Tier, choose the edit gear.
    2. Under Health Reporting, ensure the System type is set to Enhanced.

    64-bit Amazon Linux 2016.xx vx.x.x running Node.js platform:

    Ensure that the correct proxy server is configured:

    1. Choose Configuration, and then on the Software Configuration panel under Web Tier, choose the edit gear.

    2. In Container Options, ensure you have a Proxy server selected. If Proxy server is set to none, the application log file is not generated under /var/log/nginx/healthd/ and health reporting does not generate data to display.

    You can also modify the Node.js logs and location to be compatible with enhanced health log format, then review the healthd configuration file /etc/healthd/config.yaml.

    64-bit Amazon Linux 2016.xx vx.x.x running Multicontainer Docker 2.xx.x:

    This platform doesn’t come with a proxy server, so you need to ensure that logs are produced in the correct format from their containers and configure healthd to read them. To use enhanced health monitoring in Multicontainer Docker environments, you need to configure healthd to consume these logs.

    To provide logs to the health agent, ensure the following:

    • Logs are in the correct format

    • Logs are written to /var/log/nginx/healthd/

    • Log names use the format: application.log.$year-$month-$day-$hour

    • Logs are rotated once per hour

    • Logs are not truncated

    Note: With the Node.js platform, if you disable the proxy, the logs are not created under /var/logs/nginx/healthd/. You must either re-enable the proxy or configure your Node.js application to produce logs under /var/logs/nginx/healthd/

    This sample Docker-multicontainer-v2.zip code shows how to manage ebextensions where the healthd configuration is set to read another directory. [...]



    我认为这部分可能可以帮助您:

    If you are unable to see information for a server in the Enhanced Health Overview, check the healthd service status on the instance and ensure that it’s running. If it is not running, restart the service.

    This sample code shows how to check the healthd service status:

    $ ps aux | grep healthd

    This sample code shows how to restart the healthd service:

    [ec2-user@ip-172-31-39-182 ~]$ sudo initctl restart healthd

    关于amazon-web-services - 对于 AWS Elastic Beanstalk 中的多容器 Docker 配置,增强型运行状况概览未正确报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55400463/

    相关文章:

    python - 在 Python 中使用 MySQL 和 AWS Lambda 的问题

    docker - docker :删除其他 docker 镜像上的文件/镜像依赖性

    ubuntu - 在 Ubuntu 14.04 上安装 docker 时 key 服务器超时

    api - 跨云存储适配器?

    java - 有没有办法使用 Java 程序在 Microsoft Azure 中创建虚拟机?

    amazon-web-services - 写入S3存储桶中的文件

    python - 云形成 : Pass List to Lambda Function

    php - 我可以在不使用 S3 API 的情况下从我的 Amazon S3 帐户下载文件吗?

    Docker 上的 Solr :localhost:8983 not working

    .net - 如果一家云公司声称军用级安全,那意味着什么?