judoole
judoole

Reputation: 1422

Docker on RHEL 6 Cgroup mounting failing

I'm trying to get my head around something that's been working on a Centos+Vagrant, but not on our providers RHEL (Red Hat Enterprise Linux Server release 6.5 (Santiago)). A sudo service docker restart hands this:

Stopping docker:                                             [  OK  ]
Starting cgconfig service: Error: cannot mount cpuset to /cgroup/cpuset: Device or resource busy
/sbin/cgconfigparser; error loading /etc/cgconfig.conf: Cgroup mounting failed
Failed to parse /etc/cgconfig.conf                           [FAILED]

Starting docker:                                              [  OK  ]

The service starts okey enough, but images cannot run. A mounting failed error is shown when I try. And the startup-log also gives a warning or two. Regarding the kernelwarning, centos gives the same and has no problems as Epel should resolve this:

WARNING: You are running linux kernel version 2.6.32-431.17.1.el6.x86_64, which might be unstable running docker. Please upgrade your kernel to 3.8.0.
2014/08/07 08:58:29 docker daemon: 1.1.2 d84a070; execdriver: native; graphdriver:
[1233d0af] +job serveapi(unix:///var/run/docker.sock)
[1233d0af] +job initserver()
[1233d0af.initserver()] Creating server
2014/08/07 08:58:29 Listening for HTTP on unix (/var/run/docker.sock)
[1233d0af] +job init_networkdriver()
[1233d0af] -job init_networkdriver() = OK (0)
2014/08/07 08:58:29 WARNING: mountpoint not found

Anyone had any success overcoming this problem or should I throw in the towel and wait for the provider to update to RHEL 7?

Upvotes: 13

Views: 16255

Answers (7)

sfcuboy
sfcuboy

Reputation: 11

it seems like the cgconfig service not running,so check it!

# /etc/init.d/cgconfig status
# mkdir -p /cgroup/cpuacct /cgroup/memory /cgroup/devices /cgroup/freezer net_cls /cgroup/blkio
# cat /etc/cgconfig.conf |tail|grep "="|awk '{print "mount -t cgroup -o",$1,$1,$NF}'>cgroup_mount.sh
# sh ./cgroup_mount.sh
# /etc/init.d/cgconfig restart
# /etc/init.d/docker restart

Upvotes: 1

Abc Xyz
Abc Xyz

Reputation: 1424

In my case

/etc/rc.d/rc.cgconfig start

was generating

Starting cgconfig service: Error: cannot mount cpu,cpuacct,memory to /cgroup/cpu_and_mem: Device or resource busy /usr/sbin/cgconfigparser; error loading /etc/cgconfig.conf: Cgroup mounting failed Failed to parse /etc/cgconfig.conf

i had to use:

/etc/rc.d/rc.cgconfig restart

and it automagicly umouted and mounted groups

Stopping cgconfig service: Starting cgconfig service:

Upvotes: 1

tonysok
tonysok

Reputation: 677

I have the same issue.

enter image description here

(1) check cgconfig status

# /etc/init.d/cgconfig status

if it stopped, restart it

# /etc/init.d/cgconfig restart

check cgconfig is running

enter image description here

(2) check cgconfig is on

# chkconfig --list cgconfig

cgconfig 0:off 1:off 2:off 3:off 4:off 5:off 6:off

if cgconfig is off, turn it on

enter image description here

(3) if still does not work, may be some cgroups modules is missing. In the kernel .config file, make menuconfig, add those modules into kernel and recompile and reboot

after that, it should be OK

enter image description here

Upvotes: 8

huoy
huoy

Reputation: 11

So I spent the whole day trying to rig docker to work on my vps. I was running into this same error. Basically what it came down to was the fact that OpenVZ didn't support docker containers up until a couple months ago. Specifically this RHEL update:

https://openvz.org/Download/kernel/rhel6/042stab105.14

Assuming this is your problem, or some variation of it, the burden of solving it is on your host. They will need to follow these steps:

https://openvz.org/Docker_inside_CT

Upvotes: 1

jordanpg
jordanpg

Reputation: 6516

The cgconfig service startup uses mount and umount which requires an extra privilege bump from docker.

See the --privileged=true flag here for more info.

I was able to overcome this issue by starting my container with:
docker run -it --privileged=true my-image.

Tested in Centos6, Centos6.5.

Upvotes: 0

Brian Lund Larsen
Brian Lund Larsen

Reputation: 56

This situation occurs when the kernel is booted with cgroup_disable=memory and /etc/cgconfig.conf contains memory = /cgroup/memory;

This causes only /cgroup/cpuset to be mounted instead of the full set.

Solution: either remove cgroup_disable=memory from your kernel boot options or comment out memory = /cgroup/memory; from cgconfig.conf.

Upvotes: 0

judoole
judoole

Reputation: 1422

I ended up asking the same question at Google Groups and in the end finding a solution with some help. What worked for me was this:

umount cgroup
sudo service cgconfig start

The project of making Docker work was put on halt all the same. Later a problem of network connection for the containers. This took to much time to solve and had to give up.

Upvotes: 1

Related Questions