ちょっと話題の記事

Kibana v5.0.0を触ってみた #elasticon

2016.02.20

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

※ 5系は2016/02/20時点ではまだ開発中のフェーズです。

はじめに

藤本@シアトルです。Airbnbの宿がなかなか見つからず、深夜0時過ぎのシアトルを30分ほど彷徨いました。。一桁気温の中の野宿がよぎり怖かったです。

さて、Elastic{ON}2016でELKBスタックの次期バージョンが5系になると発表がありました。 Opening Keynoteや各プロダクトのOverviewセッションで度々新しい機能が紹介され、ワクワクさせられました。

現在はまだα版を準備中の段階で、触ることができません。

Introducing_5_0__Elastic_Stack__X-Pack___Elastic_Cloud___Elastic

と思っていたら、Githubを覗いたところ、5.0.0-SNAPSHOTが公開されていました。まだα版にもなっていないので機能的には不完全かもしれませんが、雰囲気だけ味わってみました。

elastic_kibana__Kibana

Kibanaインストール

Githubからコードを取得します。

# git clone https://github.com/elastic/kibana.git
Cloning into 'kibana'...
remote: Counting objects: 117906, done.
remote: Compressing objects: 100% (105/105), done.
remote: Total 117906 (delta 58), reused 0 (delta 0), pack-reused 117797
Receiving objects: 100% (117906/117906), 85.88 MiB | 591.00 KiB/s, done.
Resolving deltas: 100% (79324/79324), done.
Checking connectivity... done.

次にBranchを確認してみます。

# git branch -a
* master
(略)
remotes/origin/HEAD -> origin/master
remotes/origin/elasticon
(略)

elasticonブランチが一番コミット数が多いようなので、Checkoutします。

# git checkout remotes/origin/elasticon
Note: checking out 'remotes/origin/elasticon'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

HEAD is now at 8270c7e... Add logout link to settings page

ソースコードしかないので、パッケージをインストールします。

# npm install
npm WARN deprecated babel-core@5.8.23: Babel 5 is no longer being maintained. Upgrade to Babel 6.
npm WARN deprecated graceful-fs@3.0.8: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN deprecated css-list@0.1.3: Deprecated.
npm WARN deprecated graceful-fs@2.0.3: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN deprecated lodash-node@2.4.1: This package has been discontinued in favor of lodash@^4.0.0.
npm WARN deprecated lodash@2.4.1: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.

(略)

npm WARN supertest-as-promised@2.0.2 requires a peer of supertest@* but none was installed.

これでインストールが完了しました。

Elasticsearchインストール

Elasticsearch 2.2.0を起動して、Kibanaを起動するとバージョン互換性のエラーが発生します。

# ./kibana/bin/kibana
log [03:04:20.263] [info][status][plugin:kibana] Status changed from uninitialized to green - Ready
log [03:04:20.281] [info][status][plugin:elasticsearch] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [03:04:20.292] [info][status][plugin:kbn_doc_views] Status changed from uninitialized to green - Ready
log [03:04:20.294] [info][status][plugin:kbn_vislib_vis_types] Status changed from uninitialized to green - Ready
log [03:04:20.297] [info][status][plugin:markdown_vis] Status changed from uninitialized to green - Ready
log [03:04:20.302] [info][status][plugin:metric_vis] Status changed from uninitialized to green - Ready
log [03:04:20.305] [info][status][plugin:spyModes] Status changed from uninitialized to green - Ready
log [03:04:20.309] [info][status][plugin:statusPage] Status changed from uninitialized to green - Ready
log [03:04:20.314] [info][status][plugin:table_vis] Status changed from uninitialized to green - Ready
log [03:04:20.317] [info][status][plugin:testsBundle] Status changed from uninitialized to green - Ready
log [03:04:20.365] [info][listening] Server running at https://0.0.0.0:5601
log [03:04:20.408] [error][status][plugin:elasticsearch] Status changed from yellow to red - This version of Kibana requires Elasticsearch ^3.0.0 on all nodes. I found the following incompatible nodes in your cluster: Elasticsearch v2.2.0 @ 127.0.0.1:9200 (127.0.0.1)

Kibana 5.0.0はElasticsearch 3.0.0以上が動作要件となっています。

ですが、Elasticsearch v3.0.0も同じように(雑)Githubからインストールできました。

# curl localhost:9200
{
"name" : "Asp",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "3.0.0",
"build_hash" : "N/A",
"build_date" : "2016-02-18T00:38:29.622Z",
"build_snapshot" : true,
"lucene_version" : "5.5.0"
},
"tagline" : "You Know, for Search"
}

Kibanaを起動すると、

# ./kibana/bin/kibana
log [03:07:23.873] [info][status][plugin:kibana] Status changed from uninitialized to green - Ready
log [03:07:23.892] [info][status][plugin:elasticsearch] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [03:07:23.902] [info][status][plugin:kbn_doc_views] Status changed from uninitialized to green - Ready
log [03:07:23.908] [info][status][plugin:kbn_vislib_vis_types] Status changed from uninitialized to green - Ready
log [03:07:23.912] [info][status][plugin:markdown_vis] Status changed from uninitialized to green - Ready
log [03:07:23.915] [info][status][plugin:metric_vis] Status changed from uninitialized to green - Ready
log [03:07:23.917] [info][status][plugin:spyModes] Status changed from uninitialized to green - Ready
log [03:07:23.920] [info][status][plugin:statusPage] Status changed from uninitialized to green - Ready
log [03:07:23.930] [info][status][plugin:table_vis] Status changed from uninitialized to green - Ready
log [03:07:23.933] [info][status][plugin:testsBundle] Status changed from uninitialized to green - Ready
log [03:07:23.969] [info][status][plugin:elasticsearch] Status changed from yellow to green - Kibana index ready
log [03:07:23.972] [info][listening] Server running at https://0.0.0.0:5601

起動しました。

触ってみた

接続

Kibanaにアクセスします。

プライバシー_エラー

お、標準の接続がHTTPSになったみたいです。

強引に突破しても良いですが、kibana.ymlにSSLサーバ証明書、ドメインを設定します。

再度、Kibanaにアクセスします。

Settings_-_Kibana

おー、Opening Keynoteで見たページが表示されました。

左メニューにマウスオーバーすると、メニューが広がります。Kibana 4系よりもポップな感じになりました。

Settings_-_Kibana

バージョンも5.0.0で表記されています。

Settings_-_Kibana

可視化

テストデータとして、access_logをElasticsearchにインデックスします。

DiscoveryやVisualizationは変わらないですね。

Discover_-_Kibana

Visualize_-_Kibana

ダッシュボードもいい感じですね。

Dashboard_-_Kibana

まとめ

Kibana 5系ではプラグイン開発の土台が整ったということが今回のメインだと思います。 その他のアップデートをあまり把握できておらず、画面の紹介だけとなりました。 早くデモ展示されていた「Facechimp」や「Graph API」を触りたいです。リリース期待しています!