docker-machine 시작 실패에 대한 해결 방법: 1. "docker-machine ls"를 사용하여 호스트 상태를 확인합니다. 2. 기존 docker를 제거하고 다시 설치합니다. 3. docker를 시작하고 docker 서비스 상태를 확인합니다.
이 문서의 운영 환경: centos7 시스템, Docker 버전 19.03.9, Dell G3 컴퓨터.
docker-machine을 시작할 수 없는 문제를 해결하는 방법은 무엇입니까?
Centos7 docker-machine이 docker 호스트를 배포합니다.
Background:
Centos7 Core를 Docker 호스트로 사용하여 테스트 플랫폼을 구축할 계획입니다. Swarm 솔루션을 사용하세요.
환경:
호스트 이름 | 시스템 | IP 주소 | 사전 작업 |
docker-host1 | CentOS7 Core | xxx.xxx.xxx. 80 |
업데이트 냠 소스, aliyun 미러 사용, 최신 상태로 업데이트 docker-machine에서 사용하는 사용자 구성, sudo 비밀번호 없음 |
docker-host2 | CentOS7 Core | xxx.xxx.xxx.81 |
yum 소스 업데이트, aliyun 미러 사용, 최신 상태로 업데이트 docker-machine에서 사용하는 사용자 구성, sudo 비밀번호 없음 |
docker-host3 | CentOS7 Core | xxx.xxx.xxx.82 |
yum 소스 업데이트, aliyun 이미지 사용, 최신 상태로 업데이트 docker-machine에서 사용하는 사용자 구성, sudo 비밀번호 없음 |
docker-host4 | CentOS7 Core | xxx.xxx.xxx. 83 |
yum 소스 업데이트, aliyun 이미지 사용, 최신 상태로 업데이트 docker-machine에서 사용하는 사용자 구성, sudo 비밀번호 없음 |
desktop | ubuntu-18.04lts | 비밀번호 구성 -docker-host |
에 무료 로그인 설치:
작업 중인 데스크톱(Ubuntu) 호스트에 docker-machine을 설치합니다. https://docs.docker.com/machine/install-machine을 참조하세요. /
먼저 docker-host1 설치:
docker- machine --debug create --driver generic --generic-ip-address=xxx.xxx.xxx.80 --generic-ssh-key=/home/sleeber /.ssh/id_rsa --generic-ssh-port=22 --generic-ssh-user=wntime docker-host1
설치의 최종 출력에는 docker 서비스를 시작할 수 없다는 메시지가 표시됩니다.
sudo systemctl -f start docker SSH cmd err, output: exit status 1: Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details. Error creating machine: Error running provisioning: something went wrong running an SSH command 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. notifying bugsnag: [Error creating machine: Error running provisioning: something went wrong running an SSH command 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. ]
Docker 사용- 호스트 상태를 확인하려면
:~/docker-test-env$ docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS docker-host1 - generic Running tcp://xxx.xxx.xxx.80:2376 Unknown Unable to query docker version: Cannot connect to the docker engine endpoint
docker-host1 호스트에 SSH를 연결하고 수동으로 docker를 시작하세요. Service
sudo systemctl start docker Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
프롬프트에 따라 상태를 확인하세요
systemctl status docker.service ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/docker.service.d └─10-machine.conf Active: failed (Result: start-limit) since Thu 2020-05-28 20:41:39 EDT; 581ms ago Docs: https://docs.docker.com Process: 30463 ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock --storage-driver overlay2 --tlsverify --tlscacert /etc/docker/ca.pem --tlscert /etc/docker/server.pem --tlskey /etc/docker/server-key.pem --label provider=generic (code=exited, status=1/FAILURE) Main PID: 30463 (code=exited, status=1/FAILURE)
谷歌一下: https://github.com/moby/moby/issues/33931 https://www.jianshu.com/p/bd395fdf7611 https://www.jianshu.com/p/93518610eea1
검색 결과에 따르면 10-machine으로 인해 발생해야 합니다. .conf; 하지만 10-machine.conf 파일과 폴더를 삭제한 후에도 여전히 시작할 수 없습니다
$ sudo rm /etc/systemd/system/docker.service.d/10-machine.conf $ sudo systemctl start docker Failed to start docker.service: Unit is not loaded properly: Invalid argument. See system logs and 'systemctl status docker.service' for details. $ sudo rm -rf /etc/systemd/system/docker.service.d/ $ sudo systemctl start docker Failed to start docker.service: Unit is not loaded properly: Invalid argument. See system logs and 'systemctl status docker.service' for details.
dockerd를 사용하여 직접 시작할 수 있습니다
$ sudo nohup dockerd & [1] 31419 $ nohup: ignoring input and appending output to ‘nohup.out’ $ ll total 4 -rw-------. 1 root root 2638 May 28 20:52 nohup.out $ tail -f nohup.out tail: cannot open ‘nohup.out’ for reading: Permission denied tail: no files remaining $ sudo tail -f nohup.out time="2020-05-28T20:52:56.409646032-04:00" level=warning msg="Base device already exists and has filesystem xfs on it. User specified filesystem will be ignored." storage-driver=devicemapper time="2020-05-28T20:52:56.430282474-04:00" level=info msg="[graphdriver] using prior storage driver: devicemapper" time="2020-05-28T20:52:56.430326847-04:00" level=warning msg="[graphdriver] WARNING: the devicemapper storage-driver is deprecated, and will be removed in a future release" time="2020-05-28T20:52:56.433336530-04:00" level=warning msg="mountpoint for pids not found" time="2020-05-28T20:52:56.433595847-04:00" level=info msg="Loading containers: start." time="2020-05-28T20:52:56.529329426-04:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address" time="2020-05-28T20:52:56.558933143-04:00" level=info msg="Loading containers: done." time="2020-05-28T20:52:56.570819898-04:00" level=info msg="Docker daemon" commit=9d988398e7 graphdriver(s)=devicemapper version=19.03.9 time="2020-05-28T20:52:56.570873940-04:00" level=info msg="Daemon has completed initialization" time="2020-05-28T20:52:56.585131361-04:00" level=info msg="API listen on /var/run/docker.sock" ^C $ sudo docker version Client: Docker Engine - Community Version: 19.03.9 API version: 1.40 Go version: go1.13.10 Git commit: 9d988398e7 Built: Fri May 15 00:25:27 2020 OS/Arch: linux/amd64 Experimental: false Server: Docker Engine - Community Engine: Version: 19.03.9 API version: 1.40 (minimum version 1.12) Go version: go1.13.10 Git commit: 9d988398e7 Built: Fri May 15 00:24:05 2020 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.2.13 GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429 runc: Version: 1.0.0-rc10 GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd docker-init: Version: 0.18.0 GitCommit: fec3683
systemctl을 사용하여 docker 서비스 상태를 확인하면 여전히 실패가 표시됩니다
$ sudo systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/docker.service.d └─10-machine.conf Active: failed (Result: start-limit) since Thu 2020-05-28 20:49:52 EDT; 4min 59s ago Docs: https://docs.docker.com Process: 31051 ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock --storage-driver overlay2 --tlsverify --tlscacert /etc/docker/ca.pem --tlscert /etc/docker/server.pem --tlskey /etc/docker/server-key.pem --label provider=generic (code=exited, status=1/FAILURE) Main PID: 31051 (code=exited, status=1/FAILURE) May 28 20:49:50 test-java2 systemd[1]: docker.service failed. May 28 20:49:52 test-java2 systemd[1]: docker.service holdoff time over, scheduling restart. May 28 20:49:52 test-java2 systemd[1]: Stopped Docker Application Container Engine. May 28 20:49:52 test-java2 systemd[1]: start request repeated too quickly for docker.service May 28 20:49:52 test-java2 systemd[1]: Failed to start Docker Application Container Engine. May 28 20:49:52 test-java2 systemd[1]: Unit docker.service entered failed state. May 28 20:49:52 test-java2 systemd[1]: docker.service failed. May 28 20:50:45 test-java2 systemd[1]: start request repeated too quickly for docker.service May 28 20:50:45 test-java2 systemd[1]: Failed to start Docker Application Container Engine. May 28 20:50:45 test-java2 systemd[1]: docker.service failed.
It docker-machine은 여전히 docker를 설치하는 데 문제가 있으며 수동으로만 설치할 수 있다고 추론됩니다.
참고: docker를 제거한 후 /etc/systemd/system/docker.service .d/ 폴더를 수동으로 삭제해야 합니다. 그렇지 않으면 새로 설치된 Docker를 시작할 수 없습니다.
기존 docker를 제거하고 다시 설치하세요
sudo yum remove docker* \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine sudo rm -rf /etc/systemd/system/docker.service.d/ sudo yum install -y yum-utils device-mapper-persistent-data lvm2 sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo sudo yum install -y docker-ce docker-ce-cli containerd.io
docker를 시작하고 docker 서비스 상태를 확인하세요
$ sudo docker version Client: Docker Engine - Community Version: 19.03.10 API version: 1.40 Go version: go1.13.10 Git commit: 9424aeaee9 Built: Thu May 28 22:18:06 2020 OS/Arch: linux/amd64 Experimental: false Server: Docker Engine - Community Engine: Version: 19.03.10 API version: 1.40 (minimum version 1.12) Go version: go1.13.10 Git commit: 9424aeaee9 Built: Thu May 28 22:16:43 2020 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.2.13 GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429 runc: Version: 1.0.0-rc10 GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd docker-init: Version: 0.18.0 GitCommit: fec3683
정상적으로 시작할 수 있습니다
추천 학습: "docker 비디오 튜토리얼"
위 내용은 docker-machine이 시작되지 않는 문제를 해결하는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!