Elasticsearch Guide
Slurm provides multiple Job Completion
Plugins. These plugins are an orthogonal way to provide historical job
accounting data for finished jobs.
Slurmは複数のジョブ完了プラグインを提供します。これらのプラグインは、完了したジョブの履歴のジョブアカウンティングデータを提供する直交方法です。
In most installations, Slurm is already configured with an
AccountingStorageType
plugin — usually slurmdbd. In these situations, the information
captured by a completion plugin is intentionally redundant.
ほとんどのインストールでは、SlurmはすでにAccountingStorageTypeプラグイン(通常はslurmdbd)で構成されています。これらの状況では、補完プラグインによってキャプチャされた情報は意図的に冗長です。
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. Some of these
visualization tools also let you easily create different types of dashboards,
diagrams, tables, histograms and/or apply customized filters when searching.
jobcomp / elasticsearchプラグインを、KibanaなどのElasticsearchサーバーの上のWebレイヤーと共に使用して、完了したジョブとクラスターの状態を視覚化できます。これらの視覚化ツールの一部では、さまざまなタイプのダッシュボード、図、テーブル、ヒストグラムを簡単に作成したり、検索時にカスタマイズされたフィルターを適用したりできます。
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. At Slurm configuration time,
the configure script should emit a message like this if the appropriate
library and headers have been successfully located:
プラグインには、libcurlライブラリがインストールされてコントローラーで使用可能であり、開発ライブラリが構成時に使用可能である必要があります。Slurmの構成時に、適切なライブラリとヘッダーが正常に見つかった場合、configureスクリプトは次のようなメッセージを発行する必要があります。
checking whether libcurl is usable... yesThere 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.
Refer to the Elasticsearch
Official Documentation for further details on setup and configuration.
Elasticsearchインスタンスが実行中で、構成された複数のSlurmctldHostから到達可能である必要があります。セットアップと構成の詳細については、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. It should be set
to jobcomp/elasticsearch.
JobCompTypeは、アクティブ化するジョブ完了プラグインタイプを選択するために使用されます。jobcomp / elasticsearchに設定する必要があります。
JobCompType=jobcomp/elasticsearch
-
JobCompLoc should be set to
the Elasticsearch server URL, including the port number after the semicolon
":".
JobCompLocは、セミコロン「:」の後のポート番号を含むElasticsearchサーバーのURLに設定する必要があります。
JobCompLoc=http://<elasticserver>:<port>
The plugin will remove any trailing slashes from that URL, and append /slurm/jobcomp at the end. The first part of the path — slurm — defines the Elasticsearch index name and the second — jobcomp — is the index type name. These concepts are further described in the Elasticsearch documentation.
プラグインは、そのURLから末尾のスラッシュを削除し、末尾に/ slurm / jobcompを追加します。パスの最初の部分(slurm)はElasticsearchインデックス名を定義し、2番目の部分(jobcomp)はインデックスタイプ名です。これらの概念については、Elasticsearchのドキュメントで詳しく説明しています。
-
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. After the timeout, error out and queue job record for 30 seconds to try again.
Elasticsearchサーバーと通信するときにタイムアウトを使用します。タイムアウト後、エラーを出力し、ジョブレコードを30秒間キューに入れて、再試行します。
-
JobCompParams=connect_timeout=5
Use a timeout when connecting to Elasticsearch server. After the timeout, error out and queue job record for 30 seconds to try again.
Elasticsearchサーバーに接続するときにタイムアウトを使用します。タイムアウト後、エラーを出力し、ジョブレコードを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.
Kibana is a
recommended open-source data visualization plugin for Elasticsearch.
Once installed, an Elasticsearch index name or pattern has to be
configured to instruct Kibana to retrieve the data. The appropriate index for
Slurm is either slurm or slurm*. 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.
ジョブのインデックスが作成されたら、Web視覚化レイヤーを使用してデータを分析することをお勧めします。KibanaはElasticsearchに推奨されるオープンソースのデータ視覚化プラグインです。インストールしたら、Elasticsearchインデックス名またはパターンを設定して、Kibanaにデータを取得するように指示する必要があります。Slurmの適切なインデックスは、slurmまたはslurm *です。データが読み込まれると、選択した任意の列(@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. Some of the
following examples using the curl tool may be useful.
デバッグの目的で、curlコマンドまたは同様のツールを使用して、Elasticsearchに対してRESTリクエストを直接実行できます。curlツールを使用した次の例の一部が役立つ場合があります。
Query information about the slurm index, including the document
count (which should be one per job indexed):
ドキュメント数(インデックス付けされたジョブごとに1つである必要があります)を含む、スラームインデックスに関する情報をクエリします。
$ 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. More can be found in the
official documentation.
_catオプションに関する情報を照会します。詳細は公式ドキュメントをご覧ください。
$ 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. 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プラグイン内に保持されている、まだ索引付けされていないすべての完了したジョブに関する情報が、Elasticsearch_stateという名前のファイルに保存されます。このファイルは、StateSaveLocationにあります。これにより、slurmctldが再起動されたときにプラグインが情報を復元できるようになり、接続が復元されたときにElasticsearchデータベースに送信されます。
Acknowledgments
The Elasticsearch plugin was created as part of Alejandro Sanchez's
Master's Thesis.
Elasticsearchプラグインは、アレハンドロサンチェスの修士論文の一部として作成されました。
Last modified 5 April 2019