内核3.10,systemctl start docker 被阻塞,没有返回,查看状态为启动中。

某兄弟机器安装docker之后,发现systemctl start docker的时候阻塞,由于排查走了一些弯路,记录如下:

level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"
level=info msg="libcontainerd: new containerd process, pid: 46803"
level=warning msg="Docker could not enable SELinux on the host system"
level=info msg="Graph migration to content-addressability took 0.00 seconds"
level=info msg="Loading containers: start."
level=warning msg="Running modprobe nf_nat failed with message: ``, error: exec: \"modprobe\": executable file not found in $PATH"
level=warning msg="Running modprobe xt_conntrack failed with message: ``, error: exec: \"modprobe\": executable file not found in $PATH"
level=info msg="Firewalld running: false"
Error starting daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain: iptables failed: iptables --wait -t nat -N DOCKER: iptables v
Perhaps iptables or your kernel needs to be upgraded.
(exit status 3)
 docker.service: main process exited, code=exited, status=1/FAILURE
 Failed to start Docker Application Container Engine.

根据错误记录,确定是创建iptable的链路规则失败,然后查看iptables --list,会报 获取锁失败,

[root@custom-16-126 ~]# iptables --list
Another app is currently holding the xtables lock. Perhaps you want to use the -w option

这种情况一般是前面拿锁写规则的iptables进程没有返回,ps -ef 查看对应的进程,发现如下:

[root@custom-16-126 ~]# ps -ef |grep -i iptables
root 14967 14926 0 20:05 ? 00:00:00 /usr/sbin/iptables --wait -t nat -D PREROUTING -m addrtype --dst-type LOCAL -j DOCKER

iptables进程确实没有返回,

查看对应的堆栈和内核代码,确定nat模块需要依赖对应的conntrack模块:

int nf_nat_l3proto_register(const struct nf_nat_l3proto *l3proto)
{
    int err;

err = nf_ct_l3proto_try_module_get(l3proto->l3proto);

然后看对应为什么没有加载nf_conntrack-2,发现该环境上的nf_conntrack-2 被backlist了。

另外注意到一个很有趣的问题,在打点测试的时候,发现如下代码:

nf_ct_l3proto_try_module_get(unsigned short l3proto)
{
    int ret;
    struct nf_conntrack_l3proto *p;
retry:  p = nf_ct_l3proto_find_get(l3proto);
    if (p == &nf_conntrack_l3proto_generic) {
        ret = request_module("nf_conntrack-%d", l3proto);
        if (!ret)
            goto retry;
        return -EPROTOTYPE;
    }
    return 0;
}
这里retry应该是有问题的,如果request的nf_conntrack模块被backlist,则会出现一直不退出的情况,而这个流程中会不停提交work_struct到workqueue中,大量的无效work被执行。

docker启动失败问题的更多相关文章

  1. centos7下docker启动失败解决

    docker启动失败解决 could not change group /var/run/docker.sock to docker: gr... not found 如果出现:Job for doc ...

  2. docker启动失败如何查看容器日志

    docker启动失败如何查看容器日志 在使用docker的时候,在某些未知的情况下可能启动了容器,但是过了没几秒容器自动退出了.这个时候如何排查问题呢? 通常碰到这种情况无非就是环境有问题或者应用有问 ...

  3. selinux导致docker启动失败

    1. 问题描述:一向运行正常的一群容器,突然有一天挂掉了,再也起不来,报错如下 Error response from daemon: devmapper: Error mounting '/dev/ ...

  4. SELinux 引起的 Docker 启动失败

    问题描述 Linux OS 版本 CentOS Linux release 7.2.1511 (Core) 启动Docker service docker start 启动失败信息 原因分析 Erro ...

  5. docker 启动失败 Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

    CentOS7安装docker,安装成功后,启动失败 提示: 我们可以看到此处它提示是Failed to start Docker Application Container Engine. 于是在网 ...

  6. SELinux导致的docker启动失败

    安装docker yum install -y docker 启动docker systemctl start docker 报错 Job for docker.service failed beca ...

  7. DOCKER启动失败Job for docker.service failed because the control process exited with error code. See "syste mctl status docker.service" and "journalctl -xe" for details.

    [root@localhost ~]# systemctl start docker Job for docker.service failed because the control process ...

  8. Docker启动失败

    报错信息: Job for docker.service failed because the control process exited with error code. See "sy ...

  9. Docker 启动失败Starting docker (via systemctl): Job for docker.service failed

    Starting docker (via systemctl):  Job for docker.service failed. See 'systemctl status docker.servic ...

随机推荐

  1. FlinkSQL源码阅读-schema管理

    在Flink SQL中, 元数据的管理分为三层: catalog-> database-> table, 我们知道Flink SQL是依托calcite框架来进行SQL执行树生产,校验,优 ...

  2. 测试平台系列(97) 完善执行case部分

    大家好~我是米洛! 我正在从0到1打造一个开源的接口测试平台, 也在编写一套与之对应的教程,希望大家多多支持. 欢迎关注我的公众号米洛的测开日记,获取最新文章教程! 回顾 上一节我们讨论了怎么结束一个 ...

  3. 入坑KeePass(一)安全桌面输入管理密钥后,不能输入中文

    坑一:设置了在安全桌面输入管理密钥后,重启电脑后今日keepass软件中不能输入中文: 解决方式:进入keepass软件中取消勾选,在重启软件就可以输入中文了.

  4. css设置元素背景透明度的2种方式

    更新记录 本文迁移自Panda666原博客,原发布时间:2021年7月9日. 设置元素的背景的透明度可以使用2种方式:方式1:opacity属性.方式2:使用rgba值.两种方式有一点差异,opaci ...

  5. flink窗口分类

    窗口分类 按照驱动类型分类 窗口本身是截取有界数据的一种方式,所以窗口一个非常重要的信息就是"怎样截取数据".换句话说,就是以什么标准来开发和结束数据的截取. 按照驱动类型分类主要 ...

  6. 【机器学习】数据准备--python爬虫

    前言 我们在学习机器学习相关内容时,一般是不需要我们自己去爬取数据的,因为很多的算法学习很友好的帮助我们打包好了相关数据,但是这并不代表我们不需要进行学习和了解相关知识.在这里我们了解三种数据的爬取: ...

  7. Python Excel 操作

    1.Excel Code import os import time import re import win32com.client def dealpath(pathname='') -> ...

  8. SAP Tree

    Effect picture Code as bellow *&---------------------------------------------------------------- ...

  9. 基于mysql实现group by取各分组最新一条数据

    准备数据 SQL语句 SELECT * FROM admin WHERE id IN ( SELECT MAX( id ) FROM admin GROUP BY order_id ); 查询结果:

  10. Learning Latent Graph Representations for Relational VQA

    The key mechanism of transformer-based models is cross-attentions, which implicitly form graphs over ...