升级centos6.5内核至3.10及安装docker
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了升级centos6.5内核至3.10及安装docker相关的知识,希望对你有一定的参考价值。
一、升级内核
将版本为2.6.32-431.el6.x86_64的内核升级为3.10.5-3.el6.x86_64
1、安装autfs相关软件执行升级操作
[[email protected] yum.repos.d]# yum install kernel-ml-aufs kernel-ml-aufs-devel
2、修改内核默认启动顺序:
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
改为:
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
最终结果为:
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (3.10.5-3.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-3.10.5-3.el6.x86_64 ro root=UUID=5209c50c-75cb-479d-8cb3-2a60f6c2141f rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
initrd /initramfs-3.10.5-3.el6.x86_64.img
以上步骤操作完之后,重启系统确认内核版本
Last login: Sun May 22 14:52:31 2016 from 192.168.1.4
[[email protected] ~]# uname -r
3.10.5-3.el6.x86_64
[[email protected] ~]# grep aufs /proc/filesystems
nodev aufs
[[email protected] ~]#
二、安装docker
3、安装docker
[[email protected] opuser]# yum install docker-io -y
4、启动docker
[[email protected] ~]# /etc/init.d/docker start
Starting docker: [ OK ]
[[email protected] ~]#
5、查看启动状态:
[[email protected] ~]# /etc/init.d/docker status
docker (pid 1242) is running...
[[email protected] ~]#
6、查看日志:
\nSun May 22 07:43:13 CST 2016\n
time="2016-05-22T07:43:13.450506633+08:00" level=info msg="Listening for HTTP on unix (/var/run/docker.sock)"
time="2016-05-22T07:43:16.507928980+08:00" level=info msg="[graphdriver] using prior storage driver \"devicemapper\""
time="2016-05-22T07:43:16.624039450+08:00" level=warning msg="Running modprobe bridge nf_nat failed with message: insmod /lib/modules/3.10.5-3.el6.x86_64/kernel/net/llc/llc.ko \ninsmod /lib/modules/3.10.5-3.el6.x86_64/kernel/net/802/stp.ko \ninsmod /lib/modules/3.10.5-3.el6.x86_64/kernel/net/bridge/bridge.ko \ninsmod /lib/modules/3.10.5-3.el6.x86_64/kernel/net/netfilter/nf_conntrack.ko \ninsmod /lib/modules/3.10.5-3.el6.x86_64/kernel/net/netfilter/nf_nat.ko \n, error: exit status 1"
time="2016-05-22T07:43:17.580829694+08:00" level=warning msg="Your kernel does not support swap memory limit."
time="2016-05-22T07:43:17.583622267+08:00" level=info msg="Loading containers: start."
time="2016-05-22T07:43:17.583830796+08:00" level=info msg="Loading containers: done."
time="2016-05-22T07:43:17.583851803+08:00" level=info msg="Daemon has completed initialization"
time="2016-05-22T07:43:17.583881135+08:00" level=info msg="Docker daemon" commit="786b29d/1.7.1" execdriver=native-0.2 graphdriver=devicemapper version=1.7.1
[[email protected] ~]#
7、如果docker启动失败,而且日志中出现如下内容:
[[email protected] ~]# cat /var/log/docker
\nSun May 22 07:41:07 CST 2016\n
/usr/bin/docker: relocation error: /usr/bin/docker: symbol dm_task_get_info_with_deferred_remove, version Base not defined in file libdevmapper.so.1.02 with link time reference
[[email protected] ~]#
则需要安装: device-mapper-libs库
[[email protected] ~]# yum upgrade device-mapper-libs
至此将centos6.5内核从2.6.32-431.el6.x86_64升级到3.10.5-3.el6.x86_64
本文出自 “平平淡淡才是真” 博客,请务必保留此出处http://ucode.blog.51cto.com/10837891/1775978
以上是关于升级centos6.5内核至3.10及安装docker的主要内容,如果未能解决你的问题,请参考以下文章