【发布时间】: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