SlideShare a Scribd company logo
1 of 35
Download to read offline
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Amazon Web Services Japan, K. K.
Analytics Solutions Architect, Makoto Shimura
[これから始める Amazon Elastic Search Service セミナー]
Introduction to
Amazon Elasticsearch Service
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
⾃⼰紹介
志村 誠
ソリューションアーキテクト
• データ分析・機械学習系サービスを担当
• 好きなサービス
• Amazon Athena
• AWS Glue
• Amazon SageMaker
• and Amazon Elasticsearch Service!!
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Agenda
• Elasticsearch とは
• Amazon Elasticsearch Service の概要
• 検索
• ログ分析
• まとめ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Elasticsearch とは
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Elasticsearch
• 様々なユースケースを解決する分散型
RESTful 検索/分析エンジン
• コアエンジン部はオープンソースソフ
トウェアとして提供され,主に Elastic
社によって開発が⾏われている
• Elasticsearch に付随するソフトウェア
として,データ取り込みの Logstash
や Beats,可視化⽤の Kibana などが
ある
可視化
検索・分析
収集
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
データ挿⼊から活⽤までの流れ
アプリケーション
データ
サーバ,アプリ,
ネットワーク,
AWS 等のログ
1
Elasticsearch クラスター
2
アプリユーザ,アナリスト,
DevOps 担当,セキュリティ担当
3
1
JSON 形式のデータを
REST API 経由で送信
2
インデックスに格納された
全てのデータが検索可能
3
REST API 経由でクエリ
複雑な検索・分析条件に対応
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Elasticsearch における論理的なデータの持ち⽅
=
index document
field
インデックス / ドキュメント / フィールドは,⾮常に荒い例えをするなら,
データベースにおける Table/Record/Column に近い概念 *
* バージョン 6.x までの Elasticsearch には type という概念があったが,7.0 以降では廃止されている
ID ID ID ID ID
ID ID ID ID ID
ID: 34171
{
“first_name”: “Jane”,
“last_name”: “Smith”,
“age”: 28,
“about”: ”I love AWS”,
“interests”: [“music”],
“role”: {
“level”: 7,
“role”: “Architect”
}
}
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Elasticsearch における物理的なデータの持ち⽅
マスター
マスター
候補
マスター
候補
データノード
マスター (候補) ノード
Elasticsearch クラスター
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
論理的な index の物理的な配置
• インデックスは内部的に,シャードというデータブロックに分割される
1 2
4 3
シャード数 4 のインデックス
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
論理的な index の物理的な配置
• インデックスは内部的に,シャードというデータブロックに分割される
• インデックス作成時に,シャード数と,シャードのレプリカ数を指定
1 2
4 3
シャード数 4,レプリカ数 2 のインデックス
プライマリ
シャード
1 1
レプリカ
シャード
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
論理的な index の物理的な配置
• インデックスは内部的に,シャードというデータブロックに分割される
• インデックス作成時に,シャード数と,シャードのレプリカ数を指定
• レプリカが複数のノードに渡って保存されることで,データの可⽤性や耐久
性を⾼く保つことが可能
シャード数 4,レプリカ数 2 のインデックス
1
32
2
43
1
42
1
43
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
全⽂検索から分析エンジンへと進化
⾃然⾔語
フィルタリング
スコアリング
全⽂検索
⼤量のデータ挿⼊
ニアリアルタイム
分散ストレージ
ストリームデータ
時系列データの可視化
複雑な条件による集計
応⽤的な分析
分析
00101101001011100010
11110011000000110001
00110010001100110011
0100001101010011
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
IT 運⽤監視 セキュリティ情報や
イベントの管理
アプリケーションの
監視や分析
IoT 機器の
監視やデータ分析
アプリケーションの
検索機能
ターゲテイング
広告
さまざまなユースケース
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Amazon Elasticsearch Service の概要
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Amazon Elasticsearch Service とは
Amazon Elasticsearch Service
(Amazon ES) は,Elasticsearch
と Kibana を簡単にデプロイ・管
理し,スケールさせることが可能
なフルマネージドサービス
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
フルマネージド
API とコンソール経由で,
数分でクラスターを
デプロイして利⽤可能
柔軟性
データの検索や
ログの分析を実⾏可能
AWS およびオープンソースの
データ収集ツールに対応
コスト効率
使った分だけの従量課⾦
運⽤コストを削減可能
適切なイスンタンスタイプを選択
RI を活⽤
⾼い可⽤性
24x7 のモニタリング
数クリックでマルチ AZ に対応
⾃動でスナップショットを取得
Amazon CloudWatch でメトリクス収集
スケーラブルで
⾼いパフォーマンス
1 クリックで
クラスタサイズの変更,
バージョンアップグレード,
パッチ適⽤が可能
セキュリティと認証
Amazon VPC へのデプロイ
Amazon Cognito で認証認可
FISMA, SOC, PCI, FedRamp 取得
Amazon Elasticsearch Service の利点
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
典型的なアーキテクチャ
AWS Cloud
VPC
Data Nodes Master Nodes
AWS Management
Console
AWS Command Line Interface
AWS Tools and SDKs
AWS CloudFormation
AWS Identity and
Access
Management
(IAM)
Elastic Load Balancing
(ELB)
AWS
CloudTrail
Amazon
CloudWatch
AWS Database
Migration
Service
Amazon Kinesis
Data Firehose
Amazon
CloudWatch
Logs
Amazon ES Domain
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Amazon ES を活⽤している多くのお客さま
改善につながるインサイト
アプリ API の利⽤状況,インフ
ラの起動時間,セキュリティ等の
ログで取得して,改善につなげる
ルートコーズの発⾒
ログからエラーメッセージや
サーバ ID を検索して,起
こっている問題の原因を把握
リアルタイムに対応
データをリアルタイムで取得,
可視化,そしてダッシュボー
ドにまとめることで,問題に
素早く対処できるように
データの検索
アプリケーションデータに
関連する検索結果を返す
ログの集約
インフラやアプリケーション
の情報を集約する
単⼀ダッシュボードの作成
セキュリティ監視
不正利⽤,DDoS,その他の
サイバー攻撃に対して
適切なアクションを取る
Nike
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
検索
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
典型的なユースケース
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
典型的なユースケース
映画に関する以下のような情報
を,構造化された形で保持し,
検索できる必要がある
• タイトル
• 概要
• レーティング
• 監督
• 脚本家
• 俳優 etc...
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
データフロー
表⽰ アプリ データベース
配信 ページ
レンダリング
Business
logic
メインのカタログ
Source of Truth
⼤量のイベントデー
タ(クリック,レー
ティング,位置情報
等)
クエリに基づく動画
の検索を可能に
Amazon CloudFront Amazon EC2 Amazon EC2
Amazon RDS
Amazon DynamoDB
Amazon Elasticsearch
Service
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
{
"id" : "tt0371746",
"title" : "Iron Man",
"release_date" : "2008-04-14T00:00:00Z",
"actors" : [
"Robert Downey Jr.",
"Gwyneth Paltrow",
"Terrence Howard"
],
"directors" : [
"Jon Favreau"
],
"rating" : 7.9,
"rank" : 171,
"running_time_secs" : 7560,
"genres" : [
"Action",
"Adventure",
"Sci-Fi"
],
"plot" : "When wealthy industrialist Tony Stark
is forced to build an armored suit after a life-
threatening incident, he ultimately decides to use
its technology to fight against evil.",
}
RDS / DynamoDB から
取得した情報を,
構造化された JSON 形式で
Elasticsearch に格納
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
_search API を通じて Elasticsearch のデータを検索
Amazon ES
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Compass さま: 不動産プラットフォームの物件検索
データサイズ: 1.2 億件の物件リスト, 1.4 億の売買履歴,1500 の属性情報
利⽤頻度: 1 ⽇に 1 億件の検索
https://www.youtube.com/watch?v=V8yaocQZpr0
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
ログ分析
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
ストリームでのログ追加のフロー
VPC
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
ファイル単位でのログ追加のフロー
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Kibana による可視化
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Kibana の裏側
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
_search API を通じて Elasticsearch のデータを分析
Amazon ES
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Expedia さま: ログを集約して開発プロセスの改善
• 150 以上の Amazon ES クラスター
• 450 台以上の EC2 インスタンス
• 30 TB 以上のデータと,300 億ものドキュメント
https://www.slideshare.net/AmazonWebServices/abd331log-analytics-at-expedia-using-amazon-elasticsearch-service
AWS
CloudTrail
Amazon S3 Amazon
SNS
log delivery
CloudTrail
message to SNS
objectCreate (all)
Triggers
Lambda
Kibana Amazon ES
Visualize logs
Create
dashboards
AWS
Lambda
Read log from S3
Store in
Elasticsearch
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
まとめ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
まとめ
• Elasticsearch は,オープンソースの検索/分析エンジンで,全⽂検索⽤途だけ
でなく,ストリームデータの可視化や分析などさまざまな⽤途で使われる
• Amazon ES は,Elasticsearch と可視化ソフトウェア Kibana を簡単に構築,
運⽤,スケールさせることができるマネージドサービス
• AWS サービスと連携して,検索やログ分析の仕組みを簡単に構築し,ウェブ
サイトの検索基盤や,ログデータのリアルタイムダッシュボードとして利⽤
可能
20200414 Introduction to Amazon Elasticsearch Service

More Related Content

More from Amazon Web Services Japan

More from Amazon Web Services Japan (20)

202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
 
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
 
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
 
Amazon QuickSight の組み込み方法をちょっぴりDD
Amazon QuickSight の組み込み方法をちょっぴりDDAmazon QuickSight の組み込み方法をちょっぴりDD
Amazon QuickSight の組み込み方法をちょっぴりDD
 
マルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのことマルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのこと
 
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
 
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
 
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
 
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するためにAmazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
 
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
 
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
 
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
 
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
 
202112 AWS Black Belt Online Seminar 店内の「今」をお届けする小売業向けリアルタイム配信基盤のレシピ
202112 AWS Black Belt Online Seminar 店内の「今」をお届けする小売業向けリアルタイム配信基盤のレシピ202112 AWS Black Belt Online Seminar 店内の「今」をお届けする小売業向けリアルタイム配信基盤のレシピ
202112 AWS Black Belt Online Seminar 店内の「今」をお届けする小売業向けリアルタイム配信基盤のレシピ
 
20211209 Ops-JAWS Re invent2021re-cap-cloud operations
20211209 Ops-JAWS Re invent2021re-cap-cloud operations20211209 Ops-JAWS Re invent2021re-cap-cloud operations
20211209 Ops-JAWS Re invent2021re-cap-cloud operations
 
20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報
20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報
20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報
 
[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな
[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな
[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな
 
20211109 JAWS-UG SRE keynotes
20211109 JAWS-UG SRE keynotes20211109 JAWS-UG SRE keynotes
20211109 JAWS-UG SRE keynotes
 
20211109 bleaの使い方(基本編)
20211109 bleaの使い方(基本編)20211109 bleaの使い方(基本編)
20211109 bleaの使い方(基本編)
 
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

20200414 Introduction to Amazon Elasticsearch Service

  • 1. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon Web Services Japan, K. K. Analytics Solutions Architect, Makoto Shimura [これから始める Amazon Elastic Search Service セミナー] Introduction to Amazon Elasticsearch Service
  • 2. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ⾃⼰紹介 志村 誠 ソリューションアーキテクト • データ分析・機械学習系サービスを担当 • 好きなサービス • Amazon Athena • AWS Glue • Amazon SageMaker • and Amazon Elasticsearch Service!!
  • 3. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Agenda • Elasticsearch とは • Amazon Elasticsearch Service の概要 • 検索 • ログ分析 • まとめ
  • 4. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Elasticsearch とは
  • 5. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Elasticsearch • 様々なユースケースを解決する分散型 RESTful 検索/分析エンジン • コアエンジン部はオープンソースソフ トウェアとして提供され,主に Elastic 社によって開発が⾏われている • Elasticsearch に付随するソフトウェア として,データ取り込みの Logstash や Beats,可視化⽤の Kibana などが ある 可視化 検索・分析 収集
  • 6. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark データ挿⼊から活⽤までの流れ アプリケーション データ サーバ,アプリ, ネットワーク, AWS 等のログ 1 Elasticsearch クラスター 2 アプリユーザ,アナリスト, DevOps 担当,セキュリティ担当 3 1 JSON 形式のデータを REST API 経由で送信 2 インデックスに格納された 全てのデータが検索可能 3 REST API 経由でクエリ 複雑な検索・分析条件に対応
  • 7. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Elasticsearch における論理的なデータの持ち⽅ = index document field インデックス / ドキュメント / フィールドは,⾮常に荒い例えをするなら, データベースにおける Table/Record/Column に近い概念 * * バージョン 6.x までの Elasticsearch には type という概念があったが,7.0 以降では廃止されている ID ID ID ID ID ID ID ID ID ID ID: 34171 { “first_name”: “Jane”, “last_name”: “Smith”, “age”: 28, “about”: ”I love AWS”, “interests”: [“music”], “role”: { “level”: 7, “role”: “Architect” } }
  • 8. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Elasticsearch における物理的なデータの持ち⽅ マスター マスター 候補 マスター 候補 データノード マスター (候補) ノード Elasticsearch クラスター
  • 9. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark 論理的な index の物理的な配置 • インデックスは内部的に,シャードというデータブロックに分割される 1 2 4 3 シャード数 4 のインデックス
  • 10. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark 論理的な index の物理的な配置 • インデックスは内部的に,シャードというデータブロックに分割される • インデックス作成時に,シャード数と,シャードのレプリカ数を指定 1 2 4 3 シャード数 4,レプリカ数 2 のインデックス プライマリ シャード 1 1 レプリカ シャード
  • 11. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark 論理的な index の物理的な配置 • インデックスは内部的に,シャードというデータブロックに分割される • インデックス作成時に,シャード数と,シャードのレプリカ数を指定 • レプリカが複数のノードに渡って保存されることで,データの可⽤性や耐久 性を⾼く保つことが可能 シャード数 4,レプリカ数 2 のインデックス 1 32 2 43 1 42 1 43
  • 12. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark 全⽂検索から分析エンジンへと進化 ⾃然⾔語 フィルタリング スコアリング 全⽂検索 ⼤量のデータ挿⼊ ニアリアルタイム 分散ストレージ ストリームデータ 時系列データの可視化 複雑な条件による集計 応⽤的な分析 分析 00101101001011100010 11110011000000110001 00110010001100110011 0100001101010011
  • 13. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark IT 運⽤監視 セキュリティ情報や イベントの管理 アプリケーションの 監視や分析 IoT 機器の 監視やデータ分析 アプリケーションの 検索機能 ターゲテイング 広告 さまざまなユースケース
  • 14. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon Elasticsearch Service の概要
  • 15. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon Elasticsearch Service とは Amazon Elasticsearch Service (Amazon ES) は,Elasticsearch と Kibana を簡単にデプロイ・管 理し,スケールさせることが可能 なフルマネージドサービス
  • 16. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark フルマネージド API とコンソール経由で, 数分でクラスターを デプロイして利⽤可能 柔軟性 データの検索や ログの分析を実⾏可能 AWS およびオープンソースの データ収集ツールに対応 コスト効率 使った分だけの従量課⾦ 運⽤コストを削減可能 適切なイスンタンスタイプを選択 RI を活⽤ ⾼い可⽤性 24x7 のモニタリング 数クリックでマルチ AZ に対応 ⾃動でスナップショットを取得 Amazon CloudWatch でメトリクス収集 スケーラブルで ⾼いパフォーマンス 1 クリックで クラスタサイズの変更, バージョンアップグレード, パッチ適⽤が可能 セキュリティと認証 Amazon VPC へのデプロイ Amazon Cognito で認証認可 FISMA, SOC, PCI, FedRamp 取得 Amazon Elasticsearch Service の利点
  • 17. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark 典型的なアーキテクチャ AWS Cloud VPC Data Nodes Master Nodes AWS Management Console AWS Command Line Interface AWS Tools and SDKs AWS CloudFormation AWS Identity and Access Management (IAM) Elastic Load Balancing (ELB) AWS CloudTrail Amazon CloudWatch AWS Database Migration Service Amazon Kinesis Data Firehose Amazon CloudWatch Logs Amazon ES Domain
  • 18. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon ES を活⽤している多くのお客さま 改善につながるインサイト アプリ API の利⽤状況,インフ ラの起動時間,セキュリティ等の ログで取得して,改善につなげる ルートコーズの発⾒ ログからエラーメッセージや サーバ ID を検索して,起 こっている問題の原因を把握 リアルタイムに対応 データをリアルタイムで取得, 可視化,そしてダッシュボー ドにまとめることで,問題に 素早く対処できるように データの検索 アプリケーションデータに 関連する検索結果を返す ログの集約 インフラやアプリケーション の情報を集約する 単⼀ダッシュボードの作成 セキュリティ監視 不正利⽤,DDoS,その他の サイバー攻撃に対して 適切なアクションを取る Nike
  • 19. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark 検索
  • 20. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark 典型的なユースケース
  • 21. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark 典型的なユースケース 映画に関する以下のような情報 を,構造化された形で保持し, 検索できる必要がある • タイトル • 概要 • レーティング • 監督 • 脚本家 • 俳優 etc...
  • 22. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark データフロー 表⽰ アプリ データベース 配信 ページ レンダリング Business logic メインのカタログ Source of Truth ⼤量のイベントデー タ(クリック,レー ティング,位置情報 等) クエリに基づく動画 の検索を可能に Amazon CloudFront Amazon EC2 Amazon EC2 Amazon RDS Amazon DynamoDB Amazon Elasticsearch Service
  • 23. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark { "id" : "tt0371746", "title" : "Iron Man", "release_date" : "2008-04-14T00:00:00Z", "actors" : [ "Robert Downey Jr.", "Gwyneth Paltrow", "Terrence Howard" ], "directors" : [ "Jon Favreau" ], "rating" : 7.9, "rank" : 171, "running_time_secs" : 7560, "genres" : [ "Action", "Adventure", "Sci-Fi" ], "plot" : "When wealthy industrialist Tony Stark is forced to build an armored suit after a life- threatening incident, he ultimately decides to use its technology to fight against evil.", } RDS / DynamoDB から 取得した情報を, 構造化された JSON 形式で Elasticsearch に格納
  • 24. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark _search API を通じて Elasticsearch のデータを検索 Amazon ES
  • 25. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Compass さま: 不動産プラットフォームの物件検索 データサイズ: 1.2 億件の物件リスト, 1.4 億の売買履歴,1500 の属性情報 利⽤頻度: 1 ⽇に 1 億件の検索 https://www.youtube.com/watch?v=V8yaocQZpr0
  • 26. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ログ分析
  • 27. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ストリームでのログ追加のフロー VPC
  • 28. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ファイル単位でのログ追加のフロー
  • 29. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Kibana による可視化
  • 30. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Kibana の裏側
  • 31. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark _search API を通じて Elasticsearch のデータを分析 Amazon ES
  • 32. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Expedia さま: ログを集約して開発プロセスの改善 • 150 以上の Amazon ES クラスター • 450 台以上の EC2 インスタンス • 30 TB 以上のデータと,300 億ものドキュメント https://www.slideshare.net/AmazonWebServices/abd331log-analytics-at-expedia-using-amazon-elasticsearch-service AWS CloudTrail Amazon S3 Amazon SNS log delivery CloudTrail message to SNS objectCreate (all) Triggers Lambda Kibana Amazon ES Visualize logs Create dashboards AWS Lambda Read log from S3 Store in Elasticsearch
  • 33. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark まとめ
  • 34. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark まとめ • Elasticsearch は,オープンソースの検索/分析エンジンで,全⽂検索⽤途だけ でなく,ストリームデータの可視化や分析などさまざまな⽤途で使われる • Amazon ES は,Elasticsearch と可視化ソフトウェア Kibana を簡単に構築, 運⽤,スケールさせることができるマネージドサービス • AWS サービスと連携して,検索やログ分析の仕組みを簡単に構築し,ウェブ サイトの検索基盤や,ログデータのリアルタイムダッシュボードとして利⽤ 可能