文書の表示以前のリビジョンバックリンク文書の先頭へ この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。 ====== OpenSearch のインストールと設定 ====== {{indexmenu_n>38}} **Online installation and requirements** (recommended method) **are specified in the topic** "Pandora FMS Installation" in [[:en:documentation:pandorafms:installation:01_installing#ks3|its corresponding section]]. **オンラインインストールと要件**(推奨方法)については、[[:ja:documentation:pandorafms:installation:01_installing#ks3|該当するセクション]]の「Pandora FMS のインストール」に記載されています。 <WRAP center round info 90%> To configure Pandora FMS with OpenSearch see "[[:en:documentation:pandorafms:monitoring:09_log_monitoring|Log collection and monitoring]]" and "[[:en:documentation:pandorafms:cybersecurity:21_siem|SIEM monitoring]]". </WRAP> <WRAP center round info 90%> OpenSearch を使用した Pandora FMS 設定は、「[[:ja:documentation:pandorafms:monitoring:09_log_monitoring#ks4|ログの収集と監視]]」および 「[[:ja:documentation:pandorafms:cybersecurity:21_siem|SIEM 監視]]」 を参照してください。 </WRAP> <wrap #ks1 /> ===== 手動インストールと高度な OpenSearch 設定 ===== **Before running OpenSearch**, memory paging and swap must be disabled on the host to improve performance and increase the number of memory maps available for OpenSearch. See "Important settings" for more information: **OpenSearch を実行する前に**、パフォーマンスを向上させ、OpenSearch で使用できるメモリマップの数を増やすために、ホスト上のメモリページングとスワップを無効にする必要があります。 詳細については、「重要な設定」を参照してください。 <WRAP center round box 90%> [[https://opensearch.org/docs/latest/install-and-configure/install-opensearch/index/#important-settings|https://opensearch.org/docs/latest/install-and-configure/install-opensearch/index/#important-settings]] </WRAP> <code> # Disable memory paging and swapping. sudo swapoff -a # Edit the sysctl config file that defines the host's max map count. sudo vi /etc/sysctl.conf # Set max map count to the recommended value of 262144. vm.max_map_count=262144 # Reload the kernel parameters. sudo sysctl -p </code> For Rocky Linux 8, installation [[https://opensearch.org/docs/latest/install-and-configure/install-opensearch/rpm/|via RPM package]] is recommended. Once OpenSearch is installed, access to OpenSearch must be checked from Pandora FMS. Before performing this test, each [[#ks3|node]] or [[#ks4|cluster]] must be configured. To check the installation, run: Rocky Linux 8 の場合、[[https://opensearch.org/docs/latest/install-and-configure/install-opensearch/rpm/|RPM パッケージによるインストール]] が推奨されます。OpenSearch がインストールされたら、Pandora FMS から OpenSearch へのアクセスを確認する必要があります。このテストを実行する前に、[[#ks3|ノード]] または [[#ks4|クラスター]] を設定してください。このインストール チェックでは、次を実行します。 <code> curl -X GET https://<ip_opensearch>:<opensearch_port> -u 'admin:admin' --insecure </code> You should get a response similar to: 次のような応答が返されます。 <code> { "name" : "hostname", "cluster_name" : "opensearch", "cluster_uuid" : "6XNc9m2gTUSIoKDqJit0PA", "version" : { "distribution" : "opensearch", "number" : <version>, "build_type" : <build-type>, "build_hash" : <build-hash>, "build_date" : <build-date>, "build_snapshot" : false, "lucene_version" : <lucene-version>, "minimum_wire_compatibility_version" : "7.10.0", "minimum_index_compatibility_version" : "7.0.0" }, "tagline" : "The OpenSearch Project: https://opensearch.org/" } </code> By default, the OpenSearch installation enables SSL, username and password which is a good practice; It is recommended to [[#ks6|change the default username and password]]. デフォルトの OpenSearch のインストールでは SSL、ユーザ名、パスワードが有効になっており、これが推奨事項です。 [[#ks6|デフォルトのユーザ名とパスワードを変更する]]ことをお勧めします。 <wrap #ks3 /> ===== ノード設定 ===== <WRAP center round important 90%> First, the configuration file ''/etc/opensearch/opensearch.yml'' must be edited, **and then the OpenSearch service will be restarted**. </WRAP> <WRAP center round important 90%> まず設定ファイル ''/etc/opensearch/opensearch.yml'' を編集します。**その後、OpenSearch サービスを再起動します**。 </WRAP> This file contains the configuration for all OpenSearch service parameters; see the official documentation for more information: このファイルには、OpenSearch サービスのすべてのパラメータ設定が含まれています。 詳細については、公式ドキュメントを参照してください。 [[https://opensearch.org/docs/latest/install-and-configure/configuration/|https://opensearch.org/docs/latest/install-and-configure/configuration/]] Minimum configurations necessary to start the service and its use with Pandora FMS. サービスを開始して Pandora FMS で使用するために必要な最低限の設定。 * Port number. * ポート番号 <code> # ---------------------------------- Network # Set the bind address to a specific IP (IPv4 or IPv6): network.host: 0.0.0.0 # Set a custom port for HTTP: http.port: 9200 # For more information, consult the network module documentation. </code> * Location of stored data and logs: * データおよびログの保存場所 <code> # ----------------------------------- Paths # Path to directory where to store the data (separate multiple locations by comma): path.data: /var/lib/opensearch # Path to log files: path.logs: /var/log/opensearch </code> It will also be necessary to uncomment and define the following lines: 次の行のコメントを外して定義することも必要になります。 <code> cluster.name: pandorafms node.name: ${HOSTNAME} network.host: 0.0.0.0 </code> * ''cluster.name'': This will be the name that the group or cluster will receive. * ''node.name'': To name the node using the ''${HOSTNAME}'' system variable, it will automatically take the name of the host. * For ''network.host'' the value ''0.0.0.0'' allows OpenSearch to “listen” on all network interfaces (NIC); To use a specific NIC, enter a corresponding specific value. * ''cluster.name'': これは、グループまたはクラスタの名前になります。 * ''node.name'': ''${HOSTNAME}'' システム変数を使用してノードに名前を付けると、ホストの名前が自動的に取得されます。 * ''network.host'' の値 ''0.0.0.0'' により、OpenSearch はすべてのネットワークインターフェイス (NIC) で待ち受けできます。 特定の NIC を使用するには、対応する特定の値を入力します。 If you work with a single node, add the line to the configuration file to allow the single node to start: 単一ノードを使用する場合は、設定ファイルに次の行を追加して、単一ノードが起動できるようにします。 <code> discovery.type: single-node </code> In case of working with a cluster you need to complete the ''discovery.seed_hosts'' parameter: クラスターを使用する場合は、''discovery.seed_hosts'' パラメータを設定する必要があります。 <code> discover.seed_hosts : ["ip:port", "ip", "ip"] </code> <WRAP center round info 60%> In the most recent versions of OpenSearch, memory management of the Java® virtual machine is done automatically and it is recommended to let it be managed this way in production environments, so it is unnecessary to modify the JVM values. </WRAP> <WRAP center round info 60%> OpenSearch の最新バージョンでは、Java® 仮想マシンのメモリ管理は自動的に行われ、実稼働環境ではこの方法で管理することをお勧めします。そのため、JVM 値を変更する必要はありません。 </WRAP> To start OpenSearch, execute: OpenSearch を開始するには、次のように実行します。 <code> systemctl start opensearch.service </code> To restart use ''restart'', to stop ''stop'' and ''status'' to check the status. 再起動には ''restart''、停止には ''stop''、状態を確認するには ''status'' を使用します。 <WRAP center round info 60%> If the service does not start, check the logs located at ''/var/log/opensearch/'' (in this case the file ''pandorafms.log'' or the name given to the node). </WRAP> <WRAP center round info 60%> サービスが開始しない場合は、''/var/log/opensearch/'' にあるログ (この場合はファイル ''pandorafms.log'' またはノードに指定された名前) を確認してください。 </WRAP> Remember that to check the installation and operation of OpenSearch you may run: OpenSearch のインストールと動作の確認は、次のコマンドで行なえます。 <code> curl -X GET https://<node-ip> -u 'admin:admin' --insecure </code> <wrap #ks4 /> ===== OpenSearch クラスタのセットアップ ===== For OpenSearch cluster configuration, it is recommended to follow the official documentation: OpenSearch クラスターの設定については、公式ドキュメントに従うことをお勧めします。 https://opensearch.org/blog/optimize-opensearch-index-shard-size/ A [[:en:documentation:pandorafms:technical_annexes:47_pfms_opensearch_cluster|configuration guide for Pandora FMS]] is also provided. [[:ja:documentation:pandorafms:technical_annexes:47_pfms_opensearch_cluster|Pandora FMS の設定ガイド]] も提供しています。 <wrap #ks5 /> ===== OpenSearch ユーザ管理 ===== To change the default password from ''admin'', a series of steps must be followed. The first thing is to export the variable to use the Java® JDK installed by OpenSearch to use any of the tools: デフォルトのパスワードを ''admin'' から変更するには、一連の手順に従う必要があります。 まず、OpenSearch によってインストールされた Java® JDK を使用していずれかのツールを使用できるように変数をエクスポートします。 <code> export OPENSEARCH_JAVA_HOME=/usr/share/opensearch/jdk </code> Then, to generate the hashed password to place in the OpenSearch configuration file, the following script is used (replace ''< password >'' with the password to use): 次に、ハッシュ化されたパスワードを生成して OpenSearch 設定ファイルに配置するために、次のスクリプトを使用します (''< password >'' を使用するパスワードに置き換えます)。 <code> /usr/share/opensearch/plugins/opensearch-security/tools/hash.sh -p <password> </code> For example: 例: {{ :wiki:opensearch-hash_sh.png }} Then open the file ''/etc/opensearch/opensearch-security/internal_users.yml'' with the text editor **vim** or **nano** to modify the password of the required user or users. 次に、テキストエディタ **vim** または **nano** でファイル ''/etc/opensearch/opensearch-security/internal_users.yml'' を開き、必要なユーザのパスワードを変更します。 <WRAP center round tip 60%> It is recommended to leave only the ''admin'' user for use with Pandora FMS, it is unnecessary to maintain any other user. </WRAP> <WRAP center round tip 60%> Pandora FMS で使用するために ''admin'' ユーザのみを残すことをお勧めします。他のユーザを維持する必要はありません。 </WRAP> Example file: ファイル例: {{ :wiki:opensearch-internal_users_yml.png }} To make the changes effective, the following must be executed: 変更を有効にするには、以下を実行する必要があります。 <code> cd /usr/share/opensearch/plugins/opensearch-security/tools </code> <code> OPENSEARCH_JAVA_HOME=/usr/share/opensearch/jdk ./securityadmin.sh -cd /etc/opensearch/opensearch-security/ -cacert /etc/opensearch/root-ca.pem -cert /etc/opensearch/kirk.pem -key /etc/opensearch/kirk-key.pem -icl -nhnv-t internalusers -icl -nhnv -cacert /etc/opensearch/root-ca.pem -cert /etc/opensearch/kirk.pem -key /etc/opensearch/ kirk-key.pem </code> A final message ''Done with success'' should be displayed; to check the new password (following the previous example with ''pandora'' used): 最後のメッセージ ''Done with success'' が表示されます。 新しいパスワードを確認するには (''pandora'' を使用した前の例に従って) 次のようにします: {{ :wiki:opensearch-curl_ku.png }} For more information on user management in OpenSearch: OpenSearch でのユーザ管理の詳細については、以下を参照してください。 * [[https://opensearch.org/docs/latest/security/configuration/yaml/|https://opensearch.org/docs/latest/security/configuration/yaml/]] * [[https://opensearch.org/docs/latest/security/access-control/users-roles/#create-users|https://opensearch.org/docs/latest/security/access-control/users-roles/#create-users]] <wrap #ks6 /> ===== OpenSearch を使用する Pandora FMS 設定 ===== To configure Pandora FMS with OpenSearch see the topic "[[:en:documentation:pandorafms:monitoring:09_log_monitoring#ks3_1|Log collection and monitoring]]". OpenSearch を使用するように Pandora FMS を設定するには、"[[:ja:documentation:pandorafms:monitoring:09_log_monitoring#コンソールの設定|ログ収集と監視]]" を参照してください。 <wrap #ks6_1 /> ==== データモデルとテンプレート ==== Before setting an environment into production, whether it is a single node or a data cluster, it is recommended to apply the corresponding configurations to this node or cluster based on its use. In the case of indexes generated by **Pandora FMS**, the most effective way to do so is by 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 not have any impact on existing indexes. </WRAP> <WRAP center round important 60%> テンプレートは、インデックスの作成時にのみ適用される設定です。 テンプレートを変更しても、既存のインデックスには影響しません。 </WRAP> To create a **basic template**, you only need to define the following fields: **基本テンプレート**を作成するには、次のフィールドを定義するだけで済みます。 <code> curl -X PUT -ku 'admin:admin' https://<node_ip>:9200/_index_template/pandorafms -H 'Content-Type: application/json' -d' { "index_patterns": [ "pandorafms*" ], "template": { "aliases": { "pandorafms_logs": {} }, "settings": { "number_of_shards": 1, "auto_expand_replicas" : "0-1", "number_of_replicas": "0" }, "mappings" : { "properties" : { "agent_id" : { "type" : "long" }, "group_id" : { "type" : "long" }, "group_name" : { "type" : "text" }, "logcontent" : { "type" : "text" }, "source_id" : { "type" : "text" }, "suid" : { "type" : "text" }, "type" : { "type" : "text" }, "utimestamp" : { "type" : "long" }, "@timestamp": { "type": "date" } } } } } ' </code> Through [[:en:documentation:03_monitoring:09_log_monitoring#configuracion_de_la_consola|Pandora FMS (menu)]] interface you may upload said template: [[:ja:documentation:03_monitoring:09_log_monitoring|Pandora FMS (メニュー)]] インターフェイスを通じて、上記のテンプレートをアップロードできます。 * **PUT _template/<template_name>**: in this example ''PUT _template/pandorafms'' . You can also check the templates through the same Pandora FMS interface: * **PUT _template/<template name>**: この例では、 ''PUT _template/pandorafms'' です。 Pandora FMS インターフェイス自体を通じてテンプレートを確認することもできます。 * **GET _template/<template_name>**: in this example ''GET _template/pandorafms'' . * **GET _template/<template_name>**: この例では、 ''GET _template/pandorafms'' です。 <wrap #ks6_2 /> ==== 複数ノードテンプレート ==== To define a **multi-node template**, you must take the following information into account: **複数ノードテンプレート**を定義するには、次の情報を考慮してください。 * When performing the template configuration (JSON format), **you need to configure as many shards as you have nodes**; however, to correctly configure replicas, **you must subtract 1 from the number of nodes in the environment**. * テンプレート (JSON 形式) を設定する場合、**存在するノードと同じ数のシャードを設定する必要があります**。ただし、レプリカを正しく設定するには、**環境内のノードの数から 1 を減算します**。 For example, in a Pandora FMS environment with 3 configured nodes, when you modify the ''number_of_shards'' and ''number_of_replicas'' fields, it should look like this: たとえば、3 つのノードが設定された Pandora FMS 環境で、''number_of_shards'' フィールドと ''number_of_replicas'' フィールドを変更すると、次のようになります。 <code> { "index_patterns": ["pandorafms*"], "settings": { "number_of_shards": 3, "auto_expand_replicas" : "0-1", "number_of_replicas" : "2" }, </code> From the command line you may list the environment templates by executing: コマンドラインから次のコマンドを実行して、環境テンプレートを一覧表示できます。 <code> curl -X GET "localhost:9200/_cat/templates/*?v=true&s=name&pretty" </code> You may also see the details of a template, for example, created for ''pandorafms'' by running: 次のコマンドを実行すると、たとえば ''pandorafms'' 用に作成されたテンプレートの詳細を確認することもできます。 <code> curl -X GET "localhost:9200/_template/pandorafms*?pretty" </code> which will return the defined configuration in JSON format. これにより、定義した設定が JSON 形式で返されます。 You can perform these operations through the Pandora FMS interface: これらの操作は、Pandora FMS インターフェイスを通じて実行できます。 * **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 view the created template. * **PUT _template/<template_name> {json_data}**: 作成するテンプレートのデータを入力します。 * **GET _template/><template_name>**: 作成したテンプレートを確認できます。 To configure Pandora FMS with OpenSearch, see "[[:en:documentation:pandorafms:monitoring:09_log_monitoring#configuracion_de_la_consola|Log collection and monitoring]]". OpenSearch を使うように Pandora FMS を設定するには、"[[:ja:documentation:pandorafms:monitoring:09_log_monitoring|ログ収集と監視]]" を参照してください。 <wrap #ks6 /> ===== SIEM のインストール要件 ===== To be able to use the Pandora FMS SIEM functionality, the following additional steps are required: Pandora FMS SIEM 機能を使用するには、以下の追加手順が必要です。 - It is necessary to have at least one OpenSearch database on an extra dedicated instance (server). - It is necessary to have [[:en:documentation:pandorafms:monitoring:09_log_monitoring|log collection]] enabled. - At a minimum, the OpenSearch server must have 4 cores, 8 GB of RAM, and 100 GB of high-speed SSD disk. - Recommended for higher performance: Deploy a dedicated instance (server) for the SIEM events server. - A license with the SIEM functionality enabled. - 専用のインスタンス(サーバ)上に、少なくとも 1つの OpenSearch データベースを配置する必要があります。 - [[:ja:documentation:pandorafms:monitoring:09_log_monitoring|ログ収集]]を有効にする必要があります。 - OpenSearch サーバは、最低でも 4コア、8GB の RAM、100GB の高速 SSD ディスクを搭載している必要があります。 - パフォーマンス向上のためには、SIEM イベントサーバ専用のインスタンス(サーバ)をデプロイすることをお勧めします。 - SIEM 機能が有効になっているライセンスが必要です。 Additionally, [[:en:documentation:pandorafms:cybersecurity:21_siem#ks4|SIEM Events and the SIEM server must be activated]] from the Console. さらに、コンソールから[[:ja:documentation:pandorafms:cybersecurity:21_siem#ks4|SIEM イベントと SIEM サーバを有効化する必要があります]]。 [[ja:documentation:pandorafms:start|Pandora FMS ドキュメント一覧に戻る]] CKG Edit ja/documentation/pandorafms/technical_annexes/38_opensearch_installation.txt 最終更新: 2026/04/04 08:07by junichi