legacy-knowledge-base
公開されました Sep. 10, 2025

ログに"Too Many Open Files"というエラーが表示されます

written-by

Emma Liu

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • "Too Many Open Files"というエラーがログに報告されます。
  • 以下に例を示します。
    2019-05-06 09:41:20,142 SEVERE [org.apache.tomcat.util.net.NioEndpoint] Socket accept failed
    java.io.IOException: Too many open files
    at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
    at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:422)
    at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:250)
    at org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:682)
    at java.lang.Thread.run(Thread.java:748)
    02/09/2019 23:45:52,531 ERROR [liferay/lcs_status-1][LCSLicenseManager:?] Unable to read LCSState java.io.FileNotFoundException: /opt/liferay-dxp-digital-enterprise-7.0-sp2/data/license/server/lcsState (Too many open files) 
    at java.io.RandomAccessFile.open0(Native Method)
    at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
    at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
    at com.liferay.portal.util.FileImpl.getBytes(FileImpl.java:545)
    at com.liferay.portal.kernel.util.FileUtil.getBytes(FileUtil.java:241)
    at com.liferay.portal.ee.license.LCSLicenseManager.f(Unknown Source)
    at com.liferay.portal.ee.license.LCSLicenseManager.a(Unknown Source)
    at com.liferay.portal.ee.license.messaging.LicenseMessageListener.doReceive(Unknown Source)
    at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
    at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
    at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:52)
    at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:756)
    at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:667)
    at java.lang.Thread.run(Thread.java:745)

注: 2 番目の LCSLicenseManager エラーは、ライセンス登録に影響を与える可能性があります。

環境

  • すべての Liferay バージョン

解決

  • この解決にはオペレーティングシステムの設定を変更する必要があります。Liferayサポートは、お客様のオペレーティングシステムに特化した指示やパラメータを提供することはできません。
  • このエラーは、オペレーティングシステムのオープンファイル制限が原因です。このエラーを解決するには、OSレベルのオープンファイル制限を増やしてください。以下に例を示します:
      ulimit -n 65535
    開いているファイルの数の制限を確認するには、次を実行します:
    ulimit -n
    ulimit を増やしても問題が解決しない場合は、サービスレベルのオープンファイル制限も増やす必要があるかもしれません。CentOS 7 および Red Hat 7 でのこの例は、次のサードパーティ Web サイトで確認できます:https://www.grumpyland.com/blog/231/changing-limits-for-services-with-centos-7-rhel-7-systemd/
  • LiferayがDocker上で動作している場合、Dockerコンテナ内では一般的にulimitコマンドでファイル制限を上書きすることができないので、次のどちらかの解決策を適応する必要があります:
    •  docker runの実行時に--ulimit nofile=1000:1000ように --ulimit フラグを渡します。
    • docker-composeオプションを追加します。
      ulimits:
      nofile:
      soft: 1000
      hard: 1000
did-this-article-resolve-your-issue

legacy-knowledge-base