问题描述
我正在尝试配置 aws cloudwatch
脚本以监视内存等。在执行该脚本时,我们遇到以下错误,并升级了 perl
软件包的LWP版本也是最新的6,但是脚本仍然失败,并出现以下错误。
I am trying to configure aws cloudwatch
script for monitoring memory etc. While executing the script we get below error and I upgraded the perl
package the LWP version is also latest as 6 but still script is failing with below error.
我尝试将环境变量设置为 PERL_LWP_ENV_PROXY = 1
和 PERL_LWP_SSL_VERIFY_HOSTNAME = 0
仍然失败。
I tried setting env variables as PERL_LWP_ENV_PROXY=1
and PERL_LWP_SSL_VERIFY_HOSTNAME=0
but still failing. Please help on this.
错误:无法调用CloudWatch:HTTP500。消息:无法连接至
monitoring.ap-southeast-1.amazonaws.com:443(超时)
ERROR: Failed to call CloudWatch: HTTP 500. Message: Can't connect to monitoring.ap-southeast-1.amazonaws.com:443 (timeout)
LWP :: Protocol :: https :: Socket:connect:
的超时时间/usr/local/share/perl5/LWP/Protocol/http.pm第47行
LWP::Protocol::https::Socket: connect: timeout at /usr/local/share/perl5/LWP/Protocol/http.pm line 47.
有关更多信息,请运行'mon-put-instance-data.pl --help'
For more information, run 'mon-put-instance-data.pl --help'
推荐答案
我想这也意味着您已将 http_proxy
环境变量设置为应该使用的代理,并且
I guess this also means that you have the http_proxy
environment variable set to a proxy it should use and that there is no way to the target except by using this proxy.
使用sudo调用某些东西将以不同的权限运行它。出于安全原因,在调用程序之前,sudo会严重擦除环境变量,这可能意味着sudo运行的程序 http_proxy
为空。这再次意味着它将尝试直接访问目标站点而不是使用代理,并且由于只能使用代理访问该站点,因此连接超时。
Calling something using sudo will run it with different privileges. For security reasons the environment variables are heavily scrubbed before by sudo before calling the program which probably means that http_proxy
is empty for the program run by sudo. This again means that it will try to reach the target site directly instead of using a proxy and will timeout on connection since the site can only be reached using the proxy.
这篇关于LWP ::协议:: https ::套接字:连接:超时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!