Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker create container failed: mkdir: cannot create directory '/sys/fs/cgroup/memory/test': Cannot allocate memory #3

Open
tmon546596046 opened this issue Jan 20, 2021 · 3 comments
Assignees

Comments

@tmon546596046
Copy link

tmon546596046 commented Jan 20, 2021

issue

OS

Centos 7.6

description:

# ls /sys/kernel/slab | wc -l 
740564
@tmon546596046 tmon546596046 self-assigned this Jan 20, 2021
@tmon546596046
Copy link
Author

we think this is a kernel bug for memory accounts.
https://zhuanlan.zhihu.com/p/106757502
docker/for-linux#841

@tmon546596046
Copy link
Author

方法一
业务层不使用 kmem 特性,比如 kubelet 需要使用 nokmem BUILDTAG 来编译,具体可以参见 https://pingcap.com/blog/try-to-fix-two-linux-kernel-bugs-while-testing-tidb-operator-in

方法二
但不是所有的场景都方便关闭 kmem 使用。比如容器中创建 k8s 集群测试。此时,可以在内核层全局使用 "cgroup.memory=nokmem" 参数关闭。

注意,内核需要升级到 CentOS 7.6 的最新版(当前为: 3.10.0-1062.12.1.el7.x86_64) ,以修复 SLAB 泄露问题。

方法三
若系统发行版可以升级,建议直接升级到 CentOS 8 。内核为 4.x 版本,cgroup 相关实现各方面都健壮许多。

从 RedHat 的 Issue 中,据说问题在 7.8 的 kernel-3.10.0-1075.el7 最终修复了。等 CentOS 7.8 发布后,也是一个选择。

@tmon546596046
Copy link
Author

the issue is still open. we need to track it. docker/for-linux#841

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant