安装指定版本的docker服务
参考博客:Docker CE 镜像源站
参考博客:docker启动异常driver not supported
1. 说明
之前部署docker服务的时候都是安装最新的docker版本,并使用docker swarm部署大数据组件。
但是在近期的一次部署发现 docker 18.06.1 版本,在使用docker swarm部署大数据组件的时候namenode存储的datanode信息不正确。原因是 18.06.1 版本中的docker swarm 存在一个LB网络,造成了该问题。
这个问题对于Hadoop本身是没有任何问题的,但是当我们启动hbase的时候却有问题了。通过日志发现hbase找不到datanode的节点信息,因为hbase得到的是LB的IP而不是datanode本身的IP,最终导致hbase启动失败。
最后解决的方案就是docker版本回退到 17.09.0 版本,该版本不存在LB网络。Hadoop的namenode中存储的datanode信息是正确的。
1 [root@mini03 docker-swarm]# docker -v 2 Docker version 18.06.1-ce, build e68fc7a 3 [root@mini03 docker-swarm]# docker network ls 4 NETWORK ID NAME DRIVER SCOPE 5 f28f7ab2d811 bridge bridge local 6 51c95dea1e5c docker_gwbridge bridge local 7 7a7e31f4bce8 host host local 8 3cxch31bl38k ingress overlay swarm 9 5ea08e9a282f none null local 10 pwk7oy2h3gnp zhang overlay swarm # 自己创建的网络 11 [root@mini03 docker-swarm]# docker network inspect zhang 12 ……………… 13 "Containers": { 14 "a9e2e20c89bb6fbc2984a19c4c8e9f9500f3360f2b0434819fc31a143cbc7fc9": { 15 "Name": "visualizer_visualizer.1.0lgaqosyogoy0edkqdakeycz4", 16 "EndpointID": "2cae08f3a1a63eadff6fee675e249ce19956dcc1d871329c90056a1829abc1d1", 17 "MacAddress": "02:42:0a:00:00:04", 18 "IPv4Address": "10.0.0.4/24", 19 "IPv6Address": "" 20 }, 21 "lb-zhang": { 22 "Name": "zhang-endpoint", 23 "EndpointID": "44ed04b5768dd4ae9edf2e63bded8d5ab5af7cb43d49a4d0d4fbd999abfd5373", 24 "MacAddress": "02:42:0a:00:00:02", 25 "IPv4Address": "10.0.0.2/24", 26 "IPv6Address": "" 27 } 28 }, 29 ………………
2. docker安装指定版本
1 # 安装必要的一些系统工具 2 [root@mini02 tools]# yum install -y yum-utils device-mapper-persistent-data lvm2 3 # 添加软件源信息 4 [root@mini02 tools]# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo 5 # 查看可安装的版本信息 6 [root@mini02 tools]# yum makecache fast 7 [root@mini02 tools]# yum list docker-ce.x86_64 --showduplicates | sort -r 8 * updates: mirrors.aliyun.com 9 Loading mirror speeds from cached hostfile 10 Loaded plugins: fastestmirror 11 * extras: mirrors.aliyun.com 12 * epel: mirrors.aliyun.com 13 docker-ce.x86_64 18.06.1.ce-3.el7 docker-ce-stable 14 docker-ce.x86_64 18.06.0.ce-3.el7 docker-ce-stable 15 docker-ce.x86_64 18.03.1.ce-1.el7.centos docker-ce-stable 16 docker-ce.x86_64 18.03.0.ce-1.el7.centos docker-ce-stable 17 docker-ce.x86_64 17.12.1.ce-1.el7.centos docker-ce-stable 18 docker-ce.x86_64 17.12.0.ce-1.el7.centos docker-ce-stable 19 docker-ce.x86_64 17.09.1.ce-1.el7.centos docker-ce-stable 20 docker-ce.x86_64 17.09.0.ce-1.el7.centos docker-ce-stable 21 docker-ce.x86_64 17.06.2.ce-1.el7.centos docker-ce-stable 22 docker-ce.x86_64 17.06.1.ce-1.el7.centos docker-ce-stable 23 docker-ce.x86_64 17.06.0.ce-1.el7.centos docker-ce-stable 24 docker-ce.x86_64 17.03.3.ce-1.el7 docker-ce-stable 25 docker-ce.x86_64 17.03.2.ce-1.el7.centos docker-ce-stable 26 docker-ce.x86_64 17.03.1.ce-1.el7.centos docker-ce-stable 27 docker-ce.x86_64 17.03.0.ce-1.el7.centos docker-ce-stable 28 # 安装指定版本的docker服务 29 [root@mini02 tools]# yum -y install docker-ce-17.09.0.ce-1.el7.centos 30 # 版本信息查看 31 [root@mini02 tools]# docker -v 32 Docker version 17.09.0-ce, build afdb6d4
3. 加入开机自启动
1 [root@mini02 tools]# systemctl status docker 2 ● docker.service - Docker Application Container Engine 3 Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled) 4 Active: inactive (dead) 5 Docs: https://docs.docker.com 6 ……………… 7 [root@mini02 tools]# systemctl enable docker.service # 加入开机自启动 8 Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
4. 问题解决
1 [root@mini02 tools]# systemctl start docker 2 Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details. 3 [root@mini02 tools]# journalctl -xe # 查询具体信息 4 -- Defined-By: systemd 5 -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel 6 -- 7 -- Unit docker.service has begun starting up. 8 Nov 01 17:40:55 mini02 dockerd[2493]: time="2018-11-01T17:40:55.181209947+08:00" level=info msg="libcontainerd: new containerd process, pid: 2501" 9 Nov 01 17:40:56 mini02 dockerd[2493]: time="2018-11-01T17:40:56.187023899+08:00" level=error msg="[graphdriver] prior storage driver overlay2 failed: driver not supported" 10 Nov 01 17:40:56 mini02 dockerd[2493]: Error starting daemon: error initializing graphdriver: driver not supported 11 Nov 01 17:40:56 mini02 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE 12 Nov 01 17:40:56 mini02 systemd[1]: Failed to start Docker Application Container Engine. 13 -- Subject: Unit docker.service has failed 14 -- Defined-By: systemd 15 -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel 16 ……………… 17 # 具体信息如下截图,解决方法如下,之后就可以正常起docker服务了 18 [root@mini02 tools]# mv /var/lib/docker /var/lib/docker.old