AWS CloudWatch: EndpointConnectionError: Could not connect to the endpoint URL

AWS CloudWatch: EndpointConnectionError: Could not connect to the endpoint URL

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

  1. 我更新了我的存储库:sudo yum update -y
  2. 我安装了 awslogs 包:sudo yum install -y awslogs
  3. 我编辑了 /etc/awslogs/awscli.conf,在 EC2 页面上确认我的 AZ 是 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/ 以外的其他端点吗?如果有,是在哪里配置的?

提前致谢,

格雷厄姆

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