简体   繁体   中英

Centos cgconfig fails to start

I need docker installed on one of my servers, and whenever I try to start the docker service, it fails because of cgconfig. Cgconfig throws the following error:

Starting cgconfig service: Error: cannot mount cpu to /cgroup/cpu: No such file or directory
/sbin/cgconfigparser; error loading /etc/cgconfig.conf: Cgroup mounting failed
Failed to parse /etc/cgconfig.conf or /etc/cgconfig.d      [FAILED]

I'm running CentOS 6.5 Final with the following /etc/cgconfig.conf file:

mount {
    cpuset  = /cgroup/cpuset;
    cpu     = /cgroup/cpu;
    cpuacct = /cgroup/cpuacct;
    memory  = /cgroup/memory;
    devices = /cgroup/devices;
    freezer = /cgroup/freezer;
    net_cls = /cgroup/net_cls;
    blkio   = /cgroup/blkio;
}

I appreciate any responses

To use cgroups on newer versions of CentOS you need to install libcgroup as well as libcgroup-tools :

$ sudo yum install libcgroup
$ sudo yum install libcgroup-tools

To create group use cgcreate , eg:

$ sudo cgcreate -g memory,cpu,blkio,cpuset:userlimited

To verify that /etc/cgconfig.conf is correct use cgconfigparser

$ cgconfigparser -l /etc/cgconfig.conf

For details check: https://wiki.archlinux.org/index.php/cgroups

Note: In CentOS 6 and earlier versions one only needed to install libcgroup

This error may be due to kernel you are using is booted with cgroup_disable=memory and/or /etc/cgconfig.conf contains "memory=/cgroup/memory", in your case you may solve this by commenting out "memory = /cgroup/memory" from cgconfig.conf.

You can also refer 1 or 2 for more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM