Docker解决启动显示Job for docker.service failed because start of the service was attempted too often.See "systemctl status docker.service" and "journalctl -xe" for details.
问题描述:当我们安装好docker之后,启动docker时会显示以下报错
[root@Mysql-01 ~]# systemctl start docker
Job for docker.service failed because start of the service was attempted too often. See “systemctl status docker.service” and “journalctl -xe” for details.
[root@Mysql-01 ~]# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Sat 2024-04-20 17:58:24 CST; 32s ago
Docs: https://docs.docker.com
Process: 3380 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 3380 (code=exited, status=1/FAILURE)
Apr 20 17:58:24 Mysql-01 systemd[1]: start request repeated too quickly for do…ce
Apr 20 17:58:24 Mysql-01 systemd[1]: Failed to start Docker Application Contai…e.
Apr 20 17:58:24 Mysql-01 systemd[1]: Unit docker.service entered failed state.
Apr 20 17:58:24 Mysql-01 systemd[1]: docker.service failed.
Apr 20 17:58:36 Mysql-01 systemd[1]: start request repeated too quickly for do…ce
Apr 20 17:58:36 Mysql-01 systemd[1]: Failed to start Docker Application Contai…e.
Apr 20 17:58:36 Mysql-01 systemd[1]: docker.service failed.
Apr 20 17:58:48 Mysql-01 systemd[1]: start request repeated too quickly for do…ce
Apr 20 17:58:48 Mysql-01 systemd[1]: Failed to start Docker Application Contai…e.
Apr 20 17:58:48 Mysql-01 systemd[1]: docker.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
解决方法:检查/etc/docker/daemon.json 文件里面有没有填错,填错的话,是无法启动docker的。
[root@Mysql-01 ~]# mkdir -p /etc/docker
[root@Mysql-01 ~]# vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://ummqagsa.mirror.aliyuncs.com"]
}
[root@Mysql-01 ~]# systemctl daemon-reload
[root@Mysql-01 ~]# systemctl restart docker