AWS CloudWatch:EndpointConnectionError:无法连接到端点URL

gig*_*tts 5 amazon-web-services cloudwatch amazon-cloudwatch amazon-cloudwatchlogs

我只是按照这些说明(链接)来在我的EC2实例上安装AWS CloudWatch.

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

提前致谢,

格雷厄姆

Shi*_*his 8

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>
Run Code Online (Sandbox Code Playgroud)

该错误 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