解决docker服务无法启动,报错 loaded

关闭docker后,执行systemctl start docker命令后,服务未正常启动,查看docker状态,报:Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)

如下:

[root@zhaodong-centos system]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: activating (auto-restart) (Result: exit-code) since Mon 2021-03-15 19:46:33 CST; 546ms ago
     Docs: https://docs.docker.com
  Process: 2660 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 2660 (code=exited, status=1/FAILURE)

Mar 15 19:46:33 zhaodong-centos systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Mar 15 19:46:33 zhaodong-centos systemd[1]: Failed to start Docker Application Container Engine.
Mar 15 19:46:33 zhaodong-centos systemd[1]: Unit docker.service entered failed state.
Mar 15 19:46:33 zhaodong-centos systemd[1]: docker.service failed.

解决办法

1、检查 /etc/docker/daemon.jsno文件配置是否正确,必须是json格式!

[root@zhaodong-centos system]# cat /etc/docker/daemon.json     
{
  "registry-mirrors": [
    "https://registry.docker-cn.com",
    "http://hub-mirror.c.163.com",
    "https://docker.mirrors.ustc.edu.cn"
    "https://omh8vcpy.mirror.aliyuncs.com"
  ]
}

2、检查 /usr/lib/systemd/system/docker.service 文件是否配置正常

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
BindsTo=containerd.service
After=network-online.target firewalld.service containerd.service
Wants=network-online.target
Requires=docker.socket

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always

# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229.
# Both the old, and new location are accepted by systemd 229 and up, so using the old location
# to make them work for either version of systemd.
StartLimitBurst=3

# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
# Both the old, and new name are accepted by systemd 230 and up, so using the old name to make
# this option work for either version of systemd.
StartLimitInterval=60s

# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity

# Comment TasksMax if your systemd version does not support it.
# Only systemd 226 and above support this option.
TasksMax=infinity

# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes

# kill only the docker process, not all processes in the cgroup
KillMode=process

[Install]
WantedBy=multi-user.target
  • 4
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
启动 Docker 引擎后启动 Nacos 出现 "No DataSource set" 报错时,这通常表示 Nacos 容器无法找到正确的数据源配置。根据您提供的引用内容,有几种可能导致这个问题的原因。 首先,该问题可能与您的数据源配置有关。请确保您的数据源配置正确无误,并且在容器启动时已经正确加载。如果您已经确认配置正确,可以尝试重新启动容器,以确保配置的正确加载。 其次,这个问题还可能与 Nacos 的日志配置有关。根据引用的内容,有时候报错可能是由于缺少 "nacos-logback.xml" 文件导致的。您可以尝试将该文件放入相应的文件夹中,以确保 Nacos 可以正确加载日志配置。 另外,根据引用中提到的操作系统和软件信息,您使用的是 Apple M1 Pro 操作系统,Nacos 版本为 v2.2.2-slim,MySQL 版本为 8.0.32。请确保您的操作系统和软件版本与 Nacos 的兼容性,并且已经正确安装和配置。 综上所述,当 Docker 启动 Nacos 报错 "No DataSource set"时,您可以尝试以下解决方法: 1. 确认数据源配置正确,并确保在容器启动时正确加载。 2. 检查是否缺少 "nacos-logback.xml" 文件,并将其放入相应的文件夹中。 3. 确认操作系统和软件版本与 Nacos 的兼容性,并正确安装和配置。 希望以上信息对您有帮助!<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [Docker 启动 Nacos 报错:No DataSource set](https://blog.csdn.net/qq_44402184/article/details/132014373)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [docker安装nacos报错nacos-logback.xml找不到](https://download.csdn.net/download/weixin_43965349/87915737)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值