(1)yum安装docker
[iyunv@namenode ~]# yum install docker-io
(2)启动docker
[root@localhost ~]# /etc/init.d/docker restart
停止 docker: [失败]
Starting docker: [确定]
[iyunv@namenode ~]# /etc/init.d/docker status
docker 已死,但 pid 文件仍存
问题2:缺少依赖的包
[iyunv@namenode ~]# docker -d
启动报错,日志查看如下
tail -f /var/log/docker
time="2015-03-09T16:05:29+08:00" level="info" msg="+job serveapi(unix:///var/run/docker.sock)"
time="2015-03-09T16:05:29+08:00" level="info" msg="WARNING: You are
running linux kernel version 2.6.32-431.el6.x86_64, which might be
unstable running docker. Please upgrade your kernel to 3.8.0."
time="2015-03-09T16:05:29+08:00" level="info" msg="Listening for HTTP on unix (/var/run/docker.sock)"
/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
(3)google后,解决办法如下
yum install device-mapper-event-libs
(4)重启docker
[iyunv@namenode ~]# /etc/init.d/docker restart
Stopping docker: [FAILED]
Starting docker: [ OK ]
[iyunv@namenode ~]# /etc/init.d/docker status
docker (pid 12503) is running...
问题2:cgroup 未挂载
启动docker,~$ sudo docker -d
INFO[0000] [graphdriver] using prior storage driver "aufs"
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
WARN[0000] Running modprobe bridge nf_nat failed with message: , error: exit status 1
WARN[0000] Your kernel does not support cgroup memory limit: mountpoint for memory not found
WARN[0000] mountpoint for cpu not found
FATA[0000] Error mounting devices cgroup: mountpoint for devices not found
为cgroup在宿主机上没有挂载。
vim /etc/fstab
none /sys/fs/cgroup cgroup defaults 0 0
重启服务器即可