【问题标题】:Unable to create new docker instances with docker-machine无法使用 docker-machine 创建新的 docker 实例
【发布时间】:2020-08-27 04:12:01
【问题描述】:

我正在使用 AWS 和 docker-machine 来创建和配置我的实例。我会使用这个命令来创建一个新实例:

docker-machine create --driver amazonec2 --amazonec2-instance-type "t2.micro" --amazonec2-security-group zhxw-production-sg zhxw-production-3

大约一个月前,效果很好。我刚去创建一台新机器,但我无法再连接到它。当我运行上述命令时,它卡在“等待 SSH 可用...”

Running pre-create checks...
Creating machine...
(zhxw-production-3) Launching instance...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...

它只是挂在那个点上。如果我取消该命令并检查 AWS EC2 控制台,它表明它正在运行:

当我运行docker-machine ls 时,它也提示它正在运行,但出现错误:

$-> docker-machine ls
NAME                ACTIVE   DRIVER      STATE     URL                         SWARM   DOCKER      ERRORS
zhxw-production-2   -        amazonec2   Running   tcp://3.86.xxx.xxx:2376             v19.03.12   
zhxw-production-3   -        amazonec2   Running   tcp://54.167.xxx.xxx:2376           Unknown     Unable to query docker version: Cannot connect to the docker engine endpoint

我能够连接到 zhxw-production-2 机器(已经运行了一个月)。只是不是我刚刚推出的新的 zhxw-production-3 。

$-> docker-machine env zhxw-production-3
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "54.167.123.108:2376": dial tcp 54.167.123.108:2376: connect: connection refused
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which might stop running containers.

regenerate-certs 命令也无济于事。我不确定从哪里开始调试,因为据我所知,docker-machine create 命令的开始。

【问题讨论】:

    标签: docker-machine


    【解决方案1】:

    原来是通过 SSH 连接到我的 AWS 环境的问题。我的公共 IP 地址已列入白名单,但它已更改。

    【讨论】:

      【解决方案2】:

      我遇到了这样的问题,我发现 AWS EC2 AMI 没有安装 SSH,所以我不得不使用不同的 AMI,例如。 Ubuntu。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-04-26
        • 2018-02-16
        • 1970-01-01
        • 2023-02-11
        • 1970-01-01
        • 1970-01-01
        • 2018-09-04
        • 1970-01-01
        相关资源
        最近更新 更多