SlideShare a Scribd company logo
Been Stuck In Elastic Stack
Kazuhiro Kosaka
Engineer, MDH, CyberAgent, Inc.
Feb 10, 2017
About Me
• 小坂和弘 - Kazuhiro Kosaka @hyperdash
• 2009- CyberAgent, Inc.
• Designer/Front-end Engineer/Back-end Engineer
• Motion Graphics, VJ
About Me
• I love hiking
Summary
What To Talk?
• Amazon Elasticsearch Service
• v1.x v2.x
Summary
What NOT To Talk?
• Private Elasticsearch Cluster / Elastic Cloud
• v5.x
Summary
Elastic Stack?
• Had been called ELK Stack
• Elasticsearch - Distributed Search/Analytics Engine
• Logstash - Data Processing Pipeline
• Kibana - Data Visualizer
• Beats - Data Shipping Agents
Our Case
広告運用・配信設定管理画面 ユーザ操作ログ
Our Case
• Elasticsearch v1.5 on Amazon Elasticsearch Service
• Logstash v2.3.1
• Filebeat v1.2.1
• m3.large / 3 instances
• 400,000 docs / day
• 95% of logs are by 日予算自動アロケーション Batch
• Will be separated into another index
• 主にユーザの操作履歴調査
Our Case
Stuck #1 / Settings
DataLossを防ぐには?
• Filebeat uses a back-pressure sensitive protocol
• Logstash < v5.1 has NO Persistent Queue
Stuck #1 / Settings
DataLossを防ぐには?
Source: https://www.elastic.co/guide/en/logstash/5.0/deploying-and-scaling.html
Stuck #1 / Settings
DataLossを防ぐには?
• Use Message Queue e.g. Kafka
• Delete Filebeat registrar file and Re-ship data
• >= v5.1 Persistent Queue (beta) is enabled
Stuck #2 / JVMMemoryPressure
ESにWriteできなくなったんですけど…
• m3.medium / 1 instance
• JVMMemoryPressure ≒ 92-94 %
• FreeStorageSpace looks okay
Stuck #2 / JVMMemoryPressure
ESにWriteできなくなったんですけど…
Source: http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/aes-handling-errors.html
• NOT a t2 instance
• ???
Stuck #2 / JVMMemoryPressure
ESにWriteできなくなったんですけど…
m3.medium / 1 instance
m3.large / 3 instances
Worked!
Stuck #2 / JVMMemoryPressure
ESにWriteできなくなったんですけど…
• indices.fielddata.cache.size: unbounded (default)
This allows ES to allocate unlimited memory for fielddata
• indices.fielddata.cache.size: 50 (%)
Stuck #2 / JVMMemoryPressure
ESにWriteできなくなったんですけど…
Source: https://www.elastic.co/guide/en/elasticsearch/guide/current/_limiting_memory_usage.html
Stuck #2 / JVMMemoryPressure
ESにWriteできなくなったんですけど…
• ES v1.x
• Doc Values: Default OFF
• Set “doc_values”: true in index template - mappings
Stuck #2 / JVMMemoryPressure
ESにWriteできなくなったんですけど…
• ES >= v2.x
• Doc Values: Default ON
Stuck #3 / Restrictions
Amazon Elasticsearch Serviceの制限
• Dynamic Scripting is not supported
• Custom Plugins are not supported
• Access Control
• Amazon ES is out of VPC
• IP-Based, IAM-Based Access Control
• logstash-output-amazon_es plugin is not stable??
Next Step
• Migrate to Elastic Stack v5.x
• Elastic Cloud or Private Cluster?
• 管理画面上での操作ログ閲覧
Conclusion
• Amazon Elasticsearch Service
• Elastic Cloud
• Easy & Handy (Fully-Managed)
• The latest version is available anytime
• Less Restrictions, or Elastic Cloud Enterprise (alpha)
• Supported by Elastic
• Easy & Handy (Fully-Managed)
• Restrictions
• Supported by AWS
END
THANK YOU

More Related Content

What's hot

Introducing Apache Stratos, your choice for an open PaaS Solution
Introducing Apache Stratos, your choice for an open PaaS SolutionIntroducing Apache Stratos, your choice for an open PaaS Solution
Introducing Apache Stratos, your choice for an open PaaS Solution
WSO2
 
Real World Fun with ActiveResource
Real World Fun with ActiveResourceReal World Fun with ActiveResource
Real World Fun with ActiveResource
Rob C
 
Azure Web PubSub Serviceを触ってみた
Azure Web PubSub Serviceを触ってみたAzure Web PubSub Serviceを触ってみた
Azure Web PubSub Serviceを触ってみた
DevTakas
 
Spring Boot. Boot up your development
Spring Boot. Boot up your developmentSpring Boot. Boot up your development
Spring Boot. Boot up your development
Strannik_2013
 
Spring.new hope.1.3
Spring.new hope.1.3Spring.new hope.1.3
Spring.new hope.1.3
Alex Tumanoff
 
Javascript Frameworks Comparison
Javascript Frameworks ComparisonJavascript Frameworks Comparison
Javascript Frameworks Comparison
Deepu S Nath
 
WordPress Bootcamp Quiz
WordPress Bootcamp QuizWordPress Bootcamp Quiz
WordPress Bootcamp Quiz
Metronet
 
Intro to the Express Web Framework
Intro to the Express Web FrameworkIntro to the Express Web Framework
Intro to the Express Web Framework
jasonsich
 
Sails Framework Instroduction
Sails Framework InstroductionSails Framework Instroduction
Sails Framework Instroduction
Leo Berdu
 
Search and analyze your data with elasticsearch
Search and analyze your data with elasticsearchSearch and analyze your data with elasticsearch
Search and analyze your data with elasticsearch
Anton Udovychenko
 
Understand & develop ember addons
Understand & develop ember addonsUnderstand & develop ember addons
Understand & develop ember addons
Dilip Kushwaha
 
Consuming REST services with ActiveResource
Consuming REST services with ActiveResourceConsuming REST services with ActiveResource
Consuming REST services with ActiveResource
Wolfram Arnold
 
EmberJS
EmberJSEmberJS
EmberJS
ryanstout
 
WordPress hooks - WPLDN July 2013 Meetup
WordPress hooks - WPLDN July 2013 MeetupWordPress hooks - WPLDN July 2013 Meetup
WordPress hooks - WPLDN July 2013 Meetup
l3rady
 
(WEB203) Building a Website That Costs Pennies to Operate | AWS re:Invent 2014
(WEB203) Building a Website That Costs Pennies to Operate | AWS re:Invent 2014(WEB203) Building a Website That Costs Pennies to Operate | AWS re:Invent 2014
(WEB203) Building a Website That Costs Pennies to Operate | AWS re:Invent 2014
Amazon Web Services
 
Developing Rest services with SailsJs by Andrey Kolodnitskiy
Developing Rest services with SailsJs by Andrey KolodnitskiyDeveloping Rest services with SailsJs by Andrey Kolodnitskiy
Developing Rest services with SailsJs by Andrey Kolodnitskiy
Lohika_Odessa_TechTalks
 
Scalr - Open Source Cloud Management
Scalr - Open Source Cloud Management Scalr - Open Source Cloud Management
Scalr - Open Source Cloud Management
Arvind Palanisamy
 
AWS: Introduction
AWS: IntroductionAWS: Introduction
AWS: Introduction
Sachin Dole
 
전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020
전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020 전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020
전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020
AWSKRUG - AWS한국사용자모임
 
jQuery 3.0 Alpha Versions
jQuery 3.0 Alpha Versions jQuery 3.0 Alpha Versions
jQuery 3.0 Alpha Versions
Osama Quboh
 

What's hot (20)

Introducing Apache Stratos, your choice for an open PaaS Solution
Introducing Apache Stratos, your choice for an open PaaS SolutionIntroducing Apache Stratos, your choice for an open PaaS Solution
Introducing Apache Stratos, your choice for an open PaaS Solution
 
Real World Fun with ActiveResource
Real World Fun with ActiveResourceReal World Fun with ActiveResource
Real World Fun with ActiveResource
 
Azure Web PubSub Serviceを触ってみた
Azure Web PubSub Serviceを触ってみたAzure Web PubSub Serviceを触ってみた
Azure Web PubSub Serviceを触ってみた
 
Spring Boot. Boot up your development
Spring Boot. Boot up your developmentSpring Boot. Boot up your development
Spring Boot. Boot up your development
 
Spring.new hope.1.3
Spring.new hope.1.3Spring.new hope.1.3
Spring.new hope.1.3
 
Javascript Frameworks Comparison
Javascript Frameworks ComparisonJavascript Frameworks Comparison
Javascript Frameworks Comparison
 
WordPress Bootcamp Quiz
WordPress Bootcamp QuizWordPress Bootcamp Quiz
WordPress Bootcamp Quiz
 
Intro to the Express Web Framework
Intro to the Express Web FrameworkIntro to the Express Web Framework
Intro to the Express Web Framework
 
Sails Framework Instroduction
Sails Framework InstroductionSails Framework Instroduction
Sails Framework Instroduction
 
Search and analyze your data with elasticsearch
Search and analyze your data with elasticsearchSearch and analyze your data with elasticsearch
Search and analyze your data with elasticsearch
 
Understand & develop ember addons
Understand & develop ember addonsUnderstand & develop ember addons
Understand & develop ember addons
 
Consuming REST services with ActiveResource
Consuming REST services with ActiveResourceConsuming REST services with ActiveResource
Consuming REST services with ActiveResource
 
EmberJS
EmberJSEmberJS
EmberJS
 
WordPress hooks - WPLDN July 2013 Meetup
WordPress hooks - WPLDN July 2013 MeetupWordPress hooks - WPLDN July 2013 Meetup
WordPress hooks - WPLDN July 2013 Meetup
 
(WEB203) Building a Website That Costs Pennies to Operate | AWS re:Invent 2014
(WEB203) Building a Website That Costs Pennies to Operate | AWS re:Invent 2014(WEB203) Building a Website That Costs Pennies to Operate | AWS re:Invent 2014
(WEB203) Building a Website That Costs Pennies to Operate | AWS re:Invent 2014
 
Developing Rest services with SailsJs by Andrey Kolodnitskiy
Developing Rest services with SailsJs by Andrey KolodnitskiyDeveloping Rest services with SailsJs by Andrey Kolodnitskiy
Developing Rest services with SailsJs by Andrey Kolodnitskiy
 
Scalr - Open Source Cloud Management
Scalr - Open Source Cloud Management Scalr - Open Source Cloud Management
Scalr - Open Source Cloud Management
 
AWS: Introduction
AWS: IntroductionAWS: Introduction
AWS: Introduction
 
전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020
전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020 전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020
전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020
 
jQuery 3.0 Alpha Versions
jQuery 3.0 Alpha Versions jQuery 3.0 Alpha Versions
jQuery 3.0 Alpha Versions
 

Viewers also liked

Elasticsearch 5.0 les nouveautés
Elasticsearch 5.0 les nouveautésElasticsearch 5.0 les nouveautés
Elasticsearch 5.0 les nouveautés
Mathieu Elie
 
Introduction au langage Go
Introduction au langage GoIntroduction au langage Go
Introduction au langage Go
Sylvain Wallez
 
Elasticsearch 5.0
Elasticsearch 5.0Elasticsearch 5.0
Elasticsearch 5.0
Matias Cascallares
 
Rootconf
RootconfRootconf
Rootconf
akbarabi
 
From Config Management Sucks to #cfgmgmtlove
From Config Management Sucks to #cfgmgmtlove From Config Management Sucks to #cfgmgmtlove
From Config Management Sucks to #cfgmgmtlove
Kris Buytaert
 
Mesoscon 2015
Mesoscon 2015Mesoscon 2015
Mesoscon 2015
Skand Gupta
 
Building Product from ground up using Open Source Technologies
Building Product from ground up using Open Source TechnologiesBuilding Product from ground up using Open Source Technologies
Building Product from ground up using Open Source Technologies
Amit Goel
 
Data science team, a practice to setup
Data science team, a practice to setupData science team, a practice to setup
Data science team, a practice to setup
Omid Mogharian
 
Прямая выгода BigData для бизнеса
Прямая выгода BigData для бизнесаПрямая выгода BigData для бизнеса
Прямая выгода BigData для бизнеса
Alexey Lustin
 
DUMP-2012 - Только хардкор! - "Архитектура и запуск облачного сервиса в Amazo...
DUMP-2012 - Только хардкор! - "Архитектура и запуск облачного сервиса в Amazo...DUMP-2012 - Только хардкор! - "Архитектура и запуск облачного сервиса в Amazo...
DUMP-2012 - Только хардкор! - "Архитектура и запуск облачного сервиса в Amazo...it-people
 
Send Balls Into Orbit with Python3, AsyncIO, WebSockets and React
Send Balls Into Orbit with Python3, AsyncIO, WebSockets and ReactSend Balls Into Orbit with Python3, AsyncIO, WebSockets and React
Send Balls Into Orbit with Python3, AsyncIO, WebSockets and React
Taras Lyapun
 
Send that (damn) elevator down !
Send that (damn) elevator down !Send that (damn) elevator down !
Send that (damn) elevator down !
Ekta Grover
 
Behind the Scenes at Coolblue - Feb 2017
Behind the Scenes at Coolblue - Feb 2017Behind the Scenes at Coolblue - Feb 2017
Behind the Scenes at Coolblue - Feb 2017
Pat Hermens
 
PyCon Poland 2016: Maintaining a high load Python project: typical mistakes
PyCon Poland 2016: Maintaining a high load Python project: typical mistakesPyCon Poland 2016: Maintaining a high load Python project: typical mistakes
PyCon Poland 2016: Maintaining a high load Python project: typical mistakes
Viach Kakovskyi
 
Designing Invisible Software at x.ai
Designing Invisible Software at x.aiDesigning Invisible Software at x.ai
Designing Invisible Software at x.ai
Alex Poon
 
Pycon UA 2016
Pycon UA 2016Pycon UA 2016
Pycon UA 2016
Taras Lyapun
 
Introducing ELK
Introducing ELKIntroducing ELK
Introducing ELK
AllBits BVBA (freelancer)
 
Experiences in ELK with D3.js for Large Log Analysis and Visualization
Experiences in ELK with D3.js  for Large Log Analysis  and VisualizationExperiences in ELK with D3.js  for Large Log Analysis  and Visualization
Experiences in ELK with D3.js for Large Log Analysis and Visualization
Surasak Sanguanpong
 
Kibana + timelion: time series with the elastic stack
Kibana + timelion: time series with the elastic stackKibana + timelion: time series with the elastic stack
Kibana + timelion: time series with the elastic stack
Sylvain Wallez
 
Автоматизация анализа логов на базе Elasticsearch
Автоматизация анализа логов на базе ElasticsearchАвтоматизация анализа логов на базе Elasticsearch
Автоматизация анализа логов на базе Elasticsearch
Positive Hack Days
 

Viewers also liked (20)

Elasticsearch 5.0 les nouveautés
Elasticsearch 5.0 les nouveautésElasticsearch 5.0 les nouveautés
Elasticsearch 5.0 les nouveautés
 
Introduction au langage Go
Introduction au langage GoIntroduction au langage Go
Introduction au langage Go
 
Elasticsearch 5.0
Elasticsearch 5.0Elasticsearch 5.0
Elasticsearch 5.0
 
Rootconf
RootconfRootconf
Rootconf
 
From Config Management Sucks to #cfgmgmtlove
From Config Management Sucks to #cfgmgmtlove From Config Management Sucks to #cfgmgmtlove
From Config Management Sucks to #cfgmgmtlove
 
Mesoscon 2015
Mesoscon 2015Mesoscon 2015
Mesoscon 2015
 
Building Product from ground up using Open Source Technologies
Building Product from ground up using Open Source TechnologiesBuilding Product from ground up using Open Source Technologies
Building Product from ground up using Open Source Technologies
 
Data science team, a practice to setup
Data science team, a practice to setupData science team, a practice to setup
Data science team, a practice to setup
 
Прямая выгода BigData для бизнеса
Прямая выгода BigData для бизнесаПрямая выгода BigData для бизнеса
Прямая выгода BigData для бизнеса
 
DUMP-2012 - Только хардкор! - "Архитектура и запуск облачного сервиса в Amazo...
DUMP-2012 - Только хардкор! - "Архитектура и запуск облачного сервиса в Amazo...DUMP-2012 - Только хардкор! - "Архитектура и запуск облачного сервиса в Amazo...
DUMP-2012 - Только хардкор! - "Архитектура и запуск облачного сервиса в Amazo...
 
Send Balls Into Orbit with Python3, AsyncIO, WebSockets and React
Send Balls Into Orbit with Python3, AsyncIO, WebSockets and ReactSend Balls Into Orbit with Python3, AsyncIO, WebSockets and React
Send Balls Into Orbit with Python3, AsyncIO, WebSockets and React
 
Send that (damn) elevator down !
Send that (damn) elevator down !Send that (damn) elevator down !
Send that (damn) elevator down !
 
Behind the Scenes at Coolblue - Feb 2017
Behind the Scenes at Coolblue - Feb 2017Behind the Scenes at Coolblue - Feb 2017
Behind the Scenes at Coolblue - Feb 2017
 
PyCon Poland 2016: Maintaining a high load Python project: typical mistakes
PyCon Poland 2016: Maintaining a high load Python project: typical mistakesPyCon Poland 2016: Maintaining a high load Python project: typical mistakes
PyCon Poland 2016: Maintaining a high load Python project: typical mistakes
 
Designing Invisible Software at x.ai
Designing Invisible Software at x.aiDesigning Invisible Software at x.ai
Designing Invisible Software at x.ai
 
Pycon UA 2016
Pycon UA 2016Pycon UA 2016
Pycon UA 2016
 
Introducing ELK
Introducing ELKIntroducing ELK
Introducing ELK
 
Experiences in ELK with D3.js for Large Log Analysis and Visualization
Experiences in ELK with D3.js  for Large Log Analysis  and VisualizationExperiences in ELK with D3.js  for Large Log Analysis  and Visualization
Experiences in ELK with D3.js for Large Log Analysis and Visualization
 
Kibana + timelion: time series with the elastic stack
Kibana + timelion: time series with the elastic stackKibana + timelion: time series with the elastic stack
Kibana + timelion: time series with the elastic stack
 
Автоматизация анализа логов на базе Elasticsearch
Автоматизация анализа логов на базе ElasticsearchАвтоматизация анализа логов на базе Elasticsearch
Автоматизация анализа логов на базе Elasticsearch
 

Similar to Elastic Stackにハマった話

(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
(WEB301) Operational Web Log Analysis | AWS re:Invent 2014(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
Amazon Web Services
 
Microservices, Continuous Delivery, and Elasticsearch at Capital One
Microservices, Continuous Delivery, and Elasticsearch at Capital OneMicroservices, Continuous Delivery, and Elasticsearch at Capital One
Microservices, Continuous Delivery, and Elasticsearch at Capital One
Noriaki Tatsumi
 
ENT309 Scaling Up to Your First 10 Million Users
ENT309 Scaling Up to Your First 10 Million UsersENT309 Scaling Up to Your First 10 Million Users
ENT309 Scaling Up to Your First 10 Million Users
Amazon Web Services
 
ENT309 Scaling Up to Your First 10 Million Users
ENT309 Scaling Up to Your First 10 Million UsersENT309 Scaling Up to Your First 10 Million Users
ENT309 Scaling Up to Your First 10 Million Users
Amazon Web Services
 
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Amazon Web Services
 
Where Django Caching Bust at the Seams
Where Django Caching Bust at the SeamsWhere Django Caching Bust at the Seams
Where Django Caching Bust at the Seams
Concentric Sky
 
ENT309 scaling up to your first 10 million users
ENT309 scaling up to your first 10 million usersENT309 scaling up to your first 10 million users
ENT309 scaling up to your first 10 million users
Amazon Web Services
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disqus
zeeg
 
Azug - successfully breeding rabits
Azug - successfully breeding rabitsAzug - successfully breeding rabits
Azug - successfully breeding rabits
Yves Goeleven
 
A Practical Multi-Tenant Cluster
A Practical Multi-Tenant ClusterA Practical Multi-Tenant Cluster
A Practical Multi-Tenant Cluster
Command Prompt., Inc
 
CMP301_Deep Dive on Amazon EC2 Instances
CMP301_Deep Dive on Amazon EC2 InstancesCMP301_Deep Dive on Amazon EC2 Instances
CMP301_Deep Dive on Amazon EC2 Instances
Amazon Web Services
 
(STG402) Amazon EBS Deep Dive
(STG402) Amazon EBS Deep Dive(STG402) Amazon EBS Deep Dive
(STG402) Amazon EBS Deep Dive
Amazon Web Services
 
Running your Java EE 6 applications in the clouds
Running your Java EE 6 applications in the clouds Running your Java EE 6 applications in the clouds
Running your Java EE 6 applications in the clouds
Arun Gupta
 
Geek Sync | Performance Tune Like an MVP
Geek Sync | Performance Tune Like an MVPGeek Sync | Performance Tune Like an MVP
Geek Sync | Performance Tune Like an MVP
IDERA Software
 
BDA402 Deep Dive: Log Analytics with Amazon Elasticsearch Service
BDA402 Deep Dive: Log Analytics with Amazon Elasticsearch ServiceBDA402 Deep Dive: Log Analytics with Amazon Elasticsearch Service
BDA402 Deep Dive: Log Analytics with Amazon Elasticsearch Service
Amazon Web Services
 
STG330_Case Study How Experian Leverages Amazon EC2, EBS, and S3 with Clouder...
STG330_Case Study How Experian Leverages Amazon EC2, EBS, and S3 with Clouder...STG330_Case Study How Experian Leverages Amazon EC2, EBS, and S3 with Clouder...
STG330_Case Study How Experian Leverages Amazon EC2, EBS, and S3 with Clouder...
Amazon Web Services
 
AWS October Webinar Series - Introducing Amazon Elasticsearch Service
AWS October Webinar Series - Introducing Amazon Elasticsearch ServiceAWS October Webinar Series - Introducing Amazon Elasticsearch Service
AWS October Webinar Series - Introducing Amazon Elasticsearch Service
Amazon Web Services
 
Caching your rails application
Caching your rails applicationCaching your rails application
Caching your rails application
ArrrrCamp
 
Threads Needles Stacks Heaps - Java edition
Threads Needles Stacks Heaps - Java editionThreads Needles Stacks Heaps - Java edition
Threads Needles Stacks Heaps - Java edition
Ovidiu Dimulescu
 
Apache Mesos at Twitter (Texas LinuxFest 2014)
Apache Mesos at Twitter (Texas LinuxFest 2014)Apache Mesos at Twitter (Texas LinuxFest 2014)
Apache Mesos at Twitter (Texas LinuxFest 2014)
Chris Aniszczyk
 

Similar to Elastic Stackにハマった話 (20)

(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
(WEB301) Operational Web Log Analysis | AWS re:Invent 2014(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
 
Microservices, Continuous Delivery, and Elasticsearch at Capital One
Microservices, Continuous Delivery, and Elasticsearch at Capital OneMicroservices, Continuous Delivery, and Elasticsearch at Capital One
Microservices, Continuous Delivery, and Elasticsearch at Capital One
 
ENT309 Scaling Up to Your First 10 Million Users
ENT309 Scaling Up to Your First 10 Million UsersENT309 Scaling Up to Your First 10 Million Users
ENT309 Scaling Up to Your First 10 Million Users
 
ENT309 Scaling Up to Your First 10 Million Users
ENT309 Scaling Up to Your First 10 Million UsersENT309 Scaling Up to Your First 10 Million Users
ENT309 Scaling Up to Your First 10 Million Users
 
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
 
Where Django Caching Bust at the Seams
Where Django Caching Bust at the SeamsWhere Django Caching Bust at the Seams
Where Django Caching Bust at the Seams
 
ENT309 scaling up to your first 10 million users
ENT309 scaling up to your first 10 million usersENT309 scaling up to your first 10 million users
ENT309 scaling up to your first 10 million users
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disqus
 
Azug - successfully breeding rabits
Azug - successfully breeding rabitsAzug - successfully breeding rabits
Azug - successfully breeding rabits
 
A Practical Multi-Tenant Cluster
A Practical Multi-Tenant ClusterA Practical Multi-Tenant Cluster
A Practical Multi-Tenant Cluster
 
CMP301_Deep Dive on Amazon EC2 Instances
CMP301_Deep Dive on Amazon EC2 InstancesCMP301_Deep Dive on Amazon EC2 Instances
CMP301_Deep Dive on Amazon EC2 Instances
 
(STG402) Amazon EBS Deep Dive
(STG402) Amazon EBS Deep Dive(STG402) Amazon EBS Deep Dive
(STG402) Amazon EBS Deep Dive
 
Running your Java EE 6 applications in the clouds
Running your Java EE 6 applications in the clouds Running your Java EE 6 applications in the clouds
Running your Java EE 6 applications in the clouds
 
Geek Sync | Performance Tune Like an MVP
Geek Sync | Performance Tune Like an MVPGeek Sync | Performance Tune Like an MVP
Geek Sync | Performance Tune Like an MVP
 
BDA402 Deep Dive: Log Analytics with Amazon Elasticsearch Service
BDA402 Deep Dive: Log Analytics with Amazon Elasticsearch ServiceBDA402 Deep Dive: Log Analytics with Amazon Elasticsearch Service
BDA402 Deep Dive: Log Analytics with Amazon Elasticsearch Service
 
STG330_Case Study How Experian Leverages Amazon EC2, EBS, and S3 with Clouder...
STG330_Case Study How Experian Leverages Amazon EC2, EBS, and S3 with Clouder...STG330_Case Study How Experian Leverages Amazon EC2, EBS, and S3 with Clouder...
STG330_Case Study How Experian Leverages Amazon EC2, EBS, and S3 with Clouder...
 
AWS October Webinar Series - Introducing Amazon Elasticsearch Service
AWS October Webinar Series - Introducing Amazon Elasticsearch ServiceAWS October Webinar Series - Introducing Amazon Elasticsearch Service
AWS October Webinar Series - Introducing Amazon Elasticsearch Service
 
Caching your rails application
Caching your rails applicationCaching your rails application
Caching your rails application
 
Threads Needles Stacks Heaps - Java edition
Threads Needles Stacks Heaps - Java editionThreads Needles Stacks Heaps - Java edition
Threads Needles Stacks Heaps - Java edition
 
Apache Mesos at Twitter (Texas LinuxFest 2014)
Apache Mesos at Twitter (Texas LinuxFest 2014)Apache Mesos at Twitter (Texas LinuxFest 2014)
Apache Mesos at Twitter (Texas LinuxFest 2014)
 

Recently uploaded

How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
kalichargn70th171
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 

Recently uploaded (20)

How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 

Elastic Stackにハマった話

  • 1. Been Stuck In Elastic Stack Kazuhiro Kosaka Engineer, MDH, CyberAgent, Inc. Feb 10, 2017
  • 2. About Me • 小坂和弘 - Kazuhiro Kosaka @hyperdash • 2009- CyberAgent, Inc. • Designer/Front-end Engineer/Back-end Engineer • Motion Graphics, VJ
  • 3. About Me • I love hiking
  • 4. Summary What To Talk? • Amazon Elasticsearch Service • v1.x v2.x
  • 5. Summary What NOT To Talk? • Private Elasticsearch Cluster / Elastic Cloud • v5.x
  • 6. Summary Elastic Stack? • Had been called ELK Stack • Elasticsearch - Distributed Search/Analytics Engine • Logstash - Data Processing Pipeline • Kibana - Data Visualizer • Beats - Data Shipping Agents
  • 8. Our Case • Elasticsearch v1.5 on Amazon Elasticsearch Service • Logstash v2.3.1 • Filebeat v1.2.1 • m3.large / 3 instances • 400,000 docs / day • 95% of logs are by 日予算自動アロケーション Batch • Will be separated into another index • 主にユーザの操作履歴調査
  • 10. Stuck #1 / Settings DataLossを防ぐには? • Filebeat uses a back-pressure sensitive protocol • Logstash < v5.1 has NO Persistent Queue
  • 11. Stuck #1 / Settings DataLossを防ぐには? Source: https://www.elastic.co/guide/en/logstash/5.0/deploying-and-scaling.html
  • 12. Stuck #1 / Settings DataLossを防ぐには? • Use Message Queue e.g. Kafka • Delete Filebeat registrar file and Re-ship data • >= v5.1 Persistent Queue (beta) is enabled
  • 13. Stuck #2 / JVMMemoryPressure ESにWriteできなくなったんですけど… • m3.medium / 1 instance • JVMMemoryPressure ≒ 92-94 % • FreeStorageSpace looks okay
  • 14. Stuck #2 / JVMMemoryPressure ESにWriteできなくなったんですけど… Source: http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/aes-handling-errors.html • NOT a t2 instance • ???
  • 15. Stuck #2 / JVMMemoryPressure ESにWriteできなくなったんですけど… m3.medium / 1 instance m3.large / 3 instances Worked!
  • 16. Stuck #2 / JVMMemoryPressure ESにWriteできなくなったんですけど… • indices.fielddata.cache.size: unbounded (default) This allows ES to allocate unlimited memory for fielddata • indices.fielddata.cache.size: 50 (%)
  • 17. Stuck #2 / JVMMemoryPressure ESにWriteできなくなったんですけど… Source: https://www.elastic.co/guide/en/elasticsearch/guide/current/_limiting_memory_usage.html
  • 18. Stuck #2 / JVMMemoryPressure ESにWriteできなくなったんですけど… • ES v1.x • Doc Values: Default OFF • Set “doc_values”: true in index template - mappings
  • 19. Stuck #2 / JVMMemoryPressure ESにWriteできなくなったんですけど… • ES >= v2.x • Doc Values: Default ON
  • 20. Stuck #3 / Restrictions Amazon Elasticsearch Serviceの制限 • Dynamic Scripting is not supported • Custom Plugins are not supported • Access Control • Amazon ES is out of VPC • IP-Based, IAM-Based Access Control • logstash-output-amazon_es plugin is not stable??
  • 21. Next Step • Migrate to Elastic Stack v5.x • Elastic Cloud or Private Cluster? • 管理画面上での操作ログ閲覧
  • 22. Conclusion • Amazon Elasticsearch Service • Elastic Cloud • Easy & Handy (Fully-Managed) • The latest version is available anytime • Less Restrictions, or Elastic Cloud Enterprise (alpha) • Supported by Elastic • Easy & Handy (Fully-Managed) • Restrictions • Supported by AWS

Editor's Notes

  1. Elastic Stackにハマった話をいくつかさせていただきたいと思います。
  2. 自己紹介です。小坂和弘ともうします。2009年にサイバーエージェントに中途入社して、主にサーバサイドの開発をしています。最近はScala、Golangで広告配信設定管理まわりの開発をしています。以前いたPigg、ゲーム部門の方では、Flash、JS、Unityでフロントの開発もやっていました。 それ以前はデザイナーをしていたり、映像制作、VJとかやってました。 2009年にサイバーエージェントに中途入社 サーバ: scala, golang, 広告配信設定管理まわりの開発 フロント: Pigg, Game部門 Flash, JS, Unity デザイナー、映像、VJ
  3. ハイキングが好きでグランドキャニオンの谷底まで降りたり、砂漠の山を登ったりしました。山最高。 あと、アメリカ英語発音の習得が趣味です。 - 趣味の話
  4. 今日話すことですが、主にAmazon Elasticsearch Serviceの話です。 Elasticsearchは1.5、Logstashは2.3、あとはFilebeatを使っていますが、少し古いバージョンの話になります。 Amazon Elasticsearch Service ES 1.5 Logstash 2.3 Filebeat やや古いバージョンの話
  5. 話さないことですが、自前クラスタでの運用、Elastic Cloudでの運用、バージョン5系の話は今回はあまりしません。 自前クラスタでの運用 Elasic Cloudでの運用 v5.x系
  6. まず最初に、Elastic Stackについて軽く説明しますと、以前はES、Logstash、Kibanaの頭文字を取って、ELK Stackと呼ばれていました。 Beatsというコンポーネントが加わってElastic Stackと呼ばれるようになりました。 ESが検索分析エンジン、 Logstashがデータを処理、加工するフィルタパイプライン、 Kibanaがデータを可視化するビジュアライザ、 BeatsがデータをESやLogstashに送るエージェントです。 Beatsにはログファイルを監視して送信するFilebeatなどを始めとして、様々な用途に応じたものがあります。 ES, Logstash, Kibana = ELK Stack + Beats = Elastic Stack ES = 検索分析エンジン LS = データを処理、加工するフィルタパイプライン Kibana = データを可視化するビジュアライザ Beats = データをESやLogstashに送るエージェント Beats = Filebeat, etc
  7. 私達が現在Elastic Stackを使っているのは、主に自社メディアへの広告配信設定を運用管理するためのWEB画面です。 こちらでのユーザ操作ログの収集と検索になります。 このシステムのバックエンドログを一元的に検索できる必要があったのですが、一番早く、簡単に実現できる方法としてAmazon ESを選択しました。 サイバーエージェント内ではFluentdが使われることが多かったので、 Filebeat、Logstashの流行りに乗って知見を溜めておきたいという理由もありました。 この他にシステムのパフォーマンス測定、ジョブ実行結果の集計にも一部使われてますが、今回はこの操作ログの収集、検索においての話になります。 自社メディアへの広告配信設定を運用管理するためのWEB画面 ユーザ操作ログの収集と検索 Amazon ES = 最速で構築 Elastic Stackの流行り、知見目的
  8. 環境ですが、Amazon ES上でバージョン1.5を使っています。 構築当初は2.3が選べなかったんですが、今では5.1も選べるようになっています。 あとは、Logstash、Filebeat。現在はこういった構成で運用しています。 ドキュメント数は1日40万件ほどありますが、このうち約95%は広告キャンペーンの日予算を自動で調整するバッチからのリクエストによります。 単純にユーザの操作履歴を検索する際にはノイズになっているので、別インデックスに分けようという予定です。 v1.5 on Amazon ES 2.3/5.1 選択可能になった LogstashとFilebeat 40万件/日 でも95%は人間の操作じゃない → 分離したい - 広告配信ログ = 配信サーバ→flume→Hive/S3/ISE
  9. 一部プロキシが入ってる箇所など簡略化してありますが、大まかな構成図はこんな感じになります。 バックエンドにResource Serverと呼ばれるGeraphQLのAPIサーバがあり、その各台でFilebeatが動いていて、ログファイルを送信しています。 送信先は、Log Aggregatorと呼んでいるLogstashサーバになります。 LogstashではBeats Inputで受け取ったログを一旦ほぼ生の状態でローカルファイルに書き込んでいます。 それらをスクリプトでS3にもコピーしています。 また、そのローカルファイルをLogstashのFile Inputを使って再度読み込み、不要な情報の削除や、加工を行ってESにoutputしているというシンプルな構成になっています。 現在は特にメッセージキューを入れたりはしていません。 構成図 RS Genisys Logstash -> ES / S3 (スクリプト)
  10. いま、キューは特に使っていないと言ったんですが、特にLogstashなんですが、 これを使うと決めた際に最初に悩んだことが、どうやってデータロスを防ぐかということでした。 Filebeatはバックプレッシャーに対応しているのと、どこまで送信が完了したかをインデックス管理していて、ログを送り損ねることはなさそうでした。 問題はLogstashで、v5.1でキューをディスクにバッファする機能がbetaリリースされましたが、当時はv.2.3が最新バージョンで、その機能はありませんでした。 データロスをどう防ぐか Filebeat = バックプレッシャー対応、インデクス Logstash = 5.1で内部キューのファイルバッファ機能、2.3にはなかった
  11. 次に、Logstashのパイプラインを見てみるとこのようになっています。 今回はFilebeatからBeats Input経由でデータを受け取っているので、下の図のようなパイプラインになります。 Inputからデータが入ってきて、Filterを通って、Outputから出ていきます。 この際、InputとFilterの間、FilterとOutputの間はメモリ上にデータがキューされます、このキューにデータが入っている状態でLogstashのプロセスがクラッシュするとキュー内部のデータが失われる可能性があります。 パイプラインの流れ 内部キュー in メモリ Logstashがクラッシュするとキュー内部のデータがロストする可能性
  12. 今回はFilebeatを使ったので、オリジナルのデータが失われることはないのですが、 特にオリジナルのデータがファイル等に残らないようなデータソースを使う場合には、Logstashの前になんらかのメッセージキューを入れる必要があると思います。 例えば、Kafkaを使った場合はオフセット情報を元にデータの再送信が可能なようですが、 使うキューによっては、LogstashのPersistent Queueを併用する必要があるかもしれません。 この辺はまだ調べきれてないです。 Persistent Queueが使えない場合でも、データが再送信できればデータロスを回復することができます。 再送信することで、ESにストアされる際にドキュメント重複する問題が出てきますが、 Logstashのフィルタを使ってhash値取り、それをドキュメントのIDとして使うことで、すでに同じIDのドキュメントがあっても、上書きされるだけで、重複の発生を防げます。 今回のケースでは、そこまでクリティカルなデータを扱っていないことから、Logstashがクラッシュした場合は Filebeatのレジストラファイルを削除してログを再送信させる方法でデータロス時の対応をしていますが、 Logstash自体のクラッシュは今まで起こっていません。 Filebeat オリジナルログ残る メッセージキュー Kafka オフセット情報から再送信 それ以外、Persistent Queue データ再送信でロス防止 重複はhashで回避 今回は都度再送信前提で、ただしLogstashのクラッシュはほとんど起こってない
  13. 2つめのハマりです。突然ESにWriteができなくなりました。 モニタリングで状態を調べてみると、JVMMemoryPressureメトリクスが高い状態で張り付いているものの、FreeStorageSpaceは問題ない数値。 当初はメモリは検索には影響が出ても、書き込みには影響しないだろうと考えていたので、原因がよくわかりませんでした。 突然Wirteできなくなった このときの構成 このときの状態
  14. AWSのドキュメントをよく読んでみると、t2インスタンスの場合はJVMMemoryPressureが92%に達するとWriteをブロックしますよという記述が見つかりました。 t2インスタンスは使っていませんでしたが、JVMMemoryPressureは確かに高い状態だったので、メモリの圧迫が原因ではないかと推測して対応してみることにしました。 AWSのドキュメントにt2インスタンスでJVMMemoryPressure 92%の記述 同じ現象? メモリ周りを疑ってみる
  15. メモリを増やすか、メモリ上に載るデータを減らして解決するか試すために、手っ取り早い方法を取りました。 よりメモリを載せたインスタンスでノード数も増やしたところ、Writeが再開されました。JVMMemoryPressureメトリクス値も70%あたりまで下がりました。 - インスタンスタイプを変えて、ノードも増やした
  16. コンソールから設定できる項目は数少ないが、Amazon ESの設定を見直したら… indices.fielddata.cache.size が未設定になっていました。。。 この設定値が未設定の場合、制限なくメモリを確保するようです。 fielddataって何かというと、ドキュメントの各フィールドの値をメモリ上にキャッシュして高速化しているのがfielddata cacheのようです。 indices.fielddata.cache.size 未設定だった
  17. 50%に設定して様子を見ているが、Elasticのドキュメントを見ると、十分なメモリが残っていないと、Luceneのファイルシステムアクセスのパフォーマンスに影響が出るので、RAMの50%はそのために空けておいた方がよい的なことを言っているので、もっと少ない値を設定すべきかもしれません。 この辺はパフォーマンスの様子とAPIでステータスを見ながら調整かなと思っています。 50%に設定しているが、最適な設定値はAPI叩きながら調整?
  18. さらに、ES v1.x では Doc Values という設定がデフォルトでオフになっていることがわかりました。 これはLucene側の仕組みで、メモリ上に持っていた情報を代わりにディスクを使うことでメモリ使用量を減らすことができるというもののようです。 インデックステンプレートのマッピング設定で明示的にオンに設定することで、さらにメモリ使用量を抑えることができています。 - Doc Values
  19. この設定ですが、バージョンv2.x系からはデフォルトでONになっているので、あまり考える必要はないかなと思います。 - v2.xからはデフォルト
  20. 3つめのハマりポイントとして、Amazon ESを使うにあたって、事前の調査が不足していたこともあるんですが、 使ってみると、いくつかできないことがあって、ぐぬぬとなると言ったことがありました。 スクリプトが使えないので、例えば、ある条件式に当てはまるドキュメントをフィルタするといった場合には工夫が必要です。 あとはカスタムプラグインをサポートしていません。 Amazon ESがVPC外部にある関係で、アクセスコントロールはIPベース、またはIAMベースになっています。 この認証をLogstashから簡単に行えるようにするため、LogstashのoutputプラグインがAWSから提供されていますが、同じ環境で同じ設定なのに、あるときを境に、突如接続できなくなったりといったことがありました。 結局原因は判らずじまいで、悩んだあげく、結局IPベースでのアクセス許可に切り替えることで乗り切っています。 Amazon ESの制限 事前調査不足 = 使ってるうちにぐぬぬ スクリプト使えない プラグイン使えない アクセスコントロール、IP、IAM、VPC外 logstash-output-amazon_es
  21. これらのハマりポイントを踏まえて、今後の予定ですが、 バージョン5系への移行、Amazon Elasticsearch Serviceからの卒業。 Elastic Cloudか自前クラスタでの運用への移行ですね。。 Kibanaを介さず、非エンジニアなユーザが操作履歴の表示をWEBの画面上で閲覧したいという要望があるので、そちらへの対応を予定しています。 5.x系への移行 - Amazon Elasticsearch Serviceからの卒業 - ユーザが操作履歴見れるようWEB画面に統合
  22. 今日のまとめです。 まとめとしてはAmazon ESやめてバージョンあげたいということなんですが。。。 Amazon ESはあまり設定のことを考えなくても、とりあえずすぐ使えるようになるので立ち上げるのは簡単です。 細かい設定なしでも安定して使えるよう、負荷になるような機能に制限がされています。 これによって、ESを使いこなしてくると物足りなさを感じるかもしれません。 Elastic社の公式クラウドサービスであるElastic Cloudは、Amazon ESと同じく簡単に立ち上げられるのはもちろんですが、 最新バージョンに簡単にアップデートできて、制限も少ないです。 完全に制限のない環境が必要な場合には、まだalpha版ですが、Enterprise版という選択肢もでてきました。 もちろん自前でクラスタ構築するのもありだと思いますが、そこはメンテナンスやチューニングのコストをどう捉えるか、なのかなと思っています。 Amazon ES = 簡単、チューニングあまり考えずに済む、そのかわり、負荷になる操作が制限されている、物足りなさ Elastic Cloud = 公式、Amazon ES同様簡単、フルマネージド。常に最新バージョンが使えて、簡単にアップデートできる、制限は少ない Enterprise = 制限ない alpha メンテナンス、チューニングコストの捉え方次第
  23. Elastic Stack使ってるという方がいらっしゃれば、懇親会の方でお声がけいただけるとありがたいです。 まだまだ初心者なので、是非いろいろ教えていただければと思います。 発表は以上になります。ありがとうございました。