【问题标题】:AWS [Errno -2] Name or service not knownAWS [Errno -2] 名称或服务未知
【发布时间】:2021-05-05 04:17:36
【问题描述】:

我使用 SSH Secure Shell 并使用 linux 命令行运行并尝试停止和启动实例。但我得到了一个错误。有谁知道如何解决这个问题?

命令如下:

[tomcat@dlap54v ~]$ aws ec2 stop-instances --instance-ids i-e3a2b929

命令输出:

HTTPSConnectionPool(host='ec2.ap-southeast-1a.amazonaws.com', port=443): Max retries exceeded with url: / (Caused by <class 'socket.gaierror'>: [Errno -2] Name or service not known)

【问题讨论】:

  • 您是否定义了要连接的region?通常,它被定义为环境变量或命令本身中的--region 参数。

标签: linux amazon-ec2


【解决方案1】:

这是因为地区。 我使用亚太地区(新加坡)作为该地区,因为我来自新加坡。它不断显示错误,例如“名称或服务未知” 所以,你能做的就是选择美国东部(弗吉尼亚北部)。 它现在对我有用。

【讨论】:

    猜你喜欢
    • 2013-09-24
    • 1970-01-01
    • 2019-12-05
    • 2021-11-05
    • 2013-07-01
    • 1970-01-01
    • 2013-12-14
    • 2018-01-05
    • 1970-01-01
    相关资源
    最近更新 更多