我正在构建一个 solr 服务器(在 Ubuntu 18.04 上,使用 repo solr-common 和 solr-jetty)。启动时,solr 报告 nfile 和 nproc (1024, 6721 resp) 设置得太低。我运行systemctl edit solr
并创建了一个覆盖,如下所示:
[Service]
LimitNOFILE=65000
LimitNPROC=65000
然后我重新启动了服务 - solr 仍然报告同样的问题。
我添加了 /etc/security/limits.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=65000
Solr 不再抱怨文件限制,但仍在抱怨进程限制。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 CD 放在哪里了?
更新 3
事实证明,这不再是打包好的 solr。我不知道,有人在使原始版本正常工作时遇到问题,并在互联网上找到了有关如何从 tarball 安装的教程。所以我现在有一个半 tarball/半 repo solr 的系统,我们无法修补/升级。