How to resolve common Elasticsearch issues

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問


プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

要約

The KB describes some of the common issues that can occur for Elastic Search. Three of such issues are:

  • GC overhead issues 
  • Low Max file descriptors
  • Low  vm.max_map_count

環境

7.7.1

診断

  • GC overhead issues 

    2020-11-17 00:09:11,962 ERROR [search-indexing:thread-1]  c.a.b.i.s.i.e.DefaultIndexEventWorker Indexing - Failed for repository BAUFI/xjenkins (id: 7784) with error: Unexpected error occurred when requesting index state document (id=7784) the HTTP Status code is: 429
    com.atlassian.bitbucket.internal.search.indexing.exceptions.IndexException: Unexpected error occurred when requesting index state document (id=7784) the HTTP Status code is: 429
    Also , following events were recorded as well
    {code:java}
    2020-11-16T04:10:42,184][INFO ][o.e.m.j.JvmGcMonitorService] [bitbucket_bundled] [gc][260] overhead, spent [612ms] collecting in the last [1.3s]
    [2020-11-16T04:10:45,186][WARN ][o.e.m.j.JvmGcMonitorService] [bitbucket_bundled] [gc][263] overhead, spent [588ms] collecting in the last [1s]
    [2020-11-16T04:11:03,190][WARN ][o.e.m.j.JvmGcMonitorService] [bitbucket_bundled] [gc][281] overhead, spent [500ms] collecting in the last [1s]
    [2020-11-16T04:11:04,661][INFO ][o.e.m.j.JvmGcMonitorService] [bitbucket_bundled] [gc][282] overhead, spent [545ms] collecting in the last [1.4s]
    [2020-11-16T04:11:08,198][INFO ][o.e.m.j.JvmGcMonitorService] [bitbucket_bundled] [gc][285] overhead, spent [577ms] collecting in the last [1.5s]
    [2020-11-16T04:11:12,218][WARN ][o.e.m.j.JvmGcMonitorService] [bitbucket_bundled] [gc][289] overhead, spent [609ms] collecting in the last [1s]
    [2020-11-16T04:11:15,582][INFO ][o.e.m.j.JvmGcMonitorService] [bitbucket_bundled] [gc][292] overhead, spent [610ms] collecting in the last [1.3s]
    [2020-11-16T04:11:18,093][INFO ][o.e.m.j.JvmGcMonitorService] [bitbucket_bundled] [gc][294] overhead, spent [580ms] collecting in the last [1.5s]
    
  • Low Max file descriptors

    [bitbucket_bundled] max file descriptors [10240] for elasticsearch process is too low, increase to at least [65535]
    
  • Low  vm.max_map_count

    [2020-11-16T04:06:22,012][WARN ][o.e.b.BootstrapChecks    ] [bitbucket_bundled] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

原因

  • GC overhead issues : This issue is caused because Elasticsearch heap memory is not properly size to the size of the content available to index.

  • Low Max file descriptors:
     
    Elasticsearch uses a lot of file descriptors or file handles. Running out of file descriptors can be disastrous and will most probably lead to data loss. Make sure to increase the limit on the number of open files descriptors for the user running Elasticsearch to 65,536 or higher.

  • Low  vm.max_map_count: Elasticsearch uses a mmapfs directory by default to store its indices. The default operating system limits on mmap counts is likely to be too low, which may result in out of memory exceptions.

ソリューション

Low Max file descriptors: 

  • In order to increase the limit for the max file descriptors, please update the following parameter on both files /etc/systemd/user.conf and /etc/systemd/system.conf

    DefaultLimitNOFILE=65536 
  •  If the parameter does not exist in these files you simply need to add a new line. Update /etc/security/limits.conf with the following lines:

             *  soft    nofile  65536
             *  hard    nofile  65536
             elasticsearch   soft    nofile  65536
             elasticsearch   hard    nofile  65536
             elasticsearch   memlock unlimited
  •  Do not forget to re-login into the shell in order to get the limits applied.

Low  vm.max_map_count

  • Update /etc/sysctl.conf with:

    vm.max_map_count = 262144
    vm.swappiness = 1
    followed by:
    sudo sysctl -p 

GC overhead issues : 

最終更新日 2023 年 5 月 10 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.