刚刚安装了 MongoDB Ops Manager 的测试评估并在启动备份 HTTP 服务器时出现错误:
Migrate MMS data
Running migrations...[ OK ]
Start MMS server
Instance 0 starting..........[ OK ]
Start Backup HTTP Server
Instance 0 starting.......[FAILED]
2015-05-07T14:00:32.107+0000 [main] gid ERROR ServerMain:199 - Cannot start bslurp server [FATAL-EXITING] - instance: 0 - msg: unable to create new native thread
java.lang.OutOfMemoryError: unable to create new native thread
我似乎记忆力很好
[root@krh60621 ~]# free -m
total used free shared buffers cached
Mem: 15951 4588 11362 0 364 2021
我将最大进程数提升至无限制,看看是否有帮助……
[root@krh60621 ~]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 127421
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 94000
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) unlimited
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[root@krh60621 ~]# ps -eLF| grep -c java
593
[root@krh60621 ~]# ps -eLF| wc -l
1031
有什么想法吗?
答案1
我遇到了同样的问题,这个异常非常具有误导性。您需要更改 Linux 机器上的 ulimit 来修复此问题:
您可以使用以下命令检查 ulimits:
ulimits -a
并使用以下方法更改限制:
ulimit -n 64000
并尝试使用新的限制重新启动服务。