文書の表示以前のリビジョンバックリンク文書の先頭へ この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。 ====== Pandora FMS 用の OpenSearch クラスタの設定 ====== {{indexmenu_n>47}} [[:ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] <wrap #ks1 /> ===== 概要 ===== This is a configuration guide for installing multiple OpenSearch worker nodes, optionally with self-signed certificates and SSL connection. You may start from [[:en:documentation:pandorafms:technical_annexes:38_opensearch_installation|an existing node with data]] or a completely new cluster. これは、複数の OpenSearch ワーカーノード(オプションで自己署名証明書と SSL 接続を使用)をインストールするための設定ガイドです。[[:ja:documentation:pandorafms:technical_annexes:38_opensearch_installation|データが存在する既存のノード]]から開始することも、完全に新しいクラスタから開始することもできます。 It has been tested on: 以下の環境でテスト済みです: - CentOS® 8.4 and 8.5. - Rocky Linux® 8.4, 8.5, 8.6, 8.7 and 9.5. - RedHat® 8.5 and 9.5 . - CentOS® 8.4 および 8.5. - Rocky Linux® 8.4, 8.5, 8.6, 8.7 および 9.5. - RedHat® 8.5 および 9.5 . <WRAP center round important 90%> It is recommended to distribute Pandora FMS server and OpenSearch on independent servers. </WRAP> <WRAP center round important 90%> Pandora FMS サーバと OpenSearch を独立したサーバに分散することをお勧めします。 </WRAP> <wrap #ks2 /> ===== スクリプトインストール ===== The [[:en:documentation:pandorafms:technical_annexes:38_opensearch_installation#ks2|installation]] process required for each node that will work with Pandora FMS is performed by downloading and running (which may be [[#ks2_1|customized]]) the following file: Pandora FMS で動作する各ノードに必要な [[:ja:documentation:pandorafms:technical_annexes:38_opensearch_installation#ks2|インストール]] 処理は、次のファイルをダウンロードして実行することにより行えます ([[#ks2_1|カスタマイズ可能]])。 <code bash> bash pandorafms-opensearch-el </code> <wrap #ks2_1 /> ==== デフォルト環境変数 ==== * ''[ "$CLUSTER_NAME" ]'', default value: ''CLUSTER_NAME='pandora_opensearch' ''. * ''[ "$OPENSEARCH_PASS" ]'', default value: ''OPENSEARCH_PASS="P4nd0r4!FMS" ''. * ''[ "$CLUSTER_NAME" ]'', デフォルト値: ''CLUSTER_NAME='pandora_opensearch' ''. * ''[ "$OPENSEARCH_PASS" ]'', デフォルト値: ''OPENSEARCH_PASS="P4nd0r4!FMS" ''. <code bash> env CLUSTER_NAME="pandora_opensearch" \ OPENSEARCH_PASS="P4nd0r4!FMS" \ bash -c "$(curl -SsL https://pfms.me/pandorafms-opensearch-el)" </code> <wrap #ks3 /> ===== 全ノードでの設定 ===== Although these instructions should be followed for each node, some aspects must be customized for each one: the memory of each computer and whether it is an existing node with data. これらの手順は各ノードに対して実行する必要がありますが、各コンピュータのメモリや、データを持つ既存のノードであるかどうかなど、いくつかの側面は各ノードごとにカスタマイズする必要があります。 * Disable the network firewall on each node: * 各ノードのネットワークファイアウォールを無効にします。 <code bash> systemctl stop firewalld </code> * Using your favorite text editor, open the ''/etc/opensearch/opensearch.yml'' file and make several changes. * お気に入りのテキストエディターを使用して、''/etc/opensearch/opensearch.yml'' ファイルを開き、いくつか変更を加えます。 //Comment out// (or delete) the following line: 以下の行を//コメントアウト//(または削除)します。 <code> discovery.type: single-node │ </code> Add the following line to the end to temporarily disable security: セキュリティを一時的に無効にするために、最後に次の行を追加します。 <code> plugins.security.disabled: true </code> Configure the <wrap :en>**discovery hosts**</wrap> by IP address or DNS. The line should have the following structure, replacing, adding, or deleting as needed for each network and until all network elements are complete: <wrap :en>**discovery hosts**</wrap> をIPアドレスまたは DNS 名で設定します。行は以下の構造を持つ必要があります。すべてのネットワーク要素が含まれるように、置き換え、追加、または削除します。 <code bash> discovery.seed_hosts: ["172.42.42.101", "172.42.42.102", "172.42.42.103"] </code> Configure each <wrap :en>**manager host**</wrap> as needed for each network. The line should have the following structure, replacing, deleting, or adding each of them (you should include the hostname of the machine used by default as a node indicator or the custom node identifier from YAML, if applicable): 各ネットワークの必要に応じて、<wrap :en>**manager host**</wrap> を設定します。行は以下の構造を持つ必要があります。各行を置き換え、削除、または追加します(ノード識別子としてデフォルトで使用されるマシンのホスト名、または YAML から取得したカスタムノード識別子を必要に応じて含める必要があります)。 <code bash> cluster.initial_cluster_manager_nodes: ["rocky8-node1", "rocky8-node2", "rocky8-node3"] </code> Save the changes and exit the text editor. 変更を保存してテキストエディタを終了します。 * Memory configuration on each node. * 各ノードのメモリ設定 Memory configuration should be less than the available memory minus the memory needed by the system. Therefore, if you need to configure 4 gigabytes for OpenSearch, the system must have at least 6 GB (4 for OpenSearch and 2 free for the system). メモリ設定は、使用可能なメモリからシステムに必要なメモリを差し引いた値よりも小さくする必要があります。したがって、OpenSearch 用に 4GB を設定する必要がある場合、システムに少なくとも 6GB(OpenSearch 用に 4GB、システム用に 2GB)の空き容量が必要です。 Once calculation is complete, the memory size is specified in the ''/etc/opensearch/jvm.options'' file, replacing it with the resulting numerical value: 計算が完了したら、その数値を使ってメモリサイズを ''/etc/opensearch/jvm.options'' ファイルで指定します。 <code bash> -Xms4g -Xmx4g </code> Save the changes and exit the text editor. 変更を保存してテキストエディタを終了します。 * Delete the data directory on the clean nodes. * クリーンノード上のデータディレクトリを削除します。 <WRAP center round warning 90%> If the cluster is growing from a single node with data, **just clean up the data directory for the new nodes, not the one with data**. </WRAP> <WRAP center round warning 90%> クラスタをデータが含まれる単一のノードから拡張している場合は、**データを含むノードではなく、新しいノードのデータディレクトリをクリーンアップするだけです**。 </WRAP> Stop the OpenSearch service and clear the data **if the node is new**: **ノードが新規の場合**、OpenSearch サービスを停止し、データをクリアします。 <code bash> systemctl stop opensearch rm -rf /var/lib/opensearch/* </code> Restart the OpenSearch service: OpenSearch サービスを再起動します。 <code bash> systemctl restart opensearch </code> * Check each node locally. * ローカルでノードを確認します <code bash> curl "http://127.0.0.1:9200/_cat/nodes?v" </code> You should get an output similar to: 次のような出力が得られます。 {{ :wiki:pfms-opensearch-cluster-img_010.png }} <WRAP center round tip 90%> * At this point, you should have the cluster OpenSearch fully functional. * To add security to connections, see "[[#ks4|Adding SSL Authentication]]". * To configure Pandora FMS with OpenSearch, see "[[:en:documentation:pandorafms:monitoring:09_log_monitoring#ks3_1|Log Collection and Monitoring]]". </WRAP> <WRAP center round tip 90%> * この時点で、クラスタの OpenSearch が完全に機能するはずです。 * 接続にセキュリティを追加するには、「[[#ks4|SSL 認証の追加]]」を参照してください。 * Pandora FMS で OpenSearch を設定するには、「[[:ja:documentation:pandorafms:monitoring:09_log_monitoring#ks3_1|ログ収集と監視]]」を参照してください。 </WRAP> <wrap #ks4 /> ===== SSL 接続によるセキュリティ設定 ===== * Enable firewall and add rules. * ファイアウォールを有効にしてルールを追加します。 <code bash> systemctl start firewalld firewall-cmd --zone=public --add-port=9300/tcp --permanent firewall-cmd --zone=public --add-port=9200/tcp --permanent firewall-cmd --reload </code> * Enable security in OpenSearch. * OpenSearch でセキュリティを有効にします。 Using your favorite text editor, open file ''/etc/opensearch/opensearch.yml'' and set the value to ''false'' on the following line: お気に入りのテキストエディタを使用して、ファイル ''/etc/opensearch/opensearch.yml'' を開き、次の行の値を ''false'' に設定します。 <code bash> plugins.security.disabled: false </code> For self-signed certificates, add the following line to the end of the file: 自己署名証明書の場合は、ファイルの末尾に次の行を追加します。 <code bash> plugins.security.ssl.transport.enforce_hostname_verification: false </code> Save your changes and exit the text editor. 変更を保存してテキストエディタを終了します。 * Copy certificates. * 証明書をコピーします。 The self-signed certificates generated in the installation step will be used. Copy the certificates from the master node to the other nodes. インストール手順で生成した自己署名証明書が使用されます。マスターノードから他のノードに証明書をコピーします。 **On node 1** (replace ''node_n'' with each of the other nodes): **ノード 1** (''node_n'' を他の各ノードに置き換えます): <code bash> tar cvzf certs.tar.gz /etc/opensearch/*.pem scp certs.tar.gz root@node_n: </code> Then run on each of the other nodes: 次に、他の各ノードで以下を実行します。 <code bash> tar xvzf certs.tar.gz cp etc/opensearch/* /etc/opensearch/ </code> On each of the other nodes, restart the OpenSearch service: 他の各ノードで、OpenSearch サービスを再起動します。 <code bash> systemctl restart opensearch </code> Verify nodes: ノードを確認します。 <code bash> curl -XGET -ku admin:'P4nd0r4!FMS' "https://127.0.0.1:9200/_cat/nodes?v" </code> {{ :wiki:47_pfms_opensearch_cluster-image_010.png }} A call verification to the cluster similar to the one above must be performed using both HTTPS and username and password authentication. 上記と同様のクラスタへの呼び出し検証は、HTTPS とユーザ名およびパスワード認証の両方を使用して実行する必要があります。 At this point, the cluster OpenSearch should have a fully functional SSL connection. To configure Pandora FMS with OpenSearch, see "[[:en:documentation:pandorafms:monitoring:09_log_monitoring#ks3_1|Log Collection and Monitoring]]". この時点で、クラスタの OpenSearch は完全に機能する SSL 接続を備えているはずです。Pandora FMS で OpenSearch を設定するには、「[[:ja:documentation:pandorafms:monitoring:09_log_monitoring#ks3_1|ログ収集と監視]]」をご覧ください。 [[:ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] CKG Edit ja/documentation/pandorafms/technical_annexes/47_pfms_opensearch_cluster.txt 最終更新: 2025/05/16 23:42by junichi