Docker 安裝及內核升級

Docker安裝及centos內核升級linux

1.安裝docker

[root@gmdai ~]# sudo yum installhttp://mirrors.yun-idc.com/epel/6/i386/epel-release-6-8.noarch.rpmnginx

[root@gmdai ~]# sudo yum install docker-iogit

[root@gmdai ~]# service docker startdocker

[root@gmdai ~]# chkconfig docker onvim

[root@gmdai ~]# yum install git -ycentos

2.內核版本過低升級內核

[root@gmdai ~]# docker pulldaocloud.io/library/nginx:1.9.9   //pull鏡像時報錯讓執行docker -dapp

Cannot connect to the Docker daemon. Is 'docker-d' running on this host?ide

[root@gmdai ~]# docker -dui

WARN[0000] You are running linux kernel version2.6.32-431.el6.x86_64, which might be unstable running docker. Please upgradeyour kernel to 3.10.0.               //提示內核版本號過低this

INFO[0000] Listening for HTTP on unix(/var/run/docker.sock)

3.升級內核

rpm -ivh http://www.elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpm

yum --enablerepo=elrepo-kernelinstallkernel-ml -y

 

4.編輯grub.conf文件,修改Grub引導順序

 

vim /etc/grub.conf

# grub.conf generated by anaconda

#

# Note that you do not have to rerun grub aftermaking changes to this file

# NOTICE: You do not have a /boot partition. This means that

#         all kernel and initrd paths are relative to /, eg.

#         root (hd0,0)

#         kernel /boot/vmlinuz-version ro root=/dev/sda1

#         initrd /boot/initrd-[generic-]version.img

#boot=/dev/sda

default=0

timeout=5

splashp_w_picpath=(hd0,0)/grub/splash.xpm.gz

hiddenmenu

title CentOS (4.4.0-1.el6.elrepo.x86_64)

        root (hd0,0)

       kernel /vmlinuz-4.4.0-1.el6.elrepo.x86_64 ro root=/dev/mapper/vg_gmdai-lv_rootrd_NO_LUKS rd_LVM_LV=vg_gmdai/lv_swap rd_NO_MD rd_LVM_LV=vg_gmdai/lv_rootcrashkernel=auto.UTF-8 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet

       initrd /initramfs-4.4.0-1.el6.elrepo.x86_64.img

title CentOS (2.6.32-431.el6.x86_64)

       root (hd0,0)

       kernel /vmlinuz-2.6.32-431.el6.x86_64 roroot=/dev/mapper/vg_gmdai-lv_root rd_NO_LUKS rd_LVM_LV=vg_gmdai/lv_swap rd_NO_MDrd_LVM_LV=vg_gmdai/lv_root crashkernel=auto.UTF-8  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgbquiet

       initrd /initramfs-2.6.32-431.el6.x86_64.img

確認剛安裝好的內核在哪一個位置而後設置default0開始),通常新安裝的內核在第一個位置因此設置default=0

 

5、重啓,查看內核版本號

[root@gmdai ~]# uname -r

4.4.0-1.el6.elrepo.x86_64

相關文章
相關標籤/搜索