博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在升级过内核的机器上安装docker遇到的一个错误
阅读量:6548 次
发布时间:2019-06-24

本文共 5402 字,大约阅读时间需要 18 分钟。

  hot3.png

在升级到kernel-3.17的centos-6.5上安装docker,直接执行以下命令:

yum install golangyum install docker-iochkconfig add dockerservice docker start
但出现了以下错误:
[root@osd2 ~]# service docker startStarting cgconfig service: Error: cannot mount memory to /cgroup/memory: No such file or directory/sbin/cgconfigparser; error loading /etc/cgconfig.conf: Cgroup mounting failedFailed to parse /etc/cgconfig.conf                         [FAILED]Starting docker:	                                   [  OK  ][root@osd2 ~]# service docker start[root@osd2 ~]# service docker statusdocker dead but pid file exists
查了一下cgconfig:
[root@osd2 ~]#  /etc/init.d/cgconfig statusStopped[root@osd2 ~]# /etc/init.d/cgconfig startStarting cgconfig service: Error: cannot mount memory to /cgroup/memory: No such file or directory/sbin/cgconfigparser; error loading /etc/cgconfig.conf: Cgroup mounting failedFailed to parse /etc/cgconfig.conf                         [FAILED][root@osd2 ~]# ls /cgroup/blkio  devices  freezer  memory  net_cls
memory是有的,但就是出错,需要修改:
[root@osd2 ~]# cat /etc/cgconfig.conf##  Copyright IBM Corporation. 2007##  Authors:	Balbir Singh 
# This program is free software; you can redistribute it and/or modify it# under the terms of version 2.1 of the GNU Lesser General Public License# as published by the Free Software Foundation.## This program is distributed in the hope that it would be useful, but# WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.## See man cgconfig.conf for further details.## By default, mount all controllers to /cgroup/
mount { cpuset = /cgroup/cpuset; cpu = /cgroup/cpu; cpuacct = /cgroup/cpuacct;# memory = /cgroup/memory; devices = /cgroup/devices; freezer = /cgroup/freezer; net_cls = /cgroup/net_cls; blkio = /cgroup/blkio;}
再次启动cgconfig,一切正常。但重启docker,依然报错:
[root@osd2 ~]# service docker statusdocker dead but pid file exists[root@osd2 ~]# tailf /var/log/docker \nMon Jan  5 14:04:33 CST 2015\n2015/01/05 14:04:33 docker daemon: 1.3.2 39fa2fa/1.3.2; execdriver: native; graphdriver: [910cf963] +job serveapi(unix:///var/run/docker.sock)[910cf963] +job init_networkdriver()[info] Listening for HTTP on unix (/var/run/docker.sock)Unable to enable network bridge NAT: iptables failed: iptables -I POSTROUTING -t nat -s 172.17.42.1/16 ! -o docker0 -j MASQUERADE: iptables v1.4.7: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)Perhaps iptables or your kernel needs to be upgraded. (exit status 3)[910cf963] -job init_networkdriver() = ERR (1)2015/01/05 14:04:33  (exit status 3)
日志显示无法创建nat网桥,看了一下正常的docker环境和modules:
[root@lm backup]# lsmod | grep natebtable_nat             2009  0 ebtables               18135  1 ebtable_natiptable_nat             6051  1 nf_nat                 23316  2 ipt_MASQUERADE,iptable_natnf_conntrack_ipv4       9506  4 iptable_nat,nf_natnf_conntrack           80390  6 xt_conntrack,xt_state,ipt_MASQUERADE,iptable_nat,nf_nat,nf_conntrack_ipv4ip_tables              17831  3 iptable_nat,iptable_mangle,iptable_filter[root@lm backup]# find /lib/modules/2.6.32-504.1.3.el6.x86_64/ -name "*nat*"/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/net/ipv4/netfilter/nf_nat_proto_dccp.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/net/ipv4/netfilter/nf_nat_proto_udplite.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/net/ipv4/netfilter/nf_nat_ftp.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/net/ipv4/netfilter/nf_nat_proto_sctp.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/net/ipv4/netfilter/nf_nat_proto_gre.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/net/ipv4/netfilter/nf_nat_sip.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/net/ipv4/netfilter/nf_nat_tftp.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/net/ipv4/netfilter/nf_nat_pptp.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/net/ipv4/netfilter/nf_nat.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/net/ipv4/netfilter/iptable_nat.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/net/ipv4/netfilter/nf_nat_snmp_basic.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/net/ipv4/netfilter/nf_nat_amanda.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/net/ipv4/netfilter/nf_nat_h323.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/net/ipv4/netfilter/nf_nat_irc.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/net/bridge/netfilter/ebt_snat.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/net/bridge/netfilter/ebt_dnat.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/net/bridge/netfilter/ebtable_nat.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/net/sched/act_nat.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/drivers/net/natsemi.ko/lib/modules/2.6.32-504.1.3.el6.x86_64/kernel/drivers/net/phy/national.ko
编译过内核的环境:
[root@osd2 /]# lsmod | grep natebtable_nat             2071  0 ebtables               26518  1 ebtable_nat[root@osd2 modprobe.d]# find /lib/modules/3.17.4/ -name "*nat*"/lib/modules/3.17.4/kernel/net/sched/act_nat.ko/lib/modules/3.17.4/kernel/net/bridge/netfilter/ebt_snat.ko/lib/modules/3.17.4/kernel/net/bridge/netfilter/ebt_dnat.ko/lib/modules/3.17.4/kernel/net/bridge/netfilter/ebtable_nat.ko/lib/modules/3.17.4/kernel/drivers/net/ethernet/natsemi/lib/modules/3.17.4/kernel/drivers/net/ethernet/natsemi/natsemi.ko/lib/modules/3.17.4/kernel/drivers/net/phy/national.ko

缺少了nat模块,才引起了上述错误,需要重新编译内核或使用旧内核。

转载于:https://my.oschina.net/renguijiayi/blog/363873

你可能感兴趣的文章
.net开源工作流引擎ccflow表单数据返回值Pop分组模式和表格模式对比
查看>>
邮件安全与社会工程学
查看>>
Cheese : A tool to use your camera
查看>>
安装类问题
查看>>
js 查找文章中的关键字,并标红
查看>>
Java面试题-基础篇五
查看>>
死磕 java集合之TreeMap源码分析(四)-内含彩蛋
查看>>
华为路由器简单配置默认路由
查看>>
Tcp/IP详解
查看>>
是什么让我流眼泪
查看>>
linux系统下集成开发工具选择
查看>>
11.6 -11.9 MariaDB,Apache 安装
查看>>
linux shell 获取前一天日期的方法
查看>>
关于proxy_pass的参数路径问题
查看>>
Solr环境配置、中文分词、数据库做为索引源及索引操作
查看>>
R导入csv文本的中文乱码问题
查看>>
nagios搭建(三):nagios监控linux主机
查看>>
SSL通信协议运行机制
查看>>
MySQL 授权详解
查看>>
Git 概述
查看>>