ja:quickguides:elasticsearch_cluster

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
ja:quickguides:elasticsearch_cluster [2022/06/10 22:06] – [Requirements] junichija:quickguides:elasticsearch_cluster [2022/06/10 22:31] (現在) – [Data models and templates] junichi
行 17: 行 17:
 <WRAP center round tip 60%>これらのポート番号を介した接続を許可するように、各ノードのファイアウォールの設定を忘れないでください。</WRAP> <WRAP center round tip 60%>これらのポート番号を介した接続を許可するように、各ノードのファイアウォールの設定を忘れないでください。</WRAP>
  
-===== Configuration =====+===== 設定 =====
  
 Stop the Elasticsearch service on each and every node: Stop the Elasticsearch service on each and every node:
 +
 +全ノードの Elasticsearch サービスを停止します。
 +
 <code> <code>
  
行 27: 行 30:
  
 Modify the following lines in the configuration file ''/etc/elasticsearch/elasticsearch.yml''  : Modify the following lines in the configuration file ''/etc/elasticsearch/elasticsearch.yml''  :
 +
 +設定ファイル ''/etc/elasticsearch/elasticsearch.yml'' の以下の行を編集します。
  
 <code> <code>
行 35: 行 40:
  
 //[[:en:documentation:01_understanding:03_glossary#commenting_out_or_uncommenting_a_parameter|Uncomment]]// the lines and add the IP addresses or URLs of each node: //[[:en:documentation:01_understanding:03_glossary#commenting_out_or_uncommenting_a_parameter|Uncomment]]// the lines and add the IP addresses or URLs of each node:
 +
 +該当行を //[[:ja:documentation:01_understanding:03_glossary#パラメータのコメントアウトとアンコメント|コメントアウト]]// し、各ノードの IP アドレスまたは URL を追加します。
 +
 <code> <code>
  
行 43: 行 51:
  
 Example with IP addresses: Example with IP addresses:
 +
 +IP アドレスでの例:
  
 <code> <code>
行 51: 行 61:
  
 <WRAP center round important 60%>Make sure that the line ''cluster.initial_master_nodes''  is defined only once in the configuration file, **in some cases the same line appears in two different blocks of the same file.**</WRAP> <WRAP center round important 60%>Make sure that the line ''cluster.initial_master_nodes''  is defined only once in the configuration file, **in some cases the same line appears in two different blocks of the same file.**</WRAP>
 +
 +<WRAP center round important 60%>''cluster.initial_master_nodes'' の行は設定ファイル内で 1回のみ定義されていることを確認してください。**場合によっては、同じ行が同じファイルの異なる 2つの場所に表示されます。**</WRAP>
  
 Before starting the service, because the nodes were started for the first time on their own (standalone), the contents of the data folder (by default ''/var/lib/elasticsearch/'') must be deleted in order to start the cluster for the first time. Do this with the command: Before starting the service, because the nodes were started for the first time on their own (standalone), the contents of the data folder (by default ''/var/lib/elasticsearch/'') must be deleted in order to start the cluster for the first time. Do this with the command:
 +
 +ノードは初回に単独で(スタンドアロンで)開始されたため、サービスを開始する前にデータフォルダーの内容(デフォルトでは ''/var/lib/elasticsearch/'')を削除する必要があります。 次のコマンドを実行します。
  
 <code> <code>
行 60: 行 74:
  
 Now it is time to start the services on each and every node. Start and check that they are running with the commands: Now it is time to start the services on each and every node. Start and check that they are running with the commands:
 +
 +次に、すべてのノードでサービスを開始します。 次のコマンドで開始し、実行されていることを確認します。
  
 <code> <code>
行 67: 行 83:
  
 You should get an output similar to: You should get an output similar to:
 +
 +次のような出力を得られます。
  
 {{  :wiki:pfms-systemctl_status_elasticsearch.service.png  }} {{  :wiki:pfms-systemctl_status_elasticsearch.service.png  }}
  
 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: 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つのノードがクラスターに正しく参加していることを確認する必要があります。任意のノードで次のコマンドを実行すると、同じ応答が返されます。
  
 <code> <code>
行 81: 行 101:
 Check again the firewall configuration always taking into account that the nodes should communicate through ports ''9200''  and ''9300''  and that from the PFMS server and the PFMS Web Console should be able to access port ''9200''  as well. With these steps you will have already installed and configured the Elasticsearch cluster to be used as Pandora FMS log storage engine. Check again the firewall configuration always taking into account that the nodes should communicate through ports ''9200''  and ''9300''  and that from the PFMS server and the PFMS Web Console should be able to access port ''9200''  as well. With these steps you will have already installed and configured the Elasticsearch cluster to be used as Pandora FMS log storage engine.
  
-===== Data models and templates =====+ノードがポート ''9200'' および ''9300'' を介して通信する必要があることに加えて、Pandora FMS サーバおよび Pandora FMS Web コンソールからポート ''9200'' へアクセスできる必要があることを常に考慮してファイアウォールの設定を再度確認してください。ここまでの設定により、Pandora FMS ログストレージエンジンとして使用される Elasticsearch クラスターの準備が完了です。 
 + 
 +===== データモジュールとテンプレート =====
  
 Before putting into production an environment, either a single node or a data cluster, it is recommended to apply the corresponding configurations to this node or cluster according to its use. In the case of the indexes generated by **Pandora FMS**, the most effective way to do it is defining a template to define the configuration of the fields and the stored data. Before putting into production an environment, either a single node or a data cluster, it is recommended to apply the corresponding configurations to this node or cluster according to its use. In the case of the indexes generated by **Pandora FMS**, the most effective way to do it is defining a template to define the configuration of the fields and the stored data.
 +
 +単一ノードまたはデータクラスターのいずれかを本番環境に導入する前に、用途に応じて、対応する設定をこのノードまたはクラスターに適用することをお勧めします。 **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> <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>
 +
 +<WRAP center round important 60%> テンプレートは、インデックスの作成時にのみ適用される設定です。 テンプレートを変更しても、既存のインデックスには影響しません。</WRAP>
  
   * To create a **basic template**  follow the instructions in "[[:en:documentation:03_monitoring:09_log_monitoring#data_model_and_templates|Data models and templates for a node]]".   * To create a **basic template**  follow the instructions in "[[:en:documentation:03_monitoring:09_log_monitoring#data_model_and_templates|Data models and templates for a node]]".
   * To define a **multinode template**  you must take into account the following information:   * To define a **multinode template**  you must take into account the following information:
       * 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.**       * 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.**
 +
 +  * **基本テンプレート** を作成するには、[[:ja:documentation:03_monitoring:09_log_monitoring#データもデールとテンプレート|ノードのデータモデルとテンプレート]] の手順に従います。
 +  * **マルチノードテンプレート** を定義するには、次の情報を考慮する必要があります。
 +      * テンプレート(JSON 形式)を設定する場合、**ノードと同じ数の検索を設定する必要があります**が、レプリカを正しく設定するには、**環境内のノードの数から 1を引く必要があります。**
  
 For example, in a Pandora FMS environment with Elasticsearch with 3 configured nodes, when you modify the ''number_of_search''  and ''number_of_replicas''  fields it should look like this: For example, in a Pandora FMS environment with Elasticsearch with 3 configured nodes, when you modify the ''number_of_search''  and ''number_of_replicas''  fields it should look like this:
 +
 +たとえば、3つのノードで構成された Elasticsearch を使用する Pandora FMS 環境では、''number_of_search'' フィールドと ''number_of_replicas'' フィールドを次のように変更します。
 +
 <code> <code>
  
行 105: 行 138:
  
 <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> <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>
 +
 +<WRAP center round info 75%> \\ これは非常に基本的な定義です。Elasticsearch 環境のサイズを正しく定義するには、この記事で説明している要素を考慮に入れることをお勧めします。</WRAP>
  
   * [[https://www.elastic.co/blog/how-many-shards-should-i-have-in-my-elasticsearch-cluster|https://www.elastic.co/blog/how-many-shards-should-i-have-in-my-elasticsearch-cluster]]   * [[https://www.elastic.co/blog/how-many-shards-should-i-have-in-my-elasticsearch-cluster|https://www.elastic.co/blog/how-many-shards-should-i-have-in-my-elasticsearch-cluster]]
  
 From the command line you can list the templates of the environment by executing: From the command line you can list the templates of the environment by executing:
 +
 +コマンドラインから、以下を実行して環境のテンプレートを一覧表示できます。
 +
 <code> <code>
  
行 116: 行 154:
  
 You can also view the details of a template, for example the one we have created for pandorafms by running it: You can also view the details of a template, for example the one we have created for pandorafms by running it:
 +
 +テンプレートの詳細を表示することもできます。たとえば、pandorafms 用に作成したテンプレートは次のようにして表示できます。
  
 <code> <code>
行 123: 行 163:
  
 which will return in JSON format the configuration you have defined. 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. You can perform these operations through the Elasticsearch interface in Pandora FMS using the native Elasticsearch commands.
 +
 +これらの操作は、ネイティブの Elasticsearch コマンドを使用して、Pandora FMS の Elasticsearch インターフェースから実行できます。
  
   * **PUT _template/<template_name> {json_data}**: allows you to enter the data of the template to be created.   * **PUT _template/<template_name> {json_data}**: allows you to enter the data of the template to be created.
   * **GET _template/><template_name>**: allows you to display the created template.   * **GET _template/><template_name>**: allows you to display the created template.
 +
 +  * **PUT _template/<template_name> {json_data}**: 作成するテンプレートのデータを入力できます。
 +  * **GET _template/><template_name>**: 作成したテンプレートを表示できます。
 +
 {{  :wiki:getinterface.png  }} {{  :wiki:getinterface.png  }}
  
  • ja/quickguides/elasticsearch_cluster.1654898814.txt.gz
  • 最終更新: 2022/06/10 22:06
  • by junichi