amazon-web-services - AWS CloudWatch 代理失败 - 刷新 EC2 实例标签失败 : RequestError: send request failed

标签 amazon-web-services ssl amazon-cloudwatch

我正在尝试使用 StatsD 监控我的 EC2 实例上的自定义指标。我遵循 AWS 文档并配置了角色,安装了 CloudWatch 代理,并对其进行了配置。我的 EC2 实例位于代理后面。我配置了common-config.toml .我还为 https://ec2.us-west-2.amazonaws.com/ 创建了证书包.我得到错误:

refresh EC2 Instance Tags failed: RequestError: send request failed
caused by: Post https://ec2.us-west-2.amazonaws.com/: proxyconnect tcp: tls: first record does not look like a TLS handshake, metrics will be dropped until it got fixed

这是服务启动的完整日志
2020/05/27 06:45:29 I! I! Detected the instance is EC2
2020/05/27 06:45:29 Reading json config file path: C:\ProgramData\Amazon\AmazonCloudWatchAgent\\amazon-cloudwatch-agent.json ...
C:\ProgramData\Amazon\AmazonCloudWatchAgent\\amazon-cloudwatch-agent.json does not exist or cannot read. Skipping it.
2020/05/27 06:45:29 Reading json config file path: C:\ProgramData\Amazon\AmazonCloudWatchAgent\Configs\file_config.json ...
Valid Json input schema.
No csm configuration found.
Configuration validation first phase succeeded

2020/05/27 06:45:29 I! Config has been translated into TOML C:\ProgramData\Amazon\AmazonCloudWatchAgent\\amazon-cloudwatch-agent.toml 
2020-05-27T06:45:29Z I! HTTP_PROXY "http://192.16.4.5:3128" is set!
2020-05-27T06:45:29Z I! HTTPS_PROXY "https://192.16.4.5:3128" is set!
2020-05-27T06:45:29Z I! NO_PROXY "169.254.169.254" is set!
2020-05-27T06:45:29Z I! AWSCABundle "C:\cert\bundle.pem" is set!
2020-05-27T06:45:29Z I! cloudwatch: get unique roll up list []
2020-05-27T06:45:29Z I! Starting AmazonCloudWatchAgent (version 1.237768.0)
2020-05-27T06:45:29Z I! Loaded outputs: cloudwatch cloudwatchlogs
2020-05-27T06:45:29Z I! Loaded inputs: windows_event_log statsd win_perf_counters
2020-05-27T06:45:29Z I! Tags enabled: host=cloudwatch01
2020-05-27T06:45:29Z I! Agent Config: Interval:1m0s, Quiet:false, Hostname:"cloudwatch01", Flush Interval:1s 
2020-05-27T06:45:29Z I! Started the statsd service on :8125
2020-05-27T06:45:29Z I! cloudwatch: publish with ForceFlushInterval: 1m0s, Publish Jitter: 3s
2020-05-27T06:45:29Z I! The state file C:\ProgramData\Amazon\AmazonCloudWatchAgent\Logs\state\Amazon_CloudWatch_WindowsEventLog_System for Amazon_CloudWatch_WindowsEventLog_System does not exist: CreateFile C:\ProgramData\Amazon\AmazonCloudWatchAgent\Logs\state\Amazon_CloudWatch_WindowsEventLog_System: The system cannot find the file specified.
2020-05-27T06:45:29Z I! Statsd listener listening on:  [::]:8125
2020-05-27T06:45:30Z E! refresh EC2 Instance Tags failed: RequestError: send request failed
caused by: Post https://ec2.us-west-2.amazonaws.com/: proxyconnect tcp: tls: first record does not look like a TLS handshake, metrics will be dropped until it got fixed
2020-05-27T06:45:30Z E! CreateLogStream / CreateLogGroup with log group name System stream name i-0c0000000000 has errors. Will retry the request: RequestError: send request failed


我正在使用鱿鱼代理。
导致 TLS 握手问题的原因是什么?
从 RDP session 打开浏览器时,通过 squid 代理访问 https 服务器没有问题。

最佳答案

我也遇到了这个问题,下面是我的解决方法。
common-config.toml

[proxy]
http_proxy="http://ip:port"
https_proxy="http://ip:port"
no_proxy="169.254.169.254"

关于amazon-web-services - AWS CloudWatch 代理失败 - 刷新 EC2 实例标签失败 : RequestError: send request failed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62037354/

相关文章:

ssl - 安装 SSL 证书后 Google pagerank 发生变化

amazon-web-services - Cron 表达式 Aws 在 EventBridge(Cloudwatch 触发器)启用后每 5 分钟运行一次

amazon-web-services - AWS CDK : Adding new stack not working (not showing up)

android - 为什么调用外部 java 函数会导致我的应用程序崩溃? (亚马逊 SNS、S3)

amazon-web-services - Terraform AWS NLB TLS 直通

php - 如何为 ec2-user 设置 AWS 目录的写入权限?

python - 使用 headless 浏览器呈现 100,000 个页面,aws 上每秒每个 cpu 的最大值

ssl - AWS ELB HTTPS 端口转发设置

ssl - Nginx 配置 SSL 负载均衡器

amazon-web-services - 重构 Terraform 以使用索引时防止资源破坏