gpt4 book ai didi

mongodb: pthread_create 失败: errno:11

转载 作者:可可西里 更新时间:2023-11-01 10:29:43 29 4
gpt4 key购买 nike

我想在我的虚拟服务器 (CentOS 6) 上运行 sharelatex。我安装了所有东西,但 sharelatex 无法启动。 mongod.log 在接受一些连接后说:

2015-02-12T12:04:30.971+0100 [initandlisten] pthread_create failed: errno:11 Resource temporarily unavailable
2015-02-12T12:04:30.971+0100 [initandlisten] can't create new thread, closing connection

我已经增加了 ulimits:

[root@vServer]# ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 256270
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 21000
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 256270
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

谁能帮帮我?

编辑:我还检查了 mongod 进程的限制:

[root@vServer]# cat //proc/552/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 10485760 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 62848 62848 processes
Max open files 21000 21000 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 256270 256270 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us

编辑2:

这是 ulimit 的输出:

[root@vServer]# ulimit -Sa
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 256270
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 21000
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 256270
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

[root@vServer]# ulimit -Ha
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 256270
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 21000
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) unlimited
cpu time (seconds, -t) unlimited
max user processes (-u) 256270
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

但如您所见,我是以根用户身份登录的。不应该显示 cat//proc/552/limits 进程的实际限制吗?

最佳答案

我在 mongodb 的 /proc/sys/vm/max_map_count 内核参数方面遇到了问题。基本上 mongodb 正在尝试分配超过 65k 的内存映射,这是库存内核限制。

出现此问题时,错误与您发布的涉及 pthread_create 失败的错误相同。为了修复它,我只是以 root 身份执行了以下操作:

echo 2048000 > /proc/sys/vm/max_map_count

无论这是否有效,我强烈建议在 mongodb pid 上使用 strace 来尝试查看失败的地方。我不认为您看到的错误消息一定会引导您朝着正确的方向前进。

关于mongodb: pthread_create 失败: errno:11,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28477997/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com