도커 메인 프로세스를 종료하는 방법은 무엇입니까? 왜 항상 충돌이 발생합니까?
Ubuntu(AWS)에 도커가 설치되어 있습니다.
지난번에 클러스터를 시작하고 밤새도록 실행했습니다. (처음에는 별 문제가 없었던 것 같습니다.)
다음날 돌아와서 이렇게 만들었습니다 docker ps
.
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
그래서 나는 tail -f /var/log/syslog
:
Jul 14 11:25:20 server01 kernel: [8107974.094867] init: docker main process (23915) terminated with status 1
Jul 14 11:25:20 server01 kernel: [8107974.094876] init: docker main process ended, respawning
Jul 14 11:25:21 server01 kernel: [8107975.451554] init: docker main process (23961) terminated with status 1
Jul 14 11:25:21 server01 kernel: [8107975.451564] init: docker main process ended, respawning
시스템 로그는 몇 시간 동안 이런 모습이었습니다.
그래서 나는 다음을 시도합니다 me@server01:~$ sudo sysctl docker stop
.
sysctl: cannot stat /proc/sys/docker: No such file or directory
sysctl: cannot stat /proc/sys/stop: No such file or directory
그런 다음 시도합니다 me@server01:~$ sudo service docker stop
.
docker stop/waiting
그 다음에 sudo service docker start
:
docker start/running, process 11150
그리고 tail -f /var/log/syslog
:
Jul 14 11:35:13 server01 kernel: [8108567.403154] init: docker main process (11082) terminated with status 1
Jul 14 11:36:46 server01 kernel: [8108660.693572] init: docker main process (11150) terminated with status 1
Jul 14 11:36:46 server01 kernel: [8108660.693581] init: docker main process ended, respawning
Jul 14 11:36:48 server01 kernel: [8108662.068454] init: docker main process (11200) terminated with status 1
Jul 14 11:36:48 server01 kernel: [8108662.068463] init: docker main process ended, respawning
난 내가 똑똑하다고 생각했는데 sudo kill -SIGUSR1 $(cat /var/run/docker.pid)
...
sudo kill -SIGUSR1 $(cat /var/run/docker.pid)
sudo kill -SIGUSR1 $(cat /var/run/docker.pid)
sudo kill -SIGUSR1 $(cat /var/run/docker.pid)
단지 좋은 측정을 위해...하지만:
me@server01:~$ tail -f /var/log/syslog
Jul 14 11:56:07 server01 kernel: [8109821.948151] init: docker main process (17416) terminated with status 1
Jul 14 11:56:07 server01 kernel: [8109821.948160] init: docker main process ended, respawning
Jul 14 11:56:09 server01 kernel: [8109823.340658] init: docker main process (17469) terminated with status 1
Jul 14 11:56:09 server01 kernel: [8109823.340666] init: docker main process ended, respawning
등...그래서 나는 내가 시작한 곳으로 돌아 왔습니다.
안타깝게도,systemctl: command not found
docker run hello-world
:
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
답변1
당신이 원하는 것은 systemctl
명령이 아니라 sysctl
.
systemctl stop docker
부팅 시 시작되지 않도록 하려면 다음을 수행하세요.
systemctl disable docker