简体   繁体   English

Centos cgconfig无法启动

[英]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. 我需要在其中一台服务器上安装docker,并且每当我尝试启动docker服务时,由于cgconfig失败。 Cgconfig throws the following error: Cgconfig引发以下错误:

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: 我正在使用以下/etc/cgconfig.conf文件运行CentOS 6.5 Final:

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 : 要在新版本的CentOS上使用cgroups,您需要安装libcgroup以及libcgroup-tools

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

To create group use cgcreate , eg: 要创建组,请使用cgcreate ,例如:

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

To verify that /etc/cgconfig.conf is correct use cgconfigparser 要验证/etc/cgconfig.conf是否正确,请使用cgconfigparser

$ cgconfigparser -l /etc/cgconfig.conf

For details check: https://wiki.archlinux.org/index.php/cgroups 有关详细信息,请检查: https : //wiki.archlinux.org/index.php/cgroups

Note: In CentOS 6 and earlier versions one only needed to install libcgroup 注意:在CentOS 6和更早版本中,只需要安装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. 此错误可能是由于您正在使用的内核是通过cgroup_disable = memory 和/或 /etc/cgconfig.conf引导的,其中包含“ memory = / cgroup / memory”,在您的情况下,您可以通过注释掉“ memory = / cgroup”来解决此问题。 / memory”(来自cgconfig.conf)。

You can also refer 1 or 2 for more information. 您也可以参考12了解更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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