TRANG CHỦ / TÀI LIỆU / CHI TIẾT TÀI LIỆU
Đăng bởi: baotd | 28/11/2015 12:36
[root@pcs ~]# uname -r
2.6.32-042stab106.4
[root@pcs ~]# lsmod | awk '$1=="veth" || $1=="bridge"' veth 4866 0 bridge 85143 0
[root@pcs ~]# vzctl create <CTID> --ostemplate centos-7-x86_64
[root@pcs ~]# vzctl set <CTID> --netif_add eth0 --save [root@pcs ~]# vzctl set <CTID> --ifname eth0 --ipadd <IP>/<Netmask> --gw <GatewayIP> --save
[root@pcs ~]# vzctl set <CTID> --features bridge:on --save [root@pcs ~]# vzctl set <CTID> --netfilter full --save [root@pcs ~]# vzctl set <CTID> --devnodes net/tun:rw –save
[root@pcs ~]# yum install docker-centos-7-x86_64-ez
[root@pcs ~]# vzctl start <CTID> [root@pcs ~]# vzpkg install <CTID> docker
[root@pcs ~]# vzctl set <CTID> --features bridge:on --save [root@pcs ~]# vzctl set <CTID> --netfilter full --save [root@pcs ~]# vzctl set <CTID> --devnodes net/tun:rw --save
[root@pcs ~]# vzctl mount <CTID> [root@pcs ~]# echo "JoinControllers=cpu,cpuacct,cpuset freezer,devices" >> /vz/root/<CTID>/etc/systemd/system.conf
[root@pcs ~]# modprobe veth
[root@pcs ~]# vzctl start <CTID>
[root@docker ~]# service docker start
[root@docker ~]# service docker start Redirecting to /bin/systemctl start docker.service Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details. [root@docker ~]# systemctl status docker.service docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled) Active: failed (Result: exit-code) since Fri 2015-04-03 17:24:05 NOVT; 9s ago Docs: http://docs.docker.com Process: 544 ExecStart=/usr/bin/docker -d $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY (code=exited, status=1/FAILURE) Main PID: 544 (code=exited, status=1/FAILURE) Apr 03 17:24:05 docker.host docker[544]: time="2015-04-03T17:24:05+06:00" level="info" msg="+job serveapi(unix:///var/run/docker.sock)" Apr 03 17:24:05 docker.host docker[544]: time="2015-04-03T17:24:05+06:00" level="info" msg="+job init_networkdriver()" Apr 03 17:24:05 docker.host docker[544]: inappropriate ioctl for device Apr 03 17:24:05 docker.host docker[544]: time="2015-04-03T17:24:05+06:00" level="info" msg="-job init_networkdriver() = ERR (1)" Apr 03 17:24:05 docker.host docker[544]: time="2015-04-03T17:24:05+06:00" level="fatal" msg="inappropriate ioctl for device"
[root@pcs ~]# vzctl set <CTID> --features "bridge:on" --save
[root@docker ~]# systemctl status docker.service docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled) Active: failed (Result: exit-code) since Fri 2015-04-03 17:27:17 NOVT; 3s ago Docs: http://docs.docker.com Process: 445 ExecStart=/usr/bin/docker -d $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY (code=exited, status=1/FAILURE) Main PID: 445 (code=exited, status=1/FAILURE) Apr 03 17:24:05 docker.host docker[544]: time="2015-04-03T17:24:05+06:00" level="info" msg="+job serveapi(unix:///var/run/docker.sock)" Apr 03 17:24:05 docker.host docker[544]: time="2015-04-03T17:24:05+06:00" level="info" msg="+job init_networkdriver()" Apr 03 17:24:05 docker.host docker[544]: inappropriate ioctl for device Apr 03 17:24:05 docker.host docker[544]: time="2015-04-03T17:24:05+06:00" level="info" msg="-job init_networkdriver() = ERR (1)" Apr 03 17:24:05 docker.host docker[544]: time="2015-04-03T17:24:05+06:00" level="fatal" msg="inappropriate ioctl for device" Apr 03 17:27:17 docker.host docker[445]: time="2015-04-03T17:27:17+06:00" level="info" msg="+job serveapi(unix:///var/run/docker.sock)" Apr 03 17:27:17 docker.host docker[445]: time="2015-04-03T17:27:17+06:00" level="info" msg="Listening for HTTP on unix (/var/run/docker.sock)" Apr 03 17:27:17 docker.host docker[445]: time="2015-04-03T17:27:17+06:00" level="info" msg="+job init_networkdriver()" Apr 03 17:27:17 docker.host docker[445]: Unable to enable network bridge NAT: iptables failed: iptables --wait -I POSTROUTING -t nat -s 172.17.42.1/16 ! -o doc...to insmod?) Apr 03 17:27:17 docker.host docker[445]: Perhaps iptables or your kernel needs to be upgraded. Apr 03 17:27:17 docker.host docker[445]: (exit status 3) Apr 03 17:27:17 docker.host docker[445]: time="2015-04-03T17:27:17+06:00" level="info" msg="-job init_networkdriver() = ERR (1)" Apr 03 17:27:17 docker.host docker[445]: time="2015-04-03T17:27:17+06:00" level="fatal" msg=" (exit status 3)" Hint: Some lines were ellipsized, use -l to show in full.
[root@pcs ~]# vzctl set <CTID> --netfilter full --save
[root@docker ~]# docker run -i -t docker.io/centos "/bin/bash" FATA[0027] Error response from daemon: Cannot start container 384ecb8bd892ff2e0bb45b785ffbbf9243e2d62fa9380dcf1baa9374daf138c2: mountpoint for devices not found
[root@docker ~]# grep ^JoinControllers /etc/systemd/system.conf [root@docker ~]#
[root@docker ~]# grep ^JoinControllers /etc/systemd/system.conf JoinControllers=cpu,cpuacct,cpuset freezer,devices
[root@docker ~]# echo "JoinControllers=cpu,cpuacct,cpuset freezer,devices" >> /etc/systemd/system.conf [root@docker ~]# service docker restart
[root@docker ~]# docker run -i -t docker.io/centos "/bin/bash" FATA[0022] Error response from daemon: Cannot start container fa074c365b09d47050ff39d2ce9fc4af94b551a5fc33fbc1da6e8cdd52af003a: operation not supported
[root@pcs ~]# lsmod | grep veth [root@pcs ~]#