目次
ElasticSearchのインストール
ElasticSearchのリポジトリを作成します。
vi /etc/yum.repos.d/elasticsearch.repo
--------------------
[elasticsearch]
name=Elasticsearch repository for 8.x packages
baseurl=https://artifacts.elastic.co/packages/8.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
autorefresh=1
type=rpm-md
作成したリポジトリを指定してインストールします。
sudo dnf install -y --enablerepo=elasticsearch elasticsearch
---
Elasticsearch repository for 8.x packages 9.7 MB/s | 53 MB 00:05
Last metadata expiration check: 0:00:18 ago on Fri Feb 23 19:48:14 2024.
Dependencies resolved.
================================================================================
Package Architecture Version Repository Size
================================================================================
Installing:
elasticsearch x86_64 8.12.2-1 elasticsearch 593 M
Transaction Summary
================================================================================
Install 1 Package
Total download size: 593 M
Installed size: 1.2 G
Is this ok [y/N]: y
Downloading Packages:
elasticsearch-8.12.2-x86_64.rpm 11 MB/s | 593 MB 00:55
--------------------------------------------------------------------------------
Total 11 MB/s | 593 MB 00:55
Elasticsearch repository for 8.x packages 25 kB/s | 1.8 kB 00:00
Importing GPG key 0xD88E42B4:
Userid : "Elasticsearch (Elasticsearch Signing Key) <dev_ops@elasticsearch. org>"
Fingerprint: 4609 5ACC 8548 582C 1A26 99A9 D27D 666C D88E 42B4
From : https://artifacts.elastic.co/GPG-KEY-elasticsearch
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: elasticsearch-8.12.2-1.x86_64 1/1
Creating elasticsearch group... OK
Creating elasticsearch user... OK
Installing : elasticsearch-8.12.2-1.x86_64 1/1
Running scriptlet: elasticsearch-8.12.2-1.x86_64 1/1
--------------------------- Security autoconfiguration information ------------- -----------------
Authentication and authorization are enabled.
TLS for the transport and HTTP layers is enabled and configured.
The generated password for the elastic built-in superuser is : ARaRSdpOgUorvi3iPLE=
If this node should join an existing cluster, you can reconfigure this with
'/usr/share/elasticsearch/bin/elasticsearch-reconfigure-node --enrollment-token <token-here>'
after creating an enrollment token on your existing cluster.
You can complete the following actions at any time:
Reset the password of the elastic built-in superuser with
'/usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic'.
Generate an enrollment token for Kibana instances with
'/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana'.
Generate an enrollment token for Elasticsearch nodes with
'/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node'.
----------
export ELASTIC_PASSWORD="ARaRSdpOgUorvi3iPLE="
ElasticSearchのクラスター生成に失敗する場合
「/etc/lasticsearch/elasticsearch.yml」設定ファイルの
「cluster.initial_master_nodes: [“localhost”]」をコメントにし
「discovery.typs: single-node」に置き換えます
/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
ERROR: Failed to determine the health of the cluster. Unexpected http status [503], with exit code 65
----
vi /etc/lasticsearch/elasticsearch.yml
---
#cluster.initial_master_nodes: ["localhost"]
discovery.type: single-node
---
sudo systemctl restart elasticsearch
/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
eyJ2ZXIiOiI4LjEyLjIiLCJhZHIiOlsiMTkyLjE2OC4xMC4yNTo5MjAwIl0sImZnciI6IjE0MDliYzM0NjMxZTMwZDFlM2YzZDY4NDRmMGFlODY1YmMyYjUwZTIxMDQ1NzQwZDllMDdjYzEyNjE1N2NhZjgiLCJrZXkiOiJHNnFQM1kwQlI1dFZuV2ZkZXZzbjpuZDVZZ3lGTlFleXJPdzVOVGJ1dWhBIn0=
Kibanaのイントール
Kibanaのリポジトリを作成します。
vi /etc/yum.repos.d/kibana.repo
--------------------
[kibana-8.x]
name=Kibana repository for 8.x packages
baseurl=https://artifacts.elastic.co/packages/8.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
作成したリポジトリを指定してインストールします。
sudo dnf install -y kibana
ファイアーウォールのポート開放を行います
firewall-cmd --add-port=5601/tcp --zone=public --permanent
firewall-cmd --reload
外部アクセスを有効にします。
vi /etc/kibana/kibana.yml
-------
#server.host: "localhost"
server.host: "0.0.0.0"
-------
systemctl restart kibana
http://[IPアドレス]:5601でアクセスします。
ElasticSearchのトークンを取得して入力して「Configure Elastic」をクリックします。
/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token --scope kibana
/usr/share/kibana/bin/kibana-verification-code
Your verification code is: 960 489
ユーザー名は「elastic」パスワードは起動時に表示された「ARaRSdpOgUorvi3iPLE=」を入力します
ElasticAPMのインストール
sudo yum install -y apm-server
sudo systemctl enable apm-server