差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| ja:documentation:07_technical_annexes:37_pfms_elasticsearch_cluster [2023/09/27 05:21] – [Elasticsearch クラスタ設定] junichi | ja:documentation:07_technical_annexes:37_pfms_elasticsearch_cluster [2026/10/02 15:11] (現在) – 削除 - 外部編集 (不明な日付) 127.0.0.1 | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | ====== Elasticsearch クラスタ設定 ====== | ||
| - | |||
| - | {{indexmenu_n> | ||
| - | |||
| - | [[: | ||
| - | |||
| - | ===== 前提条件 ===== | ||
| - | |||
| - | * You must first follow the [[: | ||
| - | * The minimum size of an Elasticsearch cluster is 3 nodes and it must always grow in odd numbers in order to make use of the // | ||
| - | * Ensure that you have connectivity between all 3 nodes and that ports 9200 and 9300 are accessible between each and every node. | ||
| - | |||
| - | * まず最初に [[: | ||
| - | * Elasticsearch クラスターの最小サイズは 3ノードであり、// | ||
| - | * 3つのノードすべての間で通信が可能であり、各ノード間でポート 9200 および 9300 へアクセスできることを確認してください。 | ||
| - | |||
| - | <WRAP center round tip 60%> | ||
| - | |||
| - | <WRAP center round tip 60%> | ||
| - | |||
| - | ===== 設定 ===== | ||
| - | |||
| - | Stop the Elasticsearch service on each and every node: | ||
| - | |||
| - | 全ノードの Elasticsearch サービスを停止します。 | ||
| - | |||
| - | < | ||
| - | |||
| - | systemctl stop elasticsearch.service | ||
| - | |||
| - | </ | ||
| - | |||
| - | Modify the following lines in the configuration file ''/ | ||
| - | |||
| - | 設定ファイル ''/ | ||
| - | |||
| - | < | ||
| - | # | ||
| - | # | ||
| - | |||
| - | </ | ||
| - | |||
| - | // | ||
| - | |||
| - | 該当行を // | ||
| - | |||
| - | < | ||
| - | |||
| - | discovery.seed_hosts: | ||
| - | cluster.initial_master_nodes: | ||
| - | |||
| - | </ | ||
| - | |||
| - | Example with IP addresses: | ||
| - | |||
| - | IP アドレスでの例: | ||
| - | |||
| - | < | ||
| - | discovery.seed_hosts: | ||
| - | cluster.initial_master_nodes: | ||
| - | |||
| - | </ | ||
| - | |||
| - | <WRAP center round important 60%>Make sure that the line '' | ||
| - | |||
| - | <WRAP center round important 60%>'' | ||
| - | |||
| - | Before starting the service, because the nodes were started for the first time on their own (standalone), | ||
| - | |||
| - | ノードは初回に単独で(スタンドアロンで)開始されたため、サービスを開始する前にデータフォルダーの内容(デフォルトでは ''/ | ||
| - | |||
| - | < | ||
| - | rm -rf / | ||
| - | |||
| - | </ | ||
| - | |||
| - | Now it is time to start the services on each and every node. Start and check that they are running with the commands: | ||
| - | |||
| - | 次に、すべてのノードでサービスを開始します。 次のコマンドで開始し、実行されていることを確認します。 | ||
| - | |||
| - | < | ||
| - | systemctl start elasticsearch.service && systemctl status elasticsearch.service | ||
| - | |||
| - | </ | ||
| - | |||
| - | You should get an output similar to: | ||
| - | |||
| - | 次のような出力を得られます。 | ||
| - | |||
| - | {{ : | ||
| - | |||
| - | Once the services have been started, you must confirm that the 3 nodes are joined to the cluster correctly, so when executing the following command on any of the nodes, the same response should be given: | ||
| - | |||
| - | サービスが開始されたら、3つのノードがクラスターに正しく参加していることを確認する必要があります。任意のノードで次のコマンドを実行すると、同じ応答が返されます。 | ||
| - | |||
| - | < | ||
| - | curl -XGET http:// | ||
| - | |||
| - | </ | ||
| - | |||
| - | {{ : | ||
| - | |||
| - | Check again the firewall configuration always taking into account that the nodes should communicate through ports '' | ||
| - | |||
| - | ノードがポート '' | ||
| - | |||
| - | ===== データモジュールとテンプレート ===== | ||
| - | |||
| - | Before putting into production an environment, | ||
| - | |||
| - | 単一ノードまたはデータクラスターのいずれかを本番環境に導入する前に、用途に応じて、対応する設定をこのノードまたはクラスターに適用することをお勧めします。 **Pandora FMS** によって生成されたインデックスの場合、それを行う最も簡単な方法は、フィールドと保存されたデータの構成を定義するためのテンプレートを定義することです。 | ||
| - | |||
| - | <WRAP center round important 60%> Templates are configurations that are only applied at the time of index creation. Changing a template will have no impact on existing indexes. </ | ||
| - | |||
| - | <WRAP center round important 60%> テンプレートは、インデックスの作成時にのみ適用される設定です。 テンプレートを変更しても、既存のインデックスには影響しません。</ | ||
| - | |||
| - | * To create a **basic template** | ||
| - | * To define a **multinode template** | ||
| - | * When configuring the template (JSON format), **you need to configure as many searches as you have nodes**, however to correctly configure the replicas **you must subtract 1 from the number of nodes in the environment.** | ||
| - | |||
| - | * **基本テンプレート** を作成するには、[[: | ||
| - | * **マルチノードテンプレート** を定義するには、次の情報を考慮する必要があります。 | ||
| - | * テンプレート(JSON 形式)を設定する場合、**ノードと同じ数の検索を設定する必要があります**が、レプリカを正しく設定するには、**環境内のノードの数から 1を引く必要があります。** | ||
| - | |||
| - | For example, in a Pandora FMS environment with Elasticsearch with 3 configured nodes, when you modify the '' | ||
| - | |||
| - | たとえば、3つのノードで構成された Elasticsearch を使用する Pandora FMS 環境では、'' | ||
| - | |||
| - | < | ||
| - | |||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | }, | ||
| - | |||
| - | </ | ||
| - | |||
| - | <WRAP center round info 75%> \\ This is a very basic definition, in order to correctly define the sizing of the Elasticsearch environment it is advisable to take into account the factors described in this article:</ | ||
| - | |||
| - | <WRAP center round info 75%> \\ これは非常に基本的な定義です。Elasticsearch 環境のサイズを正しく定義するには、この記事で説明している要素を考慮に入れることをお勧めします。</ | ||
| - | |||
| - | * [[https:// | ||
| - | |||
| - | From the command line you can list the templates of the environment by executing: | ||
| - | |||
| - | コマンドラインから、以下を実行して環境のテンプレートを一覧表示できます。 | ||
| - | |||
| - | < | ||
| - | |||
| - | curl -X GET " | ||
| - | |||
| - | </ | ||
| - | |||
| - | You can also view the details of a template, for example the one we have created for pandorafms by running it: | ||
| - | |||
| - | テンプレートの詳細を表示することもできます。たとえば、pandorafms 用に作成したテンプレートは次のようにして表示できます。 | ||
| - | |||
| - | < | ||
| - | curl -X GET " | ||
| - | |||
| - | </ | ||
| - | |||
| - | which will return in JSON format the configuration you have defined. | ||
| - | |||
| - | 定義した設定を JSON 形式で返します。 | ||
| - | |||
| - | You can perform these operations through the Elasticsearch interface in Pandora FMS using the native Elasticsearch commands. | ||
| - | |||
| - | これらの操作は、ネイティブの Elasticsearch コマンドを使用して、Pandora FMS の Elasticsearch インターフェースから実行できます。 | ||
| - | |||
| - | * **PUT _template/< | ||
| - | * **GET _template/>< | ||
| - | |||
| - | * **PUT _template/< | ||
| - | * **GET _template/>< | ||
| - | |||
| - | {{ : | ||
| - | |||
| - | [[: | ||