首页 > 解决方案 > Max Processes Limit 当前为 31196,应设置为 65000 以避免操作中断

问题描述

我正在尝试在 solr 中使用 ltr(learning to rank) 并按照 文档中提到的步骤进行操作

当我运行bin/solr start -e techproducts -Dsolr.ltr.enabled=true 它显示此错误

*** [WARN] ***  Your Max Processes Limit is currently 31196. 
It should be set to 65000 to avoid operational disruption. 
If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh. 

我试图增加进程的数量,ulimit -u 65535但它拒绝操作

bash: ulimit: max user processes: cannot modify limit: Operation not permitted

我坚持下去,如果有人知道请帮帮我,找不到解决方案。提前致谢

标签: apachesolr

解决方案


尝试以 root 用户身份运行此命令。它将配置附加到限制文件以使其工作。

nofile 是打开文件限制的数量

nproc 是进程数限制

# Increase number of open files. must be run as root
sudo su -
echo '* hard nofile 500000' >> /etc/security/limits.conf
echo '* soft nofile 500000' >> /etc/security/limits.conf
echo 'root hard nofile 500000' >> /etc/security/limits.conf
echo 'root hard nofile 500000' >> /etc/security/limits.conf

echo 'fs.file-max = 2097152' >> /etc/sysctl.conf

# set the processes/threads limit
sudo vi /etc/security/limits.d/20-nproc.conf
# * soft nproc 122944

注意:打开文件限制取决于服务器的 RAM 大小

对于域特定设置 /etc/security/limits.d/20-nproc.conf 将覆盖 /etc/security/limits.conf 配置。

要完成这项工作,您应该重新启动sudo reboot或关闭所有活动会话窗口,因为它们仍将保持在会话中。


推荐阅读