我正在构建一个solr服务器(在Ubuntu18.04上,使用回购solr通用和solr-jetty)。在启动时,solr报告说nfile和nproc (1024,6721 resp)设置得太低了。我运行了systemctl edit solr并创建了一个覆盖如下:
[Service]
LimitNOFILE=65000
LimitNPROC=65000然后我重新启动了服务- solr仍然报告了同样的问题。
我增加了/etc/security/limits.d.d/solr,其中包括:
solr hard nofile 65535
solr soft nofile 65535
solr hard nproc 65535
solr soft nproc 65535在重新启动服务之后,它仍然报告同样的问题:
# systemctl status solr
● solr.service - LSB: Controls Apache Solr as a Service
Loaded: loaded (/etc/init.d/solr; generated)
Drop-In: /etc/systemd/system/solr.service.d
└─override.conf
Active: active (exited) since Mon 2020-03-30 14:55:49 BST; 6s ago
Docs: man:systemd-sysv-generator(8)
Process: 6848 ExecStop=/etc/init.d/solr stop (code=exited, status=0/SUCCESS)
Process: 6973 ExecStart=/etc/init.d/solr start (code=exited, status=0/SUCCESS)
Mar 30 14:55:43 dev-a01-si-solr.bip solr[6973]: *** [WARN] *** Your open file limit is currently 1024.
Mar 30 14:55:43 dev-a01-si-solr.bip solr[6973]: It should be set to 65000 to avoid operational disruption.
Mar 30 14:55:43 dev-a01-si-solr.bip solr[6973]: If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
Mar 30 14:55:43 dev-a01-si-solr.bip solr[6973]: *** [WARN] *** Your Max Processes Limit is currently 6721.
Mar 30 14:55:43 dev-a01-si-solr.bip solr[6973]: It should be set to 65000 to avoid operational disruption.
Mar 30 14:55:43 dev-a01-si-solr.bip solr[6973]: If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
Mar 30 14:55:49 dev-a01-si-solr.bip solr[6973]: [194B blob data]
Mar 30 14:55:49 dev-a01-si-solr.bip solr[6973]: Started Solr server on port 8983 (pid=7045). Happy searching!
Mar 30 14:55:49 dev-a01-si-solr.bip solr[6973]: [14B blob data]
Mar 30 14:55:49 dev-a01-si-solr.bip systemd[1]: Started LSB: Controls Apache Solr as a Service.我在这里做错什么了?
修改/etc/systemd/system.conf后进行更新,以包含.
DefaultLimitNOFILE=65000
DefaultLimitNPROC=65000Solr不再抱怨文件限制,但仍然抱怨进程限制。WTF便餐?
Drop-In: /etc/systemd/system/solr.service.d
└─override.conf
Active: active (exited) since Mon 2020-03-30 15:21:59 BST; 14s ago
Docs: man:systemd-sysv-generator(8)
Process: 1141 ExecStart=/etc/init.d/solr start (code=exited, status=0/SUCCESS)
Mar 30 15:21:51 dev-a01-si-solr.bip solr[1141]: If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
Mar 30 15:21:51 dev-a01-si-solr.bip solr[1141]: *** [WARN] *** Your Max Processes Limit is currently 6721.
Mar 30 15:21:51 dev-a01-si-solr.bip solr[1141]: It should be set to 65000 to avoid operational disruption.
Mar 30 15:21:51 dev-a01-si-solr.bip solr[1141]: If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
Mar 30 15:21:51 dev-a01-si-solr.bip solr[1141]: Warning: Available entropy is low. As a result, use of the UUIDField, SSL, or any other features that require
Mar 30 15:21:51 dev-a01-si-solr.bip solr[1141]: RNG might not work properly. To check for the amount of available entropy, use 'cat /proc/sys/kernel/random/entropy_avail'.
Mar 30 15:21:59 dev-a01-si-solr.bip solr[1141]: [230B blob data]
Mar 30 15:21:59 dev-a01-si-solr.bip solr[1141]: Started Solr server on port 8983 (pid=1459). Happy searching!
Mar 30 15:21:59 dev-a01-si-solr.bip solr[1141]: [14B blob data]
Mar 30 15:21:59 dev-a01-si-solr.bip systemd[1]: Started LSB: Controls Apache Solr as a Service.修改user.conf以匹配没有帮助。
更新2--好吧,这只会越来越好。nfile警告的消失发生在主机重新启动之后。当我随后运行systemctl restart solr时,我得到了以下内容:
Mar 30 15:39:21 dev-a01-si-solr.bip solr[2503]: *** [WARN] *** Your open file limit is currently 1024.
Mar 30 15:39:21 dev-a01-si-solr.bip solr[2503]: It should be set to 65000 to avoid operational disruption.FFS!
我把Centos 5光盘放哪儿了?
事实证明,这不再是包装的solr。在我看来,有人在让最初的构建开始工作时遇到了问题,并在互联网上找到了一个关于如何从tarball安装的教程。所以我现在有了一个系统,它有半个tarball/半个repo solr,我们不能修补/升级。
发布于 2020-03-30 15:18:15
在Ubuntu18.04上,solr实际上是由从systemd调用的initV脚本启动的。
我已经消除了警告
1)删除/etc/security/limits.d s.d/solr,并在/etc/security/limits.d s.conf中添加以下内容:
* hard nofile 2048
* hard nproc 2048
root hard nofile unlimited
root soft nofile unlimited
root hard nproc unlimited
root soft nproc unlimited
solr hard nofile 65535
solr soft nofile 65535
solr hard nproc 65535
solr soft nproc 655352)将其添加到/etc/init.d/solr的顶部。
ulimit -n 65000
ulimit -u 65000(尽管-u行似乎没有做任何事情)
3)运行systemctl daemon-reload
( 4)重新启动
当我运行systemctl reload solr时,警告就会远离。
但我现在的配置机器人遍布各地,我需要修剪掉其中的一些。
https://serverfault.com/questions/1010086
复制相似问题