为了方便管理实验室的GPU资源,上了多层虚拟化,在部署和运维Docker节点的过程中踩了一些坑,在这记录一下,以便日后查阅。
1、Docker服务无法启动
1 2 3 4 5 6 7 8 9 10 11 |
sudo service docker start # systemctl status docker.service systemd[1]: Failed to start Docker Application Container Engine. systemd[1]: docker.service: Unit entered failed state. systemd[1]: docker.service: Failed with result 'start-limit-hit'. # journalctl -xe dockerd[3285]: unable to configure the Docker daemon with file etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file: hosts: (from flag: [fd://], from file: [unix:///var/run/docker.sock tcp://0.0.0.0:56379]) systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE systemd[1]: Failed to start Docker Application Container Engine. |
问题定位: Docker启动的时候传入了命令行参数,同时也指定了配置文件,两个配置发生了冲突。
解决方法:
1 2 3 4 5 6 7 8 9 |
sudo nano /lib/systemd/system/docker.service # ExecStart=/usr/bin/dockerd -H fd:// # 改为 # ExecStart=/usr/bin/dockerd # # -H fd:// sudo systemctl daemon-reload sudo service docker restart |