cgroup安装问题
[root@centos-lege ~]# yum install libcgroup
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
.....
Installed:
libcgroup.x86_64 0:0.40.rc1-15.el6_6
Complete!
[root@centos-lege ~]# /etc/init.d/cgconfig status
Stopped
[root@centos-lege ~]# /etc/init.d/cgconfig start
Starting cgconfig service: Error: cannot mount memory to /cgroup/memory: 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]
安装报错但是/cgroup下有memory文件
[root@centos-lege ~]# cd /cgroup/
[root@centos-lege cgroup]# ls
memory
[root@centos-lege cgroup]# vim /etc/cgconfig.conf
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;
}
把其注释掉
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;
}
[root@centos-lege cgroup]# /etc/init.d/cgconfig start
Starting cgconfig service: [ OK ]
这是为什么啊!!!!!!
苦寻一下午终于解决问题了!!!
内核版本过高所致
原内核为3.10将内核降为2.6.32安装启动就没问题
[root@centos-lege cgroup]# uname -a
Linux centos-lege 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
[root@centos-lege ~]# /etc/init.d/cgconfig start
Starting cgconfig service: [ OK ]
此时将另一个虚拟机文件拷贝到本地然后执行命令安装lxc
scp root@192.168.170.134:/root/lxc-0.9.0.tar.gz
ping 192.168.170.134
scp root@192.168.170.134:/root/lxc-0.9.0.tar.gz /root
ls
tar -xvf lxc-0.9.0.tar.gz
ls
cd lxc-0.9.0
ls
./configure
make
make install
lxc-checkconfig
ifconfig
man lxc-execute
cd
测试是否安装完成
lxc-execute -n test /bin/echo "hello lege"
ok!!!!