【问题标题】:Cassandra Too Many Open Files . Port diedCassandra 打开的文件太多。港口死亡
【发布时间】:2014-11-05 16:26:31
【问题描述】:

Cassandra 2.0 节点之一因“打开的文件过多”消息而崩溃。目前我们已将 nofile 限制设置为 32768,如 http://www.datastax.com/docs/1.0/install/recommended_settings 中所指定。

由于我们仍然看到错误,我们应该增加它吗?生产推荐值是多少?增加这个 nofile 限制有什么副作用吗?是什么导致打开的文件变大?

提前致谢。

【问题讨论】:

    标签: unix cassandra nosql


    【解决方案1】:

    您正在查看一份旧文件。来自 DataStax Recommended Production Settings 的当前文档(针对 2.x 版)表明应将 nofile 值设置为 100,000。

    打包安装:确保以下设置包含在 /etc/security/limits.d/cassandra.conf 文件:

    cassandra - memlock unlimited
    cassandra - nofile 100000
    cassandra - nproc 32768
    cassandra - as unlimited
    

    Tarball 安装:确保 /etc/security/limits.conf 文件中包含以下设置:

    * - memlock unlimited
    * - nofile 100000
    * - nproc 32768
    * - as unlimited
    

    如果您以 root 身份运行 Cassandra,某些 Linux 发行版(例如 Ubuntu)需要明确设置 root 权限,而不是使用 *:

    root - memlock unlimited
    root - nofile 100000
    root - nproc 32768
    root - as unlimited
    

    尝试一下,看看是否有帮助。

    【讨论】:

    • 我在 /etc/security/limits.conf 中进行了如下更改 * - memlock unlimited * - nofile 100000 * - nproc 32768 * - 作为无限制的 root - memlock 无限制的 root - nofile 100000 root - nproc 32768 根 - 无限。然后我做了 sysctl -p。当我运行 ulimt -n 我得到 100000 。但是当我执行 cat /proc/pid/limits 时,我仍然看到 32768。
    【解决方案2】:

    对于由systemctl管理的进程,请在

    中提供限制

    /etc/systemd/system/cassandra.service

    你必须改变

    限制NOFILE=100000

    然后执行

    sudo systemctl daemon-reload

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-08
      • 1970-01-01
      • 2012-05-09
      • 2011-07-18
      • 2019-10-30
      相关资源
      最近更新 更多