我正在尝试使用cgconfigparser加载/etc/cgconfig.conf来配置jstorm的cgroup属性。
我的操作系统是ubuntu14.04,用户名是whaty,我已经安装了libcgroup1,cgroupbin,cgrouplite。/etc中没有cgconfig.conf,所以我手动创建它。
这是我的cgconfig.conf
mount {
cpu = /sys/fs/cgroup/cpu;
cpuset = /sys/fs/cgroup/cpuset;
}
group jstorm {
perm {
task {
uid = 1000;
gid = 1000;
}
admin {
uid = 1000;
gid = 1000;
}
}
cpuset {
cpuset.cpus = 0;
cpuset.mems = 0;
}
}
我尝试使用sudo cgconfigparser-l/etc/cgconfig.conf加载这个配置,结果显示:cgconfigparser;加载/etc/cgconfig.conf时出错:cgroup装载失败
这是我的/proc/cgroup:
# subsys_name hierarchy num_cgroups enabled
cpuset 12 5 1
cpu 3 5 1
cpuacct 0 1 1
memory 0 1 1
devices 0 1 1
freezer 0 1 1
blkio 0 1 1
perf_event 0 1 1
hugetlb 0 1 1
这是我的cgroup:
whaty@whaty:/sys/fs/cgroup$ ls
blkio cpu cpuacct cpuset devices freezer hugetlb memory perf_event systemd
以下是cgconfigparser的策略:
execve("/usr/sbin/cgconfigparser", ["cgconfigparser", "-l", "/etc/cgconfig.conf"], [/* 24 vars */]) = 0
brk(0) = 0x1421000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6499e62000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=98553, ...}) = 0
mmap(NULL, 98553, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6499e49000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libcgroup.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\2608\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=76872, ...}) = 0
mmap(NULL, 4640896, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f64997d4000
mprotect(0x7f64997e6000, 2093056, PROT_NONE) = 0
mmap(0x7f64999e5000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x11000) = 0x7f64999e5000
mmap(0x7f64999e7000, 2465920, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f64999e7000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\37\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1840928, ...}) = 0
mmap(NULL, 3949248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f649940f000
mprotect(0x7f64995ca000, 2093056, PROT_NONE) = 0
mmap(0x7f64997c9000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ba000) = 0x7f64997c9000
mmap(0x7f64997cf000, 17088, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f64997cf000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0po\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=141574, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6499e48000
mmap(NULL, 2217264, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f64991f1000
mprotect(0x7f649920a000, 2093056, PROT_NONE) = 0
mmap(0x7f6499409000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18000) = 0x7f6499409000
mmap(0x7f649940b000, 13616, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f649940b000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6499e47000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6499e45000
arch_prctl(ARCH_SET_FS, 0x7f6499e45b80) = 0
mprotect(0x7f64997c9000, 16384, PROT_READ) = 0
mprotect(0x7f6499409000, 4096, PROT_READ) = 0
mprotect(0x7f64999e5000, 4096, PROT_READ) = 0
mprotect(0x602000, 4096, PROT_READ) = 0
mprotect(0x7f6499e64000, 4096, PROT_READ) = 0
munmap(0x7f6499e49000, 98553) = 0
set_tid_address(0x7f6499e45e50) = 14211
set_robust_list(0x7f6499e45e60, 24) = 0
futex(0x7ffde9414310, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, 7f6499e45b80) = -1 EAGAIN (Resource temporarily unavailable)
rt_sigaction(SIGRTMIN, {0x7f64991f79f0, [], SA_RESTORER|SA_SIGINFO, 0x7f6499201340}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x7f64991f7a80, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7f6499201340}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
brk(0) = 0x1421000
brk(0x1442000) = 0x1442000
open("/etc/cgconfig.conf", O_RDONLY|O_CLOEXEC) = 3
mmap(NULL, 319488, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6499df7000
ioctl(3, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, 0x7ffde9413840) = -1 ENOTTY (Inappropriate ioctl for device)
fstat(3, {st_mode=S_IFREG|0644, st_size=411, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6499e61000
read(3, "mount {\n cpu = /sys/fs/cgr"..., 8192) = 411
read(3, "", 4096) = 0
read(3, "", 8192) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, 0x7ffde9413840) = -1 ENOTTY (Inappropriate ioctl for device)
close(3) = 0
munmap(0x7f6499e61000, 4096) = 0
stat("/sys/fs/cgroup/cpu", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
mount("cgroup", "/sys/fs/cgroup/cpu", "cgroup", 0, "cpu") = -1 EBUSY (Device or resource busy)
munmap(0x7f6499df7000, 319488) = 0
write(2, "cgconfigparser; error loading /e"..., 73cgconfigparser; error loading /etc/cgconfig.conf: Cgroup mounting failed
) = 73
exit_group(50021) = ?
+++ exited with 101 +++
似乎某个资源被占用并且很忙。我的配置有什么问题?
暂无答案!
目前还没有任何答案,快来回答吧!