What’s new in Elastic Stack 7.1?

A presentation at Middlewares Deep Talks in May 2019 in Tokyo, Japan by Jun Ohtani

Slide 1

Slide 1

What’s new in Elastic Stack 7.0? Jun Ohtani, Developer | Evangelist 2019/05/23 Middlewares Deep Talks

Slide 2

Slide 2

What’s new in Elastic Stack 7.0 7.1? Jun Ohtani, Developer | Evangelist 2019/05/23 Middlewares Deep Talks

Slide 3

Slide 3

about • • !3 Me, Jun Ohtani / Community Engineer ‒ Elasticsearch勉強会 / 検索技術勉強会 ‒ データ分析基盤構築入門 共著 ‒ http://blog.johtani.info Elastic, founded in 2012 ‒ Products: Elasticsearch, Logstash, Kibana, Beats Elastic APM, Elastic Cloud, Swiftype Professional services: Support & development subscriptions Trainings, Consulting, SaaS

Slide 4

Slide 4

7.1リリース • Elastic Cloud on Kubernetes • Kubernetes Operator pattern • Dynamically scaling local storage w/ Elastic Local Volume 4

Slide 5

Slide 5

7.1リリース • Securityの機能がBasicの対象に • TLS • File and native realm • RBAC 5

Slide 6

Slide 6

Elasticsearch

Slide 7

Slide 7

新世代クラスター管理層 Node B クラスター管理を将来のための基盤として 再構築 強固な理論と広範囲なテスト Node A 形式モデルで検証済み 利点 minimum_master_nodes設定の排除 1秒以内でのマスター選出 ラグやゾンビノードの迅速な除去 https://ela.st/new-cluster-coordination 7 Node C

Slide 8

Slide 8

Cluster Coordination? 8

Slide 9

Slide 9

自動的な分散 node 1 orders 1 2 3 4 products 1 2 !9

Slide 10

Slide 10

自動的な分散 node 1 node 2 orders orders 1 2 1 2 3 4 3 4 products 1 !10 products 2

Slide 11

Slide 11

自動的な分散 node 1 node 2 node 3 orders orders orders 1 2 4 products 1 !11 2 3 products 2 1 3 4 products

Slide 12

Slide 12

Cluster State? 12

Slide 13

Slide 13

Cluster State Metadata about a cluster • Cluster settings • Index metadata ‒ settings ‒ mappings ‒ where are my shards? ‒ which shards are in sync? • Lots more besides… GET _cluster/state 13

Slide 14

Slide 14

Cluster Coordination • Making sure all nodes have the latest cluster state • Making sure cluster state updates are not lost • (Making sure all nodes are healthy) 14

Slide 15

Slide 15

Scope 15

Slide 16

Slide 16

How does it work? Discovery 16 Master Election Cluster State Publication • Where are the mastereligible nodes? • Agree on a node to take charge • Agree on updates to cluster state • Is there already a master? • Form a cluster • Broadcast updates to all nodes

Slide 17

Slide 17

Agree? 17

Slide 18

Slide 18

Agree? 18

Slide 19

Slide 19

Agree? 19

Slide 20

Slide 20

Agree? 20

Slide 21

Slide 21

Agree? 21

Slide 22

Slide 22

Agree? 22

Slide 23

Slide 23

Agree? 23

Slide 24

Slide 24

Agree? 24

Slide 25

Slide 25

Voting configurations GET /_cluster/state?filter_path=nodes.*.name,metadata.cluster_coordination.last_committed_config => { “nodes”: { “ATdJrEZ6Rj62Sh7-UxhP5w”: {“name”: “vfMBDxJ-R0SdXyAu9wN-4Q”: {“name”: “kEyYc7lRTcqDjiWJkgG7qA”: {“name”: “w0GviS2DTNajk85-_dJ6nQ”: {“name”: }, “metadata”: { “cluster_coordination”: { “last_committed_config”: [ “ATdJrEZ6Rj62Sh7-UxhP5w”, “kEyYc7lRTcqDjiWJkgG7qA”, “w0GviS2DTNajk85-_dJ6nQ” ] } } } 25 “node-0”}, “node-1”}, “node-2”}, “node-3”}

Slide 26

Slide 26

How do we use it? Discovery “Where are all the master-eligible nodes?” • Settings ‒ discovery.seed_nodes (formerly discovery.zen.ping.unicast.hosts) ‒ Hostnames or IP addresses (maybe with transport ports) ‒ discovery.seed_providers (formerly discovery.zen.hosts_provider) ‒ file, ec2, gce, … ‒ some providers have extra settings too 26

Slide 27

Slide 27

How do we use it? Cluster bootstrapping “Which nodes count in the very first election?” • Settings ‒ cluster.initial_master_nodes ‒ node names or transport addresses (IP addresses only) ‒ ok to set this on multiple nodes, as long as they’re all consistent ‒ ignored once node has joined a cluster, even if restarted ‒ unnecessary when joining a new node to an existing cluster 27

Slide 28

Slide 28

How do we use it? Other settings “What else can we adjust?” • Lots of other settings ‒ see reference manual • Defaults are good • Changing them is not recommended 28

Slide 29

Slide 29

How do we use it? Dynamic clusters “How do we add or remove a node?” • Master-ineligible nodes ‒ no different from earlier versions • Adding master-eligible nodes ‒ just do it, no settings to adjust • Removing master-eligible nodes ‒ just do it, as long as you remove less than half of them at once 29

Slide 30

Slide 30

Troubleshooting Troubleshooting Logging when things go wrong Logging when things go wrong • ClusterFormationFailureHelper • ClusterFormationFailureHelper ‒‒ WARN WARNcomprehensive comprehensiveperiodic periodicstatus statusupdate updatewhile whilecluster clusternot notformed formed [2019-04-04T10:02:10,276][WARN ][o.e.c.c.ClusterFormationFailureHelper] ][o.e.c.c.ClusterFormationFailureHelper] [node[node-5] not discovered or elected yet, an election requires at 2least 5] mastermaster not discovered or elected yet, an election requires at least nodes2 nodes with ids[QsZt-170SBeRpHJbWb-W6Q, from [QsZt-170SBeRpHJbWb-W6Q, 9becUMgvTF-DbSDZ2uf_Og, with ids from 9becUMgvTF-DbSDZ2uf_Og, EpyPd38tQhKES91p_23WgA], have discovered discovered [{node-0}{S68ml-4eREaGpmkVrnjorw} [{node-0}{S68ml-4eREaGpmkVrnjorw} EpyPd38tQhKES91p_23WgA], have {127.0.0.1:9300}] which is is not not a a quorum; quorum; discovery discovery will will continue continue using using {127.0.0.1:9300}] which [127.0.0.1:9300, 127.0.0.1:9301, 127.0.0.1:9302, 127.0.0.1:9302, 127.0.0.1:9303, 127.0.0.1:9303, [127.0.0.1:9300, 127.0.0.1:9301, 127.0.0.1:9304] from hosts hosts providers providers and and [{node-4}{9becUMgvTF-DbSDZ2uf_Og} [{node-4}{9becUMgvTF-DbSDZ2uf_Og} 127.0.0.1:9304] from {127.0.0.1:9304}, {node-5}{EpyPd38tQhKES91p_23WgA}{127.0.0.1:9305}] from from lastlast{127.0.0.1:9304}, {node-5}{EpyPd38tQhKES91p_23WgA}{127.0.0.1:9305}] known cluster state; node term 42, last-accepted version 165 in term 42 known cluster state; node term 42, last-accepted version 165 in term 42 26 30

Slide 31

Slide 31

Troubleshooting Logging when things go wrong • ClusterFormationFailureHelper ‒ WARN comprehensive periodic status update while cluster not formed [2019-04-04T10:02:10,276][WARN ][o.e.c.c.ClusterFormationFailureHelper] [node5] master not discovered or elected yet, an election requires at least 2 nodes with ids from [QsZt-170SBeRpHJbWb-W6Q, 9becUMgvTF-DbSDZ2uf_Og, EpyPd38tQhKES91p_23WgA], have discovered [{node-0}{S68ml-4eREaGpmkVrnjorw} {127.0.0.1:9300}] which is not a quorum; discovery will continue using [127.0.0.1:9300, 127.0.0.1:9301, 127.0.0.1:9302, 127.0.0.1:9303, 127.0.0.1:9304] from hosts providers and [{node-4}{9becUMgvTF-DbSDZ2uf_Og} {127.0.0.1:9304}, {node-5}{EpyPd38tQhKES91p_23WgA}{127.0.0.1:9305}] from lastknown cluster state; node term 42, last-accepted version 165 in term 42 27 31

Slide 32

Slide 32

トップヒットクエリの高速化 クエリ性能の改善によるユーザー体験の向上 Block-MAX WANDアルゴリズムによる新実装 アプリケーション検索、エンタープライズ検 索のようなユースケースにマッチ 以下のユースケースは対象外: 32 • aggregation • Kibana (aggregationを利用) • 正確なヒット件数が必要

Slide 33

Slide 33

Script Score Query カスタムスコアのための関数を定義 全フィールドが対象 _scoreも対象 正規化 ” ” ” Saturation Logarithm Sigmoid Painlessで記述も可能 もちろん提供済みの関数もOK 33 “script” : { “source” : “decayGeoExp(params.origin, params.scale, params.offset, params.decay, doc[‘location’].value)”, “params”: { “origin”: “40, -70.12”, “scale”: “200km”, “offset”: “0km”, “decay” : 0.2 } }

Slide 34

Slide 34

Rank Features Query 新しいデータタイプ: ” ” rank_feature rank_features (rank_featureのベクトル) 関連ランキングスコアに追加可能 PUT my_index { “mappings”: { “properties”: { “pagerank”: { “type”: “rank_feature” }, “url_length”: { “type”: “rank_feature”, 追加前の正規化も可能: ” Saturation ” Logarithm ” Sigmoid top-kクエリの高速化にも利用できる設計の ため、性能も向上 34 “positive_score_impact”: false } } } }

Slide 35

Slide 35

クラスター横断検索 (CCS) の 改善 WANのために最適化された新実行モードの 登場 (ccs_minimize_roundtrips) CCS 6.7以前: リモートクラスターにある各シャードから の応答により、ネットワーク上を多数の小 さなリクエストが発生 7.0以降: 各リモートクラスターのcoordinatingノード から1度の応答により、ネットワーク上の リクエスト回数を削減 35 Cluster 1 Cluster 2

Slide 36

Slide 36

JVM のバンドル ElasticsearchにJDK (OpenJDKを利用)を バンドルして配布 Javaのインストール手順をなくすことで インストールを簡易化 必要に応じてJVMを含まないバージョン もダウンロード可 36

Slide 37

Slide 37

7.0の大きな変更点 • number_of_indices=1がデフォルト(これまでは5) ‒ _splitでもちろんこれまで通り分割も可能 • Hitsの形式の変更(後述) • Aggregationの最大bucketsの制御が可能 (ユーザーによる巨大なBucketsの指定) ‒ もし、ユーザーが巨大な値を設定しても、real memory circuit-breakerが保護 37

Slide 38

Slide 38

7.0の大きな変更点 • number_of_indices=1がデフォルト(これまでは5) • _splitでもちろんこれまで通り分割も可能 • Hitsの形式の変更 • Aggregationの最大bucketsの制御が可能 (ユーザーによる巨大なBucketsの指定) • もし、ユーザーが巨大な値を設定しても、real memory circuit-breakerが保護 38

Slide 39

Slide 39

そのほかの改善 • Adaptive replica selectionがデフォルトに • 検索されないシャードのバックグラウンドRefreshをスキップ 多くのユーザーのインデックススループットが向上 • High level Java REST clientが全機能に対応 Transport clientが7.0で非推奨、8.0で廃止予定 • Nano-secondsのデータに対応 date_nanos データタイプの登場 39

Slide 40

Slide 40

Kibana

Slide 41

Slide 41

新しい ルック•アンド•フィール 新しいグローバル・ナビゲーション どこでもダークモード レスポンシブなダッシュボード タイムピッカーの改善 Kibanaクエリー言語がデフォルトに 41

Slide 42

Slide 42

新しい ルック•アンド•フィール 新しいグローバル・ナビゲーション どこでもダークモード レスポンシブなダッシュボード タイムピッカーの改善 Kibanaクエリー言語がデフォルトに 42

Slide 43

Slide 43

新しい ルック•アンド•フィール 新しいグローバル・ナビゲーション どこでもダークモード レスポンシブなダッシュボード タイムピッカーの改善 Kibanaクエリー言語がデフォルトに 43

Slide 44

Slide 44

新しい ルック•アンド•フィール 新しいグローバル・ナビゲーション どこでもダークモード レスポンシブなダッシュボード タイムピッカーの改善 Kibanaクエリー言語がデフォルトに 44

Slide 45

Slide 45

新しい ルック•アンド•フィール 新しいグローバル・ナビゲーション どこでもダークモード レスポンシブなダッシュボード タイムピッカーの改善 Kibanaクエリー言語がデフォルトに 45

Slide 46

Slide 46

Beats

Slide 47

Slide 47

新しいBeatsモジュール 新しいFilebeatモジュール ” ” ” Zeek (fka Bro) (Basic) IPtables (Basic) Santa (OSS) 新しいMetricbeatモジュール ” ” ” ” 47 AWS EC2 (Basic) Microsoft SQL (Basic) NATS (OSS) CouchDB (OSS)

Slide 48

Slide 48

モジュールの成熟 GAになったモジュール - Golang Graphite Munin Prometheus Betaになったモジュール - 48 System module (Auditbeat)

Slide 49

Slide 49

ECSのサポート ほとんどのBeatsとモジュールはECS フォーマットでデータを生成 Beatsのadd_*プロセッサがECSをサ ポート **WinlogbeatとFunctionbeat、 JournalbeatはECSを限定的にサポー ト 49

Slide 50

Slide 50

Elastic Common Schema (ECS) 合理的な分析のための正規化 Elastic Common Schema (ECS)を、2019 年3月に公開 Elasticsearchへのデータ投入に際して、 フィールドとオブジェクトの共通セット を定義 多様なデータの横断分析を可能にする 拡張可能な設計 https://github.com/elastic/ecs 貢献とフィードバックを歓迎します 50

Slide 51

Slide 51

Beatsコア機能 Add_* プロセッサがECSフィールドを含め る - Geo info OS name 新しいBeatsプロセッサが利用可能 - Add_fields Add_labels Add_tags 新しいFilebeatエンコーディング 51

Latin IBM codepages Cyrillic Macintosh Windows

Slide 52

Slide 52

Logstash

Slide 53

Slide 53

Logstashのエンハンス 初期値でJava Execution Engineを使用 高パフォーマンス、短い起動時間、 メモリ使用量の削減 新しいプラグインのサポート - 53 CIDR filter Clone filter Prune filter

Slide 54

Slide 54

Thank You

Slide 55

Slide 55

Elastic{ON} Tour Tokyo • Elasticsearch、Kibana、 Beats、そしてLogstashの最 新ロードマップが公開されま す。Elasticのエキスパートや Elastic Stackユーザーから活 用のヒントを得る機会にもな ります。 55