Centos cgconfig fails to start

牧云@^-^@ 提交于 2019-12-12 10:24:13

问题


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


回答1:


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, e.g.:

$ 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




回答2:


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.



来源:https://stackoverflow.com/questions/28796622/centos-cgconfig-fails-to-start

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!