Elasticsearch Guide

Slurm provides multiple Job Completion Plugins.
Slurmは、複数のジョブ完了プラグインを提供します。
These plugins are an orthogonal way to provide historical job accounting data for finished jobs.
これらのプラグインは、完了したジョブの履歴ジョブアカウンティングデータを提供するための直交する方法です。

In most installations, Slurm is already configured with an AccountingStorageType plugin — usually slurmdbd.
ほとんどのインストールでは、SlurmはAccountingStorageTypeプラグイン(通常はslurmdbd)ですでに構成されています。
In these situations, the information captured by a completion plugin is intentionally redundant.
このような状況では、完了プラグインによってキャプチャされた情報は意図的に冗長になります。

The jobcomp/elasticsearch plugin can be used together with a web layer on top of the Elasticsearch server — such as Kibana — to visualize your finished jobs and the state of your cluster.
jobcomp / elasticsearchプラグインをElasticsearchサーバー上のWebレイヤー(Kibanaなど)と一緒に使用して、完了したジョブとクラスターの状態を視覚化できます。
Some of these visualization tools also let you easily create different types of dashboards, diagrams, tables, histograms and/or apply customized filters when searching.
これらの視覚化ツールの中には、さまざまな種類のダッシュボード、図、表、ヒストグラムを簡単に作成したり、検索時にカスタマイズされたフィルターを適用したりできるものもあります。

Configuration

The plugin requires the libcurl library to be installed and usable on the controller, and the development libraries to be available at configure time.
プラグインでは、libcurlライブラリがインストールされてコントローラーで使用可能であり、開発ライブラリが構成時に使用可能である必要があります。
At Slurm configuration time, the configure script should emit a message like this if the appropriate library and headers have been successfully located:
Slurmの設定時に、適切なライブラリとヘッダーが正常に見つかった場合、configureスクリプトは次のようなメッセージを出力する必要があります。

checking whether libcurl is usable... yes
There are two configure options to control whether to look for the library or not and where:
ライブラリを検索するかどうか、および検索する場所を制御するための2つの構成オプションがあります。
--with-libcurl=PREFIX	look for the curl library in PREFIX/lib and headers in
PREFIX/include (default PREFIX is curl-config path or $PATH).
--without-libcurl

The Elasticsearch instance should be running and reachable from the multiple SlurmctldHost configured.
Elasticsearchインスタンスが実行されており、構成された複数のSlurmctldHostから到達可能である必要があります。
Refer to the Elasticsearch Official Documentation for further details on setup and configuration.
セットアップと構成の詳細については、Elasticsearchの公式ドキュメントを参照してください。

There are three slurm.conf options related to this plugin:
このプラグインに関連する3つのslurm.confオプションがあります。

  • JobCompType is used to select the job completion plugin type to activate.
    JobCompTypeは、アクティブ化するジョブ完了プラグインタイプを選択するために使用されます。
    It should be set to jobcomp/elasticsearch.
    jobcomp / elasticsearchに設定する必要があります。
    JobCompType=jobcomp/elasticsearch
  • JobCompLoc should be set to the Elasticsearch server URL endpoint (including the port number and the target index).
    JobCompLocはElasticsearchサーバーのURLエンドポイント(ポート番号とターゲットインデックスを含む)に設定する必要があります。
    JobCompLoc=<host>:<port>/<target>/_doc

    NOTE: Since Elasticsearch 8.0 the APIs that accept types are removed, thereby moving to a typeless mode.
    注:Elasticsearch 8.0以降、タイプを受け入れるAPIが削除され、タイプレスモードに移行します。
    The Slurm elasticsearch plugin in versions prior to 20.11 removed any trailing slashes from this option URL and appended a hardcoded /slurm/jobcomp suffix representing the /index/type respectively.
    20.11より前のバージョンのSlurmelasticsearchプラグインは、このオプションURLから末尾のスラッシュを削除し、/ index / typeをそれぞれ表すハードコードされた/ slurm / jobcompサフィックスを追加しました。
    Starting from Slurm 20.11 the URL is fully configurable and handed as-is without modification to the libcurl library functions.
    Slurm 20.11以降、URLは完全に構成可能であり、libcurlライブラリ関数を変更せずにそのまま渡されます。
    In addition, this also allows users to index data from different clusters to the same server but to different indices.
    さらに、これにより、ユーザーは異なるクラスターから同じサーバーに異なるインデックスにデータをインデックス付けすることもできます。

    NOTE: The Elasticsearch official documentation provides detailed information around these concepts, the type to typeless deprecation transition as well as reindex API references on how to copy data from one index to another if needed.
    注:Elasticsearchの公式ドキュメントには、これらの概念、タイプからタイプレスの非推奨への移行、および必要に応じて1つのインデックスから別のインデックスにデータをコピーする方法に関するAPIリファレンスのインデックスの再作成に関する詳細情報が記載されています。

  • JobCompParams should be set to the Elasticsearch server connecting comma delimited options:
    JobCompParamsは、コンマ区切りオプションを接続するElasticsearchサーバーに設定する必要があります。
    • JobCompParams=timeout=5
      Use a timeout when communication with Elasticsearch server.
      Elasticsearchサーバーと通信するときにタイムアウトを使用します。
      After the timeout, error out and queue job record for 30 seconds to try again.
      タイムアウト後、エラーアウトし、ジョブレコードを30秒間キューに入れて、再試行します。
    • JobCompParams=connect_timeout=5
      Use a timeout when connecting to Elasticsearch server.
      Elasticsearchサーバーに接続するときにタイムアウトを使用します。
      After the timeout, error out and queue job record for 30 seconds to try again.
      タイムアウト後、エラーアウトし、ジョブレコードを30秒間キューに入れて、再試行します。
  • DebugFlags could include the Elasticsearch flag for extra debugging purposes.
    DebugFlagsには、追加のデバッグ目的でElasticsearchフラグを含めることができます。
    DebugFlags=Elasticsearch
    It is a good idea to turn this on initially until you have verified that finished jobs are properly indexed.
    完了したジョブが適切にインデックス付けされていることを確認するまで、最初にこれをオンにすることをお勧めします。
    Note that you do not need to manually create the Elasticsearch index, since the plugin will automatically do so when trying to index the first job document.
    プラグインは最初のジョブドキュメントにインデックスを付けようとすると自動的に作成するため、Elasticsearchインデックスを手動で作成する必要はないことに注意してください。

Visualization

Once jobs are being indexed, it is a good idea to use a web visualization layer to analyze the data.
ジョブのインデックスが作成されたら、Web視覚化レイヤーを使用してデータを分析することをお勧めします。
Kibana is a recommended open-source data visualization plugin for Elasticsearch.
Kibanaは、Elasticsearchに推奨されるオープンソースのデータ視覚化プラグインです。
Once installed, an Elasticsearch index name or pattern has to be configured to instruct Kibana to retrieve the data.
インストールしたら、Elasticsearchのインデックス名またはパターンを設定して、Kibanaにデータを取得するように指示する必要があります。
Once data is loaded it is possible to create tables where each row is a finished job, ordered by any column you choose — the @end_time timestamp is suggested — and any dashboards, graphs, or other analysis of interest.
データが読み込まれると、各行が終了したジョブであり、選択した任意の列(@end_timeタイムスタンプが推奨されます)およびダッシュボード、グラフ、またはその他の関心のある分析で並べ替えられたテーブルを作成できます。

Testing and Debugging

For debugging purposes, you can use the curl command or any similar tool to perform REST requests against Elasticsearch directly.
デバッグの目的で、curlコマンドまたは同様のツールを使用して、Elasticsearchに対してRESTリクエストを直接実行できます。
Some of the following examples using the curl tool may be useful.
カールツールを使用した次の例のいくつかが役立つ場合があります。

Query information assuming a slurm index name, including the document count (which should be one per job indexed):
ドキュメント数(インデックス付けされたジョブごとに1つである必要があります)を含む、slurmインデックス名を想定したクエリ情報:

$ curl -XGET http://localhost:9200/_cat/indices/slurm?v
health status index uuid                   pri rep docs.count docs.deleted store.size pri.store.size
yellow open   slurm 103CW7GqQICiMQiSQv6M_g   5   1          9            0    142.8kb        142.8kb

Query all indexed jobs in the slurm index:
slurmインデックス内のすべてのインデックス付きジョブをクエリします。

$ curl -XGET 'http://localhost:9200/slurm/_search?pretty=true&q=*:*' | less

Delete the slurm index (caution!):
slurmインデックスを削除します(注意!):

$ curl -XDELETE http://localhost:9200/slurm
{"acknowledged":true}

Query information about _cat options.
_catオプションに関する情報を照会します。
More can be found in the official documentation.
詳細については、公式ドキュメントをご覧ください。

$ curl -XGET http://localhost:9200/_cat

Failure management

When the primary slurmctld is shut down, information about all completed but not yet indexed jobs held within the Elasticsearch plugin saved to a file named elasticsearch_state, which is located in the StateSaveLocation.
プライマリslurmctldがシャットダウンされると、Elasticsearchプラグイン内に保持されている、完了したがまだインデックス付けされていないすべてのジョブに関する情報が、StateSaveLocationにあるelasticsearch_stateという名前のファイルに保存されます。
This permits the plugin to restore the information when the slurmctld is restarted, and will be sent to the Elasticsearch database when the connection is restored.
これにより、プラグインはslurmctldの再起動時に情報を復元でき、接続が復元されるとElasticsearchデータベースに送信されます。

Acknowledgments

The Elasticsearch plugin was created as part of Alejandro Sanchez's Master's Thesis.
Elasticsearchプラグインは、AlejandroSanchezの修士論文の一部として作成されました。

Last modified 5 April 2019