【问题标题】:AWS CloudWatch agent fails - refresh EC2 Instance Tags failed: RequestError: send request failedAWS CloudWatch 代理失败 - 刷新 EC2 实例标签失败:RequestError:发送请求失败
【发布时间】:2020-05-27 07:10:18
【问题描述】:

我正在尝试使用 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

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

【问题讨论】:

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


    【解决方案1】:

    我也遇到了这个问题,下面是我的解决方法。

    common-config.toml

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

    【讨论】:

    • 我做了一些事情,它开始起作用了。不幸的是,这是很久以前的事了,我不记得了:-(
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-08-31
    • 2016-07-17
    • 2020-11-09
    • 2017-07-05
    • 1970-01-01
    • 2020-04-06
    • 2016-02-22
    相关资源
    最近更新 更多