プログラミング、ガジェット、趣味ネタを配信するブログ

雑記

Elastic APM のインストール手順について

投稿日:

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

参考URL

https://www.elastic.co/jp/downloads/apm

https://note.com/green_blue_sky/n/n546d00562ef5

-雑記

執筆者:ワカメ


comment

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

関連記事

GameCreatorsConference2019に行ってきました!

ゲームの大規模勉強会「ゲームクリエイターズカンファレンス2019」に行ってきました! 勉強会といっても、講演を聞いて質疑応答などを行う感じです。 チケット代は4000円とちょっとお高め。 参加した講演 …

【GCC_2019】「大規模ゲーム開発におけるフリーラン実装事例 ~気持ちよく走り続けさせるために~」の感想

今回はGCCで見てきた講演の1つ「大規模ゲーム開発におけるフリーラン実装事例 ~気持ちよく走り続けさせるために~」について ざっくりとですが、書いていこうと思います。 スライドはこちら 概要 実際のゲ …

瞑想セミナーを受講した感想

最近、瞑想って集中力アップやストレス緩和などに効果があるとのことで、 気になり瞑想セミナーを受講してみました。 大体何をしたのかと感想をメモ書き程度に書いていこうと思います。 瞑想セミナーの流れ 瞑想 …

CppCheckをVisualStudioで使う方法

静的解析ツールを使用したいと思いフリーのcppcheckを使用してみようと思います。 CppCheckのインストール https://cppcheck.sourceforge.io/ こちらのリンクか …

インディーゲームの祭典「A 5th of BitSummit」の講演動画が上がっていました!

5月20日、21日に京都市勧業館「みやこめっせ」で開催された インディーゲームの祭典「A 5th of BitSummit」の講演動画が「Twitch」に上がっていました。 まだ見れていないですが、ゲ …

スポンサー 人気記事 最近の投稿
Exit mobile version