1. 程式人生 > >centos7.3 docker升級

centos7.3 docker升級

docker

#升級操作系統,centos7直接升級到7.3

yum clean all

yum update


#升級內核

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

yum --enablerepo=elrepo-kernel install kernel-ml-devel kernel-ml -y

grub2-set-default 0

reboot


#安裝docker


wget https://download.docker.com/linux/centos/docker-ce.repo -P /etc/yum.repos.d/

yum install -y docker-ce


mkdir -p /data0/docker/var && ln -s /data0/docker/var /var/lib/docker


mkdir /etc/docker/

echo "

{

"storage-driver": "overlay2",

"storage-opts": [ "overlay2.override_kernel_check=true" ],

"registry-mirrors": ["https://pej3ico7.mirror.aliyuncs.com"],

"insecure-registries":["10.211.121.26:5000","10.211.121.9:5000"],

"live-restore" : false

}


" >> /etc/docker/daemon.json


systemctl start docker



關閉selinxu iptables networkmanager

需要註意/etc/resolve,關閉networkmanager後無法正常使用域名訪問。





報錯:

level=error msg="[graphdriver] prior storage driver devicemapper failed: devmapper: Base Device UUID and Filesystem verification failed: devicemapper: Can‘t set cookie dm_task_set_cookie failed"

Aug 17 08:35:42 cephnode2 dockerd: Error starting daemon: error initializing graphdriver: devmapper: Base Device UUID and Filesystem verification failed: devicemapper: Can‘t set cookie dm_task_set_cookie failed


解決:

echo ‘y‘ | sudo dmsetup udevcomplete_all



docker 重啟後:

kernel:unregister_netdevice: waiting for lo to become free. Usage count = 1




rancher 災備測試:


26server 刪除重啟 外掛數據庫 ,重新啟動server進程, 創建的swarm 業務不受影響。




本文出自 “Devops” 博客,請務必保留此出處http://devops9527.blog.51cto.com/2419132/1969728

centos7.3 docker升級