Post on 21-Mar-2017
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .
2017年3月8日
ヤフー株式会社 小野和輝
Storm の新機能について
@ HSCR
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .
自己紹介
2
小野 和輝 (おのかずき)
- 入社1年目
- リアルタイム分散処理基盤の運用 / 保守
- 安定したリアルタイム分散処理基盤の提供
- カッパとアザラシ推しの街に住んでいます
写真:アフロ
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .3
今日お話する内容
Apache Storm 1.x 系の新機能
2017/2/14 storm 1.0.3 release … 特に大きな変化は無いはず…
- 処理性能の向上 (レイテンシ60%軽減 / スループット 16倍) !
- ファイルをトポロジーと一緒にデプロイしなくても ok !
- デフォルトで HA に対応したよ !
- ログの操作が簡単になったよ !
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .
Agenda
4
Distributed Cache API
Highly Available Nimbus
Distributed Log Search
Dynamic Log Level Settings
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .
Agenda
5
Distributed Cache API
Highly Available Nimbus
Distributed Log Search
Dynamic Log Level Settings
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .6
Storm 0.9 系…
トポロジーで読み込むデータの
サイズが大きすぎる… (´・ω・`)
トポロジーをクラスタに投入するまでに
めっちゃ時間かかる… (´・ω・`)
\(^o^)/
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .
Distributed Cache API | 概要
7
概要
ファイルを HDFS などに登録して外から呼び出す機能
- BlobStore と呼ばれるインタフェースを使用
- Supervisor 起動時に BlobStore の Map を取得
$ storm blobstore create --file <登録するファイル> --acl o::rwa --replication-factor 4 key1
BlobStore へ登録するファイル レプリケーション数の設定
ACL の設定
- Secure な Storm クラスタでのみ有効
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .8
$ storm blobstore create --file README.markdown --acl o::rwa --replication-factor 4 key1
…
3283 [main] INFO o.a.s.c.blobstore - Creating key1 with ACL ("o::rwa")
3912 [main] INFO o.a.s.c.blobstore - Successfully created key1
key1 で README.markdown を BlobStore へ登録
$ less ${storm.local.dir}/blobs/729/data_key1/data
Master Branch: [![Travis CI](https://travis-ci.org/apache/storm.svg?branch=master)] …
Storm is a distributed realtime computation system…
BlobStore へ登録したファイルの確認
Distributed Cache API | 使ってみる
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .9
実装内容
WordCountTopology へ単語のフィルタリング機能を実装
- BlobStore へ 単語のブラックリストを登録
- じゃぱりぱーく Java でつくりました
RandomSentenceSpout WordCount
SplitSentence
- BlobStore からブラックリストを取得してフィルタリング
- The / cow / jumped / over / moon をブラックリストへ登録
Distributed Cache API | 実装してみる
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .
単語 出現数 単語 出現数
snow
four
ago
white
dwarfs
an
apple
50
51
52
54
52
57
57
単語 出現数
the
cow
jumped
over
moon
0
0
0
0
0
score 50
year 50
keeps
day
a
doctor
away
57
57
57
57
57
and
seven
101
101
blacklist に登録した単語はカウントしていない
送信する文章the cow jumped over the moon / an apple a day keeps the doctor away
four score and seven years ago / snow white and seven dwarfs
Distributed Cache API | 実装してみる
6
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .
Agenda
11
Distributed Cache API
Highly Available Nimbus
Distributed Log Search
Dynamic Log Level Settings
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .12
Storm 0.9 系…
Nimbus が SPOF \(^o^)/
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .13
Highly Available Nimbus | 概要
概要 Nimbus での障害発生時にシステムの可用性が低下することを抑制
リーダー Nimbus
- 投入されたトポロジーに関するメタファイルを生成
- 他 Nimbus へメタファイルを生成したことを通知
他 Nimbus
- メタファイルをダウンロードトポロジーの投入
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .14
検証項目
リーダーを再起動
リーダーを停止
リーダー停止 → トポロジーを操作
リーダー停止 → トポロジー操作 → リーダー再起動
新しいリーダーからトポロジーを投入
全ての Nimbus を停止してリーダ以外の Nimbus を起動
リーダーが切り替わる
リーダーが切り替わる
操作可能
トポロジー操作後の状態を維持
Storm UI で Internal Server Error!!!
投入可能
検証結果
最後にリーダーだった Nimbus を起動する必要がある
Highly Available Nimbus | 検証
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .
Agenda
15
Distributed Cache API
Highly Available Nimbus
Distributed Log Search
Dynamic Log Level Settings
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .16
Storm 0.9 系…
トポロジーのログが探しづらい
\(^o^)/
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .17
概要 Storm UI 上で特定のトポロジーのログを全 Worker から検索する機能
Distributed Log Search | 概要
Worker B 上に存在する検索対象のログ
Worker A 上に存在する検索対象のログ
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .18
Distributed Log Search | 使い方 (1/2)
虫眼鏡アイコンを選択
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .19
Distributed Log Search | 使い方 (2/2)
虫眼鏡アイコンを選択
- Topology Id : 検索したいトポロジーの ID
- Search : 検索対象の文字列
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .20
Worker A 上で動作するwordcount に関するログ一覧
おまけ | Worker ごとのログ検索
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .
Agenda
21
Distributed Cache API
Highly Available Nimbus
Distributed Log Search
Dynamic Log Level Settings (おまけ)
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .22
Dynamic Log Level Setting | 概要
概要トポロジーを起動したままログレベルを変更できる機能
- Storm UI / Storm CLI から変更可能
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .23
Dynamic Log Level Setting | UI から変更
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .24
Dynamic Log Level Setting | CLI で変更
$ storm set_log_level <topology> -l <logger>=<Level>:<Timeout>
$ storm set_log_level <topology> -r <logger>
$ storm set_log_level kazono-wordcount -l ROOT=ERROR:30
$ storm set_log_level kazono-wordcount -r ROOT
ログレベルの設定を行う Storm CLI
設定したログレベルの削除を行う Storm CLI
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .25
まとめ
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .26
まとめ
Storm の新機能をしってるフレンズなんだね!
写真:アフロ
Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .Copyrig ht © 2017 Yahoo Japan Corporation. All Rig hts Reserved .27
EOP