如何访问 aws multiContainer docker 中的 运行 我的普罗米修斯仪表板?

How to access my prometheus dashboard which are running in aws multiContainer docker?

我在 aws docker 上有 运行 prometheus 和 grafana 镜像 运行 0.0.0.0:9090->9090/tcp & 0.0.0.0:3000->3000/tcp docker 中的端口,但我不知道如何使用端点访问此 prometheus 和 grafana 仪表板。我尝试使用 (MachineIP:9090) 访问,但无法访问。任何人都可以知道吗?

{
  "AWSEBDockerrunVersion": 2,
  "volumes": [
    {
      "name": "php-app",
      "host": {
        "sourcePath": "/var/app/current/php-app"
      }
    },
    {
      "name": "nginx-proxy-conf",
      "host": {
        "sourcePath": "/var/app/current/proxy/conf.d"
      }
    }
  ],
  "containerDefinitions": [
    {
      "name": "php-app",
      "image": "php:fpm",
      "essential": true,
      "memory": 128,
      "mountPoints": [
        {
          "sourceVolume": "php-app",
          "containerPath": "/var/www/html",
          "readOnly": true
        },
        {
          "sourceVolume": "awseb-logs-php-app",
          "containerPath": "/var/log/sample-app"
        }
      ]
    },
    {
      "name": "nginx-proxy",
      "image": "nginx",
      "essential": true,
      "memory": 128,
      "portMappings": [
        {
          "hostPort": 80,
          "containerPort": 80
        }
      ],
      "links": [
        "php-app"
      ],
      "mountPoints": [
        {
          "sourceVolume": "php-app",
          "containerPath": "/var/www/html",
          "readOnly": true
        },
        {
          "sourceVolume": "awseb-logs-nginx-proxy",
          "containerPath": "/var/log/nginx"
        },
        {
          "sourceVolume": "nginx-proxy-conf",
          "containerPath": "/etc/nginx/conf.d",
          "readOnly": true
        }
      ]
    }
  ]
}

您需要在 elastic beans talk 负载均衡器和您的 docker 实例之间进行端口映射。

还要确保在安全组

中允许端口 809090

参考: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/authorizing-access-to-an-instance.html