お金をかけずにサーバーの勉強をしよう

OpenSearch Dashboardsインストール

2023年7月13日

メニューへ戻る

こんにちは。

OpenSearchインストール」でデータベースが動くようになりましたが、実際のデータの出し入れには基本的に何某かのプログラムを書かねばなりません。

サーバーエンジニアはそこまで気長な人間でもないので、ここではさっさと GUIツールをインストールします。

OpenSearch Dashboards って言うんですが、公式のサイトには画面ショットを載せた小綺麗なサイトは見つけられませんでした。
ただ OpenSearchのドキュメントに文書があるのみ…。
OpenSearch Dashboards


Ubuntu独自のインストール方法はないので、OpenSearchをインストールしたときと同じく、Debian用の debパッケージを利用してのインストールを行います。

2023年7月13日時点での OpenSearch Dashboardsのバージョンは 2.8.0 です。

環境は以下です。

インストール手順はこちら。
と言ってもパッケージをインストールするだけですが。
Installing OpenSearch Dashboards (Debian)


1.ダウンロード

ダウンロードはこちらから。
Download & Get Started

[Platform:] に [Linux]を、[Package:] に [x64 / deb] を選択し、Downloadを押します。
ダウンロードサイト

ダウンロードが完了すると [opensearch-dashboards-2.8.0-linux-x64.deb]ファイルができました。
好きな方法でこのファイルを Ubuntu Serverに持っていきます。

なお、WEBブラウザのない Ubuntu Serverで直接ダウンロードするのであれば、curlコマンドを使ってこんな風にやれます。

subro@UbuntuServer2204-1:~$ curl -Os https://artifacts.opensearch.org/releases/bundle/opensearch-dashboards/2.8.0/opensearch-dashboards-2.8.0-linux-x64.deb

subro@UbuntuServer2204-1:~$ ls -l opensearch-dashboards-2.8.0-linux-x64.deb
-rw-rw-r-- 1 subro subro 301346148  7月 13 09:06 opensearch-dashboards-2.8.0-linux-x64.deb



2.インストール

ダウンロードしたパッケージをインストールします。

subro@UbuntuServer2204-1:~$ sudo dpkg -i opensearch-dashboards-2.8.0-linux-x64.deb
以前に未選択のパッケージ opensearch-dashboards を選択しています。
(データベースを読み込んでいます ... 現在 111067 個のファイルとディレクトリがインストールされています。)
opensearch-dashboards-2.8.0-linux-x64.deb を展開する準備をしています ...
Running OpenSearch-Dashboards Pre-Installation Script
opensearch-dashboards (2.8.0) を展開しています...
opensearch-dashboards (2.8.0) を設定しています ...
Running OpenSearch-Dashboards Post-Installation Script
### NOT starting on installation, please execute the following statements to configure opensearch-dashboards service to start automatically using systemd
 sudo systemctl daemon-reload
 sudo systemctl enable opensearch-dashboards.service
### You can start opensearch-dashboards service by executing
 sudo systemctl start opensearch-dashboards.service

インストールできました。
メッセージに出ているように、この時点ではまだ OpenSearch Dashboardsは起動していません。


3.OpenSearch Dashboards初期設定

OpenSearch Dashboardsの設定ファイル
[/etc/opensearch-dashboards/opensearch_dashboards.yml]を編集します。

Ubuntu Serverのネットワークインターフェイス全てで待ち受ける設定
# server.host: "localhost"
 ↓↓↓↓↓
server.host: 0.0.0.0  ← コメントアウトの[#]を消すのを忘れずに

設定はこれで終わりです。


4.起動

パッケージインストールにより、systemd用のサービス定義をするファイルができていますので、これの自動起動を有効にします。

subro@UbuntuServer2204-1:~$ sudo systemctl enable opensearch-dashboards
Synchronizing state of opensearch-dashboards.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable opensearch-dashboards
Created symlink /etc/systemd/system/multi-user.target.wants/opensearch-dashboards.service → /lib/systemd/system/opensearch-dashboards.service.

有効化されました。

起動します。

subro@UbuntuServer2204-1:~$ sudo systemctl start opensearch-dashboards

subro@UbuntuServer2204-1:~$ systemctl status opensearch-dashboards
● opensearch-dashboards.service - "OpenSearch Dashboards"
     Loaded: loaded (/lib/systemd/system/opensearch-dashboards.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-07-13 09:29:06 JST; 11s ago
   Main PID: 1920 (node)
      Tasks: 11 (limit: 9347)
     Memory: 223.2M
        CPU: 9.023s
     CGroup: /system.slice/opensearch-dashboards.service
             └─1920 /usr/share/opensearch-dashboards/node/bin/node /usr/share/opensearch-dashboards/src/cli/dist

 7月 13 09:29:11 UbuntuServer2204-1 opensearch-dashboards[1920]: {"type":"log","@timestamp":"2023-07-13T00:29:11Z","tags":["warning","config","deprecation"],"pid":1920,"message":"\"opensearch.req>
 7月 13 09:29:11 UbuntuServer2204-1 opensearch-dashboards[1920]: {"type":"log","@timestamp":"2023-07-13T00:29:11Z","tags":["info","plugins-system"],"pid":1920,"message":"Setting up [48] plugins: >
 7月 13 09:29:12 UbuntuServer2204-1 opensearch-dashboards[1920]: {"type":"log","@timestamp":"2023-07-13T00:29:12Z","tags":["info","savedobjects-service"],"pid":1920,"message":"Waiting until all O>
 7月 13 09:29:12 UbuntuServer2204-1 opensearch-dashboards[1920]: {"type":"log","@timestamp":"2023-07-13T00:29:12Z","tags":["info","savedobjects-service"],"pid":1920,"message":"Starting saved obje>
 7月 13 09:29:12 UbuntuServer2204-1 opensearch-dashboards[1920]: {"type":"log","@timestamp":"2023-07-13T00:29:12Z","tags":["info","savedobjects-service"],"pid":1920,"message":"Creating index .kib>
 7月 13 09:29:12 UbuntuServer2204-1 opensearch-dashboards[1920]: {"type":"log","@timestamp":"2023-07-13T00:29:12Z","tags":["info","savedobjects-service"],"pid":1920,"message":"Pointing alias .kib>
 7月 13 09:29:12 UbuntuServer2204-1 opensearch-dashboards[1920]: {"type":"log","@timestamp":"2023-07-13T00:29:12Z","tags":["info","savedobjects-service"],"pid":1920,"message":"Finished in 240ms."}
 7月 13 09:29:13 UbuntuServer2204-1 opensearch-dashboards[1920]: {"type":"log","@timestamp":"2023-07-13T00:29:13Z","tags":["info","plugins-system"],"pid":1920,"message":"Starting [48] plugins: [u>
 7月 13 09:29:13 UbuntuServer2204-1 opensearch-dashboards[1920]: {"type":"log","@timestamp":"2023-07-13T00:29:13Z","tags":["listening","info"],"pid":1920,"message":"Server running at http://0.0.0>
 7月 13 09:29:14 UbuntuServer2204-1 opensearch-dashboards[1920]: {"type":"log","@timestamp":"2023-07-13T00:29:14Z","tags":["info","http","server","OpenSearchDashboards"],"pid":1920,"message":"htt>

起動しました。

これでインストールは完了です。


4.WEBブラウザでアクセス

5601/tcpの HTTPで待ち受けていますので、WEBブラウザでアクセスします。
この環境では [http://UbuntuServer2204-1:5601] です。


アカウント/パスワードは [kibanaserver/kibanaserver]でログインできます。
OpneSearch Dashboards画面 1

何やらデータを突っ込むよう促されていますが、早く画面を見たいので無視します。
[Explore on my own]をクリックします。
OpneSearch Dashboards画面 2

テナントの種類を選べと出ました。
他に選べないようなので、[Private]を選択し、Confirmを押します。
OpneSearch Dashboards画面 3

[OpenSearch Dashboards]をクリックします。
OpneSearch Dashboards画面 4

中々 Ki●anaの画面になりません。
イライラしますがここまでにしましょう。
OpneSearch Dashboards画面 5
イジり倒して見て下さい。


1年ぶりにインストールした OpenSearch Dashboardsですが、Ver.2.8.0では以前と大分変わっていました。
Elastic社のアレとどれだけ変わっているのか今は分かりません。

もし「俺はAWSに命を捧げるンだ!」というなら、ドップリと OpenSearchに浸かって、AWSと運命を共にすれば良いと思います。
そうでない人は Elastic社のプロダクトに行きましょう。


続きで「OpenSearchのユーザー追加」を書いています。