【问题标题】:AWS CloudWatch: EndpointConnectionError: Could not connect to the endpoint URLAWS CloudWatch:EndpointConnectionError:无法连接到终端节点 URL
【发布时间】:2016-05-27 23:58:21
【问题描述】:

我只是按照这些说明 (Link) 在我的 EC2 实例上安装了 AWS CloudWatch。

  1. 我更新了我的存储库:sudo yum update -y
  2. 我安装了 awslogs 包:sudo yum install -y awslogs
  3. 我编辑了 /etc/awslogs/awscli.conf,在 EC2 页面上确认我的可用区是 us-west-2b
  4. 我保留了 /etc/awslogs/awslogs.conf 文件的默认配置,确认默认路径确实有写入日志
  5. 我检查了 /var/log/awslogs.log 文件,它反复显示错误: EndpointConnectionError:无法连接到端点 URL:“https://logs.us-west-2b.amazonaws.com/

    • 我在 CloudWatch 控制台中没有看到任何新创建的日志组和日志流,如预期的那样。我在这里错过了什么?

我应该指向 https://logs.us-west-2b.amazonaws.com/ 以外的其他端点吗?如果是这样,那是在哪里配置的?

提前致谢,

格雷厄姆

【问题讨论】:

  • 在 IAM >> 用户 >> 您的用户 >> 策略下:您是否更新了策略以允许创建组/流?
  • @vath 我做了 - 这个用户在我的沙盒账户中拥有完全的管理员访问权限:{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow" , "操作": "", "资源": "" } ] }
  • 我在创建日志组和日志流时遇到了一些问题,因此我进入云监控控制台并手动创建了一个新组和流。然后在 IAM >> 用户 >>(我的用户名)>>“权限”选项卡 >> [附加策略]:我向我的用户添加了“AmazonAPIGatewayPushToCloudWatchLogs”权限。我已经能够将日志写入区域 US_WEST_2 中的该流。

标签: amazon-web-services amazon-cloudwatch cloudwatch amazon-cloudwatchlogs


【解决方案1】:

awscli.conf 需要的是区域而不是 AZ。

将区域指定为 us-west-2。

这是参考页面中的文档

Edit the /etc/awslogs/awscli.conf file and in the [default] section, specify the region where you want to view log data and add your credentials.

region = us-east-1
aws_access_key_id = <YOUR ACCESS KEY>
aws_secret_access_key = <YOUR SECRET KEY>

错误 EndpointConnectionError: Could not connect to the endpoint URL: "https://logs.us-west-2b.amazonaws.com/" 可能是由于区域指定错误。

US-WEST-2 中 cloudwatch 日志服务的正确端点是 logs.us-west-2.amazonaws.com.

有关 aws 服务端点,请参阅以下文档 http://docs.aws.amazon.com/general/latest/gr/rande.html#cwl_region

【讨论】:

  • 这是问题,感谢您的帮助,非常感谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-06-02
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多