0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Elasticsearch Kibana構築

Posted at

はじめに

ElasticsearchとKibanaの構築についてまとめます。
OSはRocky8を使用します。
単純にレポジトリを登録し、dnfでインストールします。

Elasticsearch インストール

  1. /etc/yum.repo.d/elasticsearch.repoを作成
  2. elasticsearch.repoに以下を記入
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

3.dnfコマンドを実行して、インストールする。

sudo dnf install --enablerepo=elasticsearch elasticsearch

4.elastic ユーザのパスワードを発行

/usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic

5.elasticsearchの起動時にjournalにログが残らないようなので、
[/usr/lib/systemd/system/elasticsearch.service]内のExecStartから、
--quietを削除する

ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elastics
earch.pid --quiet ← これを削除

6.curlコマンドで、elasticsearchの動作確認をする。

 curl --cacert /etc/elasticsearch/certs/http_ca.crt -u elastic https://localhost:9200

実行すると、以下のように結果が返ってくる。

Enter host password for user 'elastic':
{
  "name" : "elastic",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "IWhFw9_aQU-kyfOF26xYqw",
  "version" : {
    "number" : "8.6.2",
    "build_flavor" : "default",
    "build_type" : "rpm",
    "build_hash" : "2d58d0f136141f03239816a4e360a8d17b6d8f29",
    "build_date" : "2023-02-13T09:35:20.314882762Z",
    "build_snapshot" : false,
    "lucene_version" : "9.4.2",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

Kibana インストール

  1. /etc/yum.repo.d/kibana.repoを作成
  2. kibana.repoに以下を記入
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

3.dnfコマンドを実行して、インストールする。

sudo dnf install -y kibana

4.Elasticsearch登録用のトークンを生成する。

'/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana'

5.ブラウザからアクセスすることになるので、/etc/kibana/kibana.ymlより、以下を修正する。

/etc/kibana/kibana.yml
server.host: "<KibanaサーバのIPアドレス>”

KibanaへElasticSearchを登録

http://<kibanaのIPアドレス>:5601 」 へブラウザでアクセスする。以下のような画面が表示される。

elastic_int.png

生成したElasticsearch登録用のトークンを入力し、[Configure Elastic]をクリックする。
トークンが通ると、code入力画面が表示されます。

elastic_verifi.png

「/usr/share/kibana/bin/kibana-verification-code」を実行し、codeを生成します。
生成したcodeを入力すると、kibanaの画面が表示されます。

まとめ

今回は以下参照
https://www.elastic.co/guide/en/elasticsearch/reference/8.6/rpm.html 

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?