DOCKER安装以及使用

本文介绍docker安装过程中遇到的各种问题,以便后来者尽快解决
docker介绍:
[http://wiki.corp.qunar.com/pages/viewpage.action?pageId=136479630]

1.docker安装如下:

[lili.ai@l-qta13.h.beta.cn0 ~] sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'

[dockerrepo]

name=Docker Repository

baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/

enabled=1

gpgcheck=1

gpgkey=https://yum.dockerproject.org/gpg

EOF

之后更新 yum 软件源缓存,并安装 docker-engine

$ sudo yum update

$ sudo yum install \-y docker-engine

对于 CentOS 7 系统, CentOS-Extras 源中已内置 Docker,如果已经配置
了 CentOS-Extras 源,可以直接通过上面的 yum 命令进行安装。
qunar安装好之后,启动docker

sudo /usr/bin/docker \-d

2.安装后启动遇到的问题:

2.1会报以下错误:

[[email protected] ~]$ sudo /usr/bin/docker -d
WARN[0000] You are running linux kernel version 2.6.32-573.26.1.el6.x86_64, which might be unstable running docker. Please upgrade your kernel to 3.10.0. 
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) 
WARN[0001] Running modprobe bridge nf_nat failed with message: insmod /lib/modules/2.6.32-573.26.1.el6.x86_64/kernel/net/llc/llc.ko 
insmod /lib/modules/2.6.32-573.26.1.el6.x86_64/kernel/net/802/stp.ko 
install /sbin/modprobe --ignore-install bridge && /sbin/sysctl -q -w net.bridge.bridge-nf-call-arptables=0 net.bridge.bridge-nf-call-iptables=0 net.bridge.bridge-nf-call-ip6tables=0
insmod /lib/modules/2.6.32-573.26.1.el6.x86_64/kernel/net/bridge/bridge.ko 
insmod /lib/modules/2.6.32-573.26.1.el6.x86_64/kernel/net/ipv4/netfilter/nf_defrag_ipv4.ko 
insmod /lib/modules/2.6.32-573.26.1.el6.x86_64/kernel/net/netfilter/nf_conntrack.ko 
insmod /lib/modules/2.6.32-573.26.1.el6.x86_64/kernel/net/ipv4/netfilter/nf_conntrack_ipv4.ko 
insmod /lib/modules/2.6.32-573.26.1.el6.x86_64/kernel/net/ipv4/netfilter/nf_nat.ko 
, error: exit status 1
可以通过以下解决:

sudo ln \-s /sbin/iptables-multi /sbin/iptables \-f

修改之后再次运行docker,问题解决

2.2 问题如下

会报以下错误:

\[root@centos \~\]# docker \-d

INFO\[0000\] \+job serveapi(unix:///var/run/docker.sock)

INFO\[0000\] WARNING: You are running linux kernel version 2.6.32, which might be unstable running docker. Please upgrade your kernel to 3.8.0.

docker: relocation error: docker: symbol dm_task_get_info_with_deferred_remove, version Base not defined in file libdevmapper.so.1.02 with link time reference

根据提示,使用下面的命令安装缺少的数据包,

yum upgrade device-mapper-libs

如果提示无法更新,可先更新yum源,在更新这个包
进入yum源配置文件所在文件夹

cd /etc/yum.repos.d/

###下载163的yum源配置文件,放入/etc/yum.repos.d/(操作前请做好相应备份)

\[root@localhost /etc/yum.repos.d\]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

\[root@localhost /etc/yum.repos.d\]# yum makecache

\[root@localhost /etc/yum.repos.d\]# yum \-y update

然后再次更新device

yum upgrade device-mapper-libs

你可能感兴趣的:(大数据)