AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1010086
Accepted
symcbean
symcbean
Asked: 2020-03-31 06:06:02 +0800 CST2020-03-31 06:06:02 +0800 CST 2020-03-31 06:06:02 +0800 CST

systemctl 限制 - solr 抱怨

  • 772

我正在构建一个 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 的系统,我们无法修补/升级。

ubuntu limits systemd
  • 1 1 个回答
  • 3245 Views

1 个回答

  • Voted
  1. Best Answer
    symcbean
    2020-03-31T07:18:15+08:002020-03-31T07:18:15+08:00

    在 Ubuntu 18.04 上,solr 实际上是由从 systemd 调用的 initV 脚本启动的。

    我已经摆脱了警告

    1) 删除 /etc/security/limits.d/solr 并在 /etc/security/limits.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 65535
    

    2) 将此添加到 /etc/init.d/solr 的顶部

    ulimit -n 65000
    ulimit -u 65000
    

    (虽然 -u 行似乎没有做任何事情)

    3) 运行systemctl daemon-reload

    4)进行硬重启

    当我跑步时,警告就会消失systemctl reload solr。

    但是我现在到处都有配置机器人,我需要删除其中的一些。

    • 1

相关问题

  • 无法通过 Ubuntu VPN 访问外部网络

  • ubuntu apt-get upgrade - 如何在 shell 中单击确定?

  • VirtualBox 上 Ubuntu 的访客优化技巧 [关闭]

  • 外部硬盘上的 virtualbox 虚拟硬盘驱动器(Vista 主机上的 ubuntu 客户机)

  • 如何在 Ubuntu 上挂载 LVM 分区?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve