0
試圖在一個EC2實例指向一個羣主來使用另一個EC2實例領事註冊表時,我收到以下錯誤:無法在EC2上指向羣師傅領事註冊表上的另一個EC2
Running pre-create checks...
Creating machine...
(swarm-master) 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...
Detecting the provisioner...
Provisioning with ubuntu(systemd)...
Installing Docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Error creating machine: Error running provisioning: ssh command error:
command : sudo systemctl -f start docker
err : exit status 1
output : Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
我注意到了直接指向碼頭引擎位置的提示,升級到最新的碼頭機版本,並在註冊表EC2的安全組上打開了端口8500,但這並未解決我的問題。
這裏是我如何運行:
創建註冊表:
docker-machine create \
--driver amazonec2 \
--amazonec2-vpc-id vpc-12345678 \
--amazonec2-region us-east-1 \
--amazonec2-zone b \
--amazonec2-instance-type t2.micro \
--amazonec2-subnet-id subnet-12345678 \
--amazonec2-security-group swarm_sg \
--amazonec2-keypair-name swarm \
--amazonec2-ssh-keypath ~/.docker/machine/certs/swarm \
swarm-registry
承擔註冊表機
eval $(docker-machine env swarm-registry)
運行領事
docker run -d \
-p "8500:8500" \
-h "consul" \
progrium/consul -server -bootstrap
創建羣主:
docker-machine create \
--driver amazonec2 \
--amazonec2-vpc-id vpc-12345678 \
--amazonec2-region us-east-1 \
--amazonec2-zone b \
--amazonec2-instance-type t2.micro \
--amazonec2-subnet-id subnet-12345678 \
--amazonec2-security-group swarm_sg \
--amazonec2-keypair-name swarm \
--amazonec2-ssh-keypath ~/.docker/machine/certs/swarm \
--engine-install-url="https://web.archive.org/web/20170623081500/https://get.docker.com" \
--swarm \
--swarm-master \
--swarm-discovery="consul://172.31.56.214:8500" \
--engine-opt="cluster-store=consul://172.31.56.214:8500" \
--engine-opt="cluster-advertise=eth1:2376" \
swarm-master
其中172.31.56.214是swarm-registry機器的主機EC2的私有IP地址。此外,當運行W/O試圖指向領事我沒有問題。也就是說,創建沒有以下行的主人是可能的:
--swarm-discovery="consul://172.31.56.214:8500" \
--engine-opt="cluster-store=consul://172.31.56.214:8500" \
--engine-opt="cluster-advertise=eth1:2376" \
任何幫助真誠讚賞。