4
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.

アジャイルメトリクスをめざして - 導入編 (1) -

Last updated at Posted at 2023-04-16

IT スキル 0 の PM 系要員が書籍に触発されてITプロダクト開発のメトリクス収集と運用を目指す過程を記録しはじめたもの。
とりあえずは動けばよい。運用は走りながら考える方針。
(後で苦労するパターンだが許容する!)

0. 環境

  • 端末:DX-T5 (Thirdwave Corporation)
    • CPU:i5-1135G7
    • RAM:16.0 GB
  • OS:Microsoft Windows 11 Pro
  • WSL : Ubuntu 22.04.2 LTS \n \l
    • Elasticsearch 8.7
    • Kibana 8.7

1. WSL 導入

下記コマンドを Windows Terminal 上で実行

wsl --update
wsl --install -d Ubuntu

2. Ubuntu 環境最新化

下記コマンドを WSL の Terminal 上で実行

sudo apt update
sudo apt full-upgrade -y

WSL2 の systemd 対応として wsl.conf を作成

sudo vim /etc/wsl.conf

追記内容は以下の通り。

/etc/wsl.conf
[boot]
systemd=true

上記設定後、Windows Terminal にて WSL を再起動

wsl --shutdown
Ubuntu

3. ElasticSearch 導入

下記コマンドを Terminal 上で順次実行する。

3.1. ElasticSearch インストール

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
sudo apt install apt-transport-https
echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
sudo apt update
sudo apt install elasticsearch 

インストール完了時に下記メッセージがでるので、superuser のパスワードを控えておく。

--------------------------- 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 : <password>

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'.

-------------------------------------------------------------------------------------------------

3.2. ElasticSearch サービス起動

sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service

3.3. ElasticSearch 稼働確認

接続時に先ほど控えたパスワードを入力

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

実行結果

Enter host password for user 'elastic':
{
  "name" : "DX-T5",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "Wl6FAB7LRP6eCMCVuyrRhw",
  "version" : {
    "number" : "8.7.0",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "09520b59b6bc1057340b55750186466ea715e30e",
    "build_date" : "2023-03-27T16:31:09.816451435Z",
    "build_snapshot" : false,
    "lucene_version" : "9.5.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

3.4. 日本語を扱う Analyzer の導入

cd /usr/share/elasticsearch
sudo bin/elasticsearch-plugin install analysis-kuromoji
sudo systemctl restart elasticsearch

4. Kibana 導入

4.1. Kibana インストール

sudo apt install kibana 

4.2. Kibana サービス起動

sudo systemctl daemon-reload
sudo systemctl enable kibana.service
sudo systemctl start kibana.service

4.3. Kibana 稼働確認

下記コマンドで出力されたトークンを控えておく

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

ブラウザを起動し、 http://localhost:5601/ にアクセス
控えたトークンを入力して終了。

今日はここまで。
実際は、Try & Error で上記のような綺麗な手順で実施していない。
そのため、手順を検証した上で記事が修正する予定はある(未定で終わる可能性もある)

参考資料

4
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
4
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?