SlideShare a Scribd company logo
High Availability SOA APP with GlusterFS
Vladimir Vitkov
2017.10.07 / TarnovoConf
High Availability SOA APP with GlusterFS Vladimir Vitkov
Who am I
• Vladimir
• Sysadmin / DevOPS
• FOSS proponent and addopter
• Experimentor
• Relatively nice guy for a chat*
High Availability SOA APP with GlusterFS Vladimir Vitkov
What is SOA
High Availability SOA APP with GlusterFS Vladimir Vitkov
Let’s put the basis on what SOA is and why it is usefull for the
world. Service Oriented Architecture is a way of thinking and
coincidentaly separates the application into multiple services (not
necessarily micro ones).
The monolith
High Availability SOA APP with GlusterFS Vladimir Vitkov
The monolith approach is usually the first one. It is easier to
construct as everything is in the same place. There is no need to
account for delays, communication failures and similar. Of course it
has it’s drawbacks. The piece of code is huge, hard to maintain and
scale. Sometimes ugly, but always hard on supporting.
Services
High Availability SOA APP with GlusterFS Vladimir Vitkov
The services approach usually evolves from the monolith one. The
big APPLICATION (yes all capital) gets split at some point into
smaller more contained chunks that do few things (initially). The
final incarnation is one service does one and only one thing. The
benefits are easier maintenance, scaling and supporting the code.
Usually this is done with a total rewrite but sometimes it is done
with a state of mind as refactoring code.
SOA
High Availability SOA APP with GlusterFS Vladimir Vitkov
SOA is mostly a pattern in software design in which the components
of the system are separated from one another and communicate via
a protocol (usually network one). The principles are neutral and
independent of vendor, product or technology. Most often this is
achieved with the help of the protocols. Most common ones are
SOAP and REST. As such it is in fact microservices architecture but
on a conceptual level. Currently large-scale applications are based on
the SOA principles and microservices model.
The Application
High Availability SOA APP with GlusterFS Vladimir Vitkov
Well one of the services only
What is the system
• Large scale Ecommerce product
• Quite a few services that interact
• Lots of users
• Lots of traffic
High Availability SOA APP with GlusterFS Vladimir Vitkov
I am running a fairly complex and large application, we have quite
some services, lots of interactions, lots of traffic and users and this
needs to always be available and run.
What is the service
• Brand New service
• Replacing custom hacks
• To be in service in 3 weeks
• After several total redesigns
High Availability SOA APP with GlusterFS Vladimir Vitkov
The service i am going to tell you today was brand new. It was born
in 3 weeks. Main purpose of it was to replace some custom hacks in
our processess and more fluidly control access to resources. It has
been totally redesigned several times. It has the core of it changed at
least 3 times. And finally introduced without anyone noticing (except
directly involved parties).
What is the service (2)
• Speaks REST
• Stores some local data
• Transforms requests
• Pulls data from 3rd party service
• Is stateless
High Availability SOA APP with GlusterFS Vladimir Vitkov
This service speaks rest, stores some configuration in local storage.
When someone asks it the right question, respoonds after pulling
some 3rd party data, applying transforms and generally humming
along. The best thing: it was stateless.
Wha the service was not
• Highly available
• Redundant
• Without central data store
• But needs to be
• Does not know of changes
High Availability SOA APP with GlusterFS Vladimir Vitkov
Unfortunately not everything is hunky-dory in the SOA land. The
service was not highly available, not redundant, had no idea of
central storage and generally was not ready for prime time. But it
needed to be all this things. So OPS had to rescue it and give it
wings.
The Solution
High Availability SOA APP with GlusterFS Vladimir Vitkov
Leave the devs to develop and ops to operate. But join them for a
synergy.
Highly Available
• Bring up more instances
• Spread them around
• Load balance them
• Monitor them for health
• Recover/replace them
High Availability SOA APP with GlusterFS Vladimir Vitkov
To make the service more highly available do the sane thing. The
service is stateless so apply the regular tricks. Add more
instances/server. Put them in a load balancer (either DNS or some
other like HAProxy). Of course do not forget to monitor the stuff.
Use your best judgement. Monitoring is moot if there are no
procedures to detect, recover or replace failed instances. Doing this
in an automated fashion helps a lot.
Redundant
• High Availability
• Monitoring
• Recover/replace
High Availability SOA APP with GlusterFS Vladimir Vitkov
Keep that service stateless and Highly available. Redundancy is
necessary for high availability anyways.
No central data store
• Core issue
• Create GlusterFS cluster for replica
• Reconfigure app to use clustered data store
• Monitor it
• Recover/replace
High Availability SOA APP with GlusterFS Vladimir Vitkov
The missing central data store become the core issue that prompted
developing this approach. The application was aware only of local
storage and porting it to support remote/central storage would have
missed deadlines. So ops had to rescue the situation. The solution
we thought of included creating a replicated GlusterFS cluster. It
took care to synchronise and replicate the needed local data to all
nodes. After that it was just necessary to reconfigure the application
to use this local (but in reality replicated) data storage. As a
recurring theme do not forget the monitoring. Monitor all
components available and monitor them well. Again do not forget to
automate recovery in case of troubles with the nodes.
Become aware of changes
• App does not know about new data
• Build update mechanism
• Inotify + curl
• NFS is not a friend
• FUSE is not a friend too
High Availability SOA APP with GlusterFS Vladimir Vitkov
Another problem with this approach was that the application is not
monitoring local data store for changes. To solve this add a
mechanism to inform it that the data store has changed and should
be reread/reconsidered. Devs built a mechanism to do this and
exposed it. The detect the changes on the filesystem level and
trigger this mechanism. Inotify and curl fit nicelu into this. But
unfortunately NFS and FUSE do not support inotify events. FUSE
may support them but requires special codding in the FS to have it.
How to do it
High Availability SOA APP with GlusterFS Vladimir Vitkov
Show how it is built
Components
• GlusterFS
• nfs-common
• inotify-hookable
• nice utils around
High Availability SOA APP with GlusterFS Vladimir Vitkov
First step is to install everything necessary. This includes the
GlusterFS itself, nfs client, inotify monitoring tool and any utilities
you may need
Create GlusterFS cluster
• Start gluster daemon
• Assemble cluster
gluster peer probe remote.peer.host
• /var/lib/glusterd/peers/*
High Availability SOA APP with GlusterFS Vladimir Vitkov
Next step is to build the cluster. Building the cluster is basically
probing the peers. Do the probing from one node only. No need to
do it from the other nodes. Make sure your DNS works properly and
can resolve the names. If you don’t want to mix names/ip addressess
you may have to manually edit gluster peers to use names.
Create volume
• Create replicated volume
gluster volume create vol1 replica 2 
transport tcp peer1:/vol peer2:/vol
High Availability SOA APP with GlusterFS Vladimir Vitkov
Creating the volume is a simple command. This will initialize the so
called bricks that form the GlusterFS fabric. As we are aiming for
redundancy and replication we create the volume with replica count
2 and add only 2 bricks. If bricks are created on the root partition
you will need to use "force"option. Take some time to review the
GlusterFS tunning options (Resources slide).
Reconfigure
• mount
mount -t nfs localhost:/vol1 /app
• Start the app
High Availability SOA APP with GlusterFS Vladimir Vitkov
We chose to use local nfs mount to enable functioning of the service
in a split brain/down situation. The data is replicated everywhere so
it is not important from where we serve. GlusterFS has a
reconciliation mechanism that can handle split brain situations. Of
course chosing NFS (FUSE also won’t help you) leads us to the next
problem. No inotify events
Update info
• Data added on other node
inotify-hookable 
--watch-directories /vol 
--on-modify-command curl
High Availability SOA APP with GlusterFS Vladimir Vitkov
It is important to update the applications view of the data store. We
do this by detecting changes (to the local brick) and triggering the
update cycle with curl. monitoring the local brick is necessary due to
inotify events not being emitted for nfs.
DEMO Time
High Availability SOA APP with GlusterFS Vladimir Vitkov
In this demo we’ll show you the final result. We’ll play with disabling
the update mechanism, so we can demonstrate that content is
properly replicated but the application is not aware of it.
Closing
High Availability SOA APP with GlusterFS Vladimir Vitkov
Q/A?
High Availability SOA APP with GlusterFS Vladimir Vitkov
Contact
• Demo: http://is.gd/gluster_demo
• Slides: https://is.gd/ha_soa_tarnovoconf
• mail: vvitkov@linux-bg.org
• GPG: A162 1211 8ACB 4CC5
High Availability SOA APP with GlusterFS Vladimir Vitkov
Resources
• http://is.gd/gluster_tune
• http://is.gd/gluster_quickstart
• http://flask.pocoo.org/
High Availability SOA APP with GlusterFS Vladimir Vitkov

More Related Content

What's hot

Adopting Java for the Serverless world at AWS User Group Pretoria
Adopting Java for the Serverless world at AWS User Group PretoriaAdopting Java for the Serverless world at AWS User Group Pretoria
Adopting Java for the Serverless world at AWS User Group Pretoria
Vadym Kazulkin
 
StackStorm DevOps Automation Webinar
StackStorm DevOps Automation WebinarStackStorm DevOps Automation Webinar
StackStorm DevOps Automation Webinar
StackStorm
 
What we learned from the AWS Outage
What we learned from the AWS OutageWhat we learned from the AWS Outage
What we learned from the AWS Outage
PolarSeven Pty Ltd
 
Devops at Netflix (re:Invent)
Devops at Netflix (re:Invent)Devops at Netflix (re:Invent)
Devops at Netflix (re:Invent)
Jeremy Edberg
 
Devoxx PL 2018 - Microservices in action at the Dutch National Police
Devoxx PL 2018 - Microservices in action at the Dutch National PoliceDevoxx PL 2018 - Microservices in action at the Dutch National Police
Devoxx PL 2018 - Microservices in action at the Dutch National Police
Bert Jan Schrijver
 
Interoperability: The Elephants in the Room & What We're Doing About Them
Interoperability: The Elephants in the Room & What We're Doing About ThemInteroperability: The Elephants in the Room & What We're Doing About Them
Interoperability: The Elephants in the Room & What We're Doing About Them
Mark Voelker
 
Cloud patterns
Cloud patternsCloud patterns
Cloud patterns
Nicolas De Loof
 
Micro Services - Small is Beautiful
Micro Services - Small is BeautifulMicro Services - Small is Beautiful
Micro Services - Small is Beautiful
Eberhard Wolff
 
Dublin JUG February 2018 - Microservices in action at the Dutch National Police
Dublin JUG February 2018 - Microservices in action at the Dutch National PoliceDublin JUG February 2018 - Microservices in action at the Dutch National Police
Dublin JUG February 2018 - Microservices in action at the Dutch National Police
Bert Jan Schrijver
 
Get There meetup March 2018 - Microservices in action at the Dutch National P...
Get There meetup March 2018 - Microservices in action at the Dutch National P...Get There meetup March 2018 - Microservices in action at the Dutch National P...
Get There meetup March 2018 - Microservices in action at the Dutch National P...
Bert Jan Schrijver
 
Serverless on OpenStack with Docker Swarm, Mistral, and StackStorm
Serverless on OpenStack with Docker Swarm, Mistral, and StackStormServerless on OpenStack with Docker Swarm, Mistral, and StackStorm
Serverless on OpenStack with Docker Swarm, Mistral, and StackStorm
Dmitri Zimine
 
Nanog75, Network Device Property as Code
Nanog75, Network Device Property as CodeNanog75, Network Device Property as Code
Nanog75, Network Device Property as Code
Damien Garros
 
Flintstones or Jetsons? Jump Start Your Virtual Test Lab
Flintstones or Jetsons? Jump Start Your Virtual Test LabFlintstones or Jetsons? Jump Start Your Virtual Test Lab
Flintstones or Jetsons? Jump Start Your Virtual Test Lab
TechWell
 
iSense Java Summit 2017 - Microservices in action at the Dutch National Police
iSense Java Summit 2017 - Microservices in action at the Dutch National PoliceiSense Java Summit 2017 - Microservices in action at the Dutch National Police
iSense Java Summit 2017 - Microservices in action at the Dutch National Police
Bert Jan Schrijver
 
CERN Data Centre Evolution
CERN Data Centre EvolutionCERN Data Centre Evolution
CERN Data Centre Evolution
Gavin McCance
 
Outsmarting Merge Edge Cases in Component Based Design
Outsmarting Merge Edge Cases in Component Based DesignOutsmarting Merge Edge Cases in Component Based Design
Outsmarting Merge Edge Cases in Component Based Design
Perforce
 
Boundary for puppet @ puppet conf2012
Boundary for puppet @ puppet conf2012Boundary for puppet @ puppet conf2012
Boundary for puppet @ puppet conf2012
Boundary
 
OpenValue meetup October 2017 - Microservices in action at the Dutch National...
OpenValue meetup October 2017 - Microservices in action at the Dutch National...OpenValue meetup October 2017 - Microservices in action at the Dutch National...
OpenValue meetup October 2017 - Microservices in action at the Dutch National...
Bert Jan Schrijver
 
JavaZone 2017 - Microservices in action at the Dutch National Police
JavaZone 2017 - Microservices in action at the Dutch National PoliceJavaZone 2017 - Microservices in action at the Dutch National Police
JavaZone 2017 - Microservices in action at the Dutch National Police
Bert Jan Schrijver
 
Microservices in action at the Dutch National Police
Microservices in action at the Dutch National PoliceMicroservices in action at the Dutch National Police
Microservices in action at the Dutch National Police
Bert Jan Schrijver
 

What's hot (20)

Adopting Java for the Serverless world at AWS User Group Pretoria
Adopting Java for the Serverless world at AWS User Group PretoriaAdopting Java for the Serverless world at AWS User Group Pretoria
Adopting Java for the Serverless world at AWS User Group Pretoria
 
StackStorm DevOps Automation Webinar
StackStorm DevOps Automation WebinarStackStorm DevOps Automation Webinar
StackStorm DevOps Automation Webinar
 
What we learned from the AWS Outage
What we learned from the AWS OutageWhat we learned from the AWS Outage
What we learned from the AWS Outage
 
Devops at Netflix (re:Invent)
Devops at Netflix (re:Invent)Devops at Netflix (re:Invent)
Devops at Netflix (re:Invent)
 
Devoxx PL 2018 - Microservices in action at the Dutch National Police
Devoxx PL 2018 - Microservices in action at the Dutch National PoliceDevoxx PL 2018 - Microservices in action at the Dutch National Police
Devoxx PL 2018 - Microservices in action at the Dutch National Police
 
Interoperability: The Elephants in the Room & What We're Doing About Them
Interoperability: The Elephants in the Room & What We're Doing About ThemInteroperability: The Elephants in the Room & What We're Doing About Them
Interoperability: The Elephants in the Room & What We're Doing About Them
 
Cloud patterns
Cloud patternsCloud patterns
Cloud patterns
 
Micro Services - Small is Beautiful
Micro Services - Small is BeautifulMicro Services - Small is Beautiful
Micro Services - Small is Beautiful
 
Dublin JUG February 2018 - Microservices in action at the Dutch National Police
Dublin JUG February 2018 - Microservices in action at the Dutch National PoliceDublin JUG February 2018 - Microservices in action at the Dutch National Police
Dublin JUG February 2018 - Microservices in action at the Dutch National Police
 
Get There meetup March 2018 - Microservices in action at the Dutch National P...
Get There meetup March 2018 - Microservices in action at the Dutch National P...Get There meetup March 2018 - Microservices in action at the Dutch National P...
Get There meetup March 2018 - Microservices in action at the Dutch National P...
 
Serverless on OpenStack with Docker Swarm, Mistral, and StackStorm
Serverless on OpenStack with Docker Swarm, Mistral, and StackStormServerless on OpenStack with Docker Swarm, Mistral, and StackStorm
Serverless on OpenStack with Docker Swarm, Mistral, and StackStorm
 
Nanog75, Network Device Property as Code
Nanog75, Network Device Property as CodeNanog75, Network Device Property as Code
Nanog75, Network Device Property as Code
 
Flintstones or Jetsons? Jump Start Your Virtual Test Lab
Flintstones or Jetsons? Jump Start Your Virtual Test LabFlintstones or Jetsons? Jump Start Your Virtual Test Lab
Flintstones or Jetsons? Jump Start Your Virtual Test Lab
 
iSense Java Summit 2017 - Microservices in action at the Dutch National Police
iSense Java Summit 2017 - Microservices in action at the Dutch National PoliceiSense Java Summit 2017 - Microservices in action at the Dutch National Police
iSense Java Summit 2017 - Microservices in action at the Dutch National Police
 
CERN Data Centre Evolution
CERN Data Centre EvolutionCERN Data Centre Evolution
CERN Data Centre Evolution
 
Outsmarting Merge Edge Cases in Component Based Design
Outsmarting Merge Edge Cases in Component Based DesignOutsmarting Merge Edge Cases in Component Based Design
Outsmarting Merge Edge Cases in Component Based Design
 
Boundary for puppet @ puppet conf2012
Boundary for puppet @ puppet conf2012Boundary for puppet @ puppet conf2012
Boundary for puppet @ puppet conf2012
 
OpenValue meetup October 2017 - Microservices in action at the Dutch National...
OpenValue meetup October 2017 - Microservices in action at the Dutch National...OpenValue meetup October 2017 - Microservices in action at the Dutch National...
OpenValue meetup October 2017 - Microservices in action at the Dutch National...
 
JavaZone 2017 - Microservices in action at the Dutch National Police
JavaZone 2017 - Microservices in action at the Dutch National PoliceJavaZone 2017 - Microservices in action at the Dutch National Police
JavaZone 2017 - Microservices in action at the Dutch National Police
 
Microservices in action at the Dutch National Police
Microservices in action at the Dutch National PoliceMicroservices in action at the Dutch National Police
Microservices in action at the Dutch National Police
 

Similar to HA SOA Application with GlusterFS

Saltconf16 william-cannon b
Saltconf16 william-cannon bSaltconf16 william-cannon b
Saltconf16 william-cannon b
William Cannon
 
DevOps and Microservice
DevOps and MicroserviceDevOps and Microservice
DevOps and Microservice
Inho Kang
 
Building Cloud Native Software
Building Cloud Native SoftwareBuilding Cloud Native Software
Building Cloud Native Software
Paul Fremantle
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
Eduard Tomàs
 
Deploying PHP apps on the cloud
Deploying PHP apps on the cloudDeploying PHP apps on the cloud
Deploying PHP apps on the cloud
Zend by Rogue Wave Software
 
Basic concepts for_clustered_data_ontap_8.3_v1.1-lab_guide
Basic concepts for_clustered_data_ontap_8.3_v1.1-lab_guideBasic concepts for_clustered_data_ontap_8.3_v1.1-lab_guide
Basic concepts for_clustered_data_ontap_8.3_v1.1-lab_guide
Vikas Sharma
 
Technology insights: Decision Science Platform
Technology insights: Decision Science PlatformTechnology insights: Decision Science Platform
Technology insights: Decision Science Platform
Decision Science Community
 
Patterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to KubernetesPatterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to Kubernetes
QAware GmbH
 
Patterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to KubernetesPatterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to Kubernetes
Josef Adersberger
 
Cloud-Native Patterns and the Benefits of MySQL as a Platform Managed Service
Cloud-Native Patterns and the Benefits of MySQL as a Platform Managed ServiceCloud-Native Patterns and the Benefits of MySQL as a Platform Managed Service
Cloud-Native Patterns and the Benefits of MySQL as a Platform Managed Service
VMware Tanzu
 
Infrastructure as Code for Network
Infrastructure as Code for NetworkInfrastructure as Code for Network
Infrastructure as Code for Network
Damien Garros
 
The Architecture of Continuous Innovation - OSCON 2015
The Architecture of Continuous Innovation - OSCON 2015The Architecture of Continuous Innovation - OSCON 2015
The Architecture of Continuous Innovation - OSCON 2015
Chip Childers
 
SUSE - performance analysis-with_ceph
SUSE - performance analysis-with_cephSUSE - performance analysis-with_ceph
SUSE - performance analysis-with_ceph
inwin stack
 
Continuous Deployment
Continuous DeploymentContinuous Deployment
Continuous Deployment
Ron Heft
 
DevOps, Common use cases, Architectures, Best Practices
DevOps, Common use cases, Architectures, Best PracticesDevOps, Common use cases, Architectures, Best Practices
DevOps, Common use cases, Architectures, Best Practices
Shiva Narayanaswamy
 
AWS re:Invent 2016: Moving Mission Critical Apps from One Region to Multi-Reg...
AWS re:Invent 2016: Moving Mission Critical Apps from One Region to Multi-Reg...AWS re:Invent 2016: Moving Mission Critical Apps from One Region to Multi-Reg...
AWS re:Invent 2016: Moving Mission Critical Apps from One Region to Multi-Reg...
Amazon Web Services
 
Neo4j for Cloud Management at Scale
Neo4j for Cloud Management at ScaleNeo4j for Cloud Management at Scale
Neo4j for Cloud Management at Scale
Neo4j
 
50 migrations in 24 hours
50 migrations in 24 hours50 migrations in 24 hours
50 migrations in 24 hours
Jason Dea
 
Tokyo azure meetup #12 service fabric internals
Tokyo azure meetup #12   service fabric internalsTokyo azure meetup #12   service fabric internals
Tokyo azure meetup #12 service fabric internals
Tokyo Azure Meetup
 
Netflix MSA and Pivotal
Netflix MSA and PivotalNetflix MSA and Pivotal
Netflix MSA and Pivotal
VMware Tanzu Korea
 

Similar to HA SOA Application with GlusterFS (20)

Saltconf16 william-cannon b
Saltconf16 william-cannon bSaltconf16 william-cannon b
Saltconf16 william-cannon b
 
DevOps and Microservice
DevOps and MicroserviceDevOps and Microservice
DevOps and Microservice
 
Building Cloud Native Software
Building Cloud Native SoftwareBuilding Cloud Native Software
Building Cloud Native Software
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
 
Deploying PHP apps on the cloud
Deploying PHP apps on the cloudDeploying PHP apps on the cloud
Deploying PHP apps on the cloud
 
Basic concepts for_clustered_data_ontap_8.3_v1.1-lab_guide
Basic concepts for_clustered_data_ontap_8.3_v1.1-lab_guideBasic concepts for_clustered_data_ontap_8.3_v1.1-lab_guide
Basic concepts for_clustered_data_ontap_8.3_v1.1-lab_guide
 
Technology insights: Decision Science Platform
Technology insights: Decision Science PlatformTechnology insights: Decision Science Platform
Technology insights: Decision Science Platform
 
Patterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to KubernetesPatterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to Kubernetes
 
Patterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to KubernetesPatterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to Kubernetes
 
Cloud-Native Patterns and the Benefits of MySQL as a Platform Managed Service
Cloud-Native Patterns and the Benefits of MySQL as a Platform Managed ServiceCloud-Native Patterns and the Benefits of MySQL as a Platform Managed Service
Cloud-Native Patterns and the Benefits of MySQL as a Platform Managed Service
 
Infrastructure as Code for Network
Infrastructure as Code for NetworkInfrastructure as Code for Network
Infrastructure as Code for Network
 
The Architecture of Continuous Innovation - OSCON 2015
The Architecture of Continuous Innovation - OSCON 2015The Architecture of Continuous Innovation - OSCON 2015
The Architecture of Continuous Innovation - OSCON 2015
 
SUSE - performance analysis-with_ceph
SUSE - performance analysis-with_cephSUSE - performance analysis-with_ceph
SUSE - performance analysis-with_ceph
 
Continuous Deployment
Continuous DeploymentContinuous Deployment
Continuous Deployment
 
DevOps, Common use cases, Architectures, Best Practices
DevOps, Common use cases, Architectures, Best PracticesDevOps, Common use cases, Architectures, Best Practices
DevOps, Common use cases, Architectures, Best Practices
 
AWS re:Invent 2016: Moving Mission Critical Apps from One Region to Multi-Reg...
AWS re:Invent 2016: Moving Mission Critical Apps from One Region to Multi-Reg...AWS re:Invent 2016: Moving Mission Critical Apps from One Region to Multi-Reg...
AWS re:Invent 2016: Moving Mission Critical Apps from One Region to Multi-Reg...
 
Neo4j for Cloud Management at Scale
Neo4j for Cloud Management at ScaleNeo4j for Cloud Management at Scale
Neo4j for Cloud Management at Scale
 
50 migrations in 24 hours
50 migrations in 24 hours50 migrations in 24 hours
50 migrations in 24 hours
 
Tokyo azure meetup #12 service fabric internals
Tokyo azure meetup #12   service fabric internalsTokyo azure meetup #12   service fabric internals
Tokyo azure meetup #12 service fabric internals
 
Netflix MSA and Pivotal
Netflix MSA and PivotalNetflix MSA and Pivotal
Netflix MSA and Pivotal
 

Recently uploaded

Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 
Seminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptxSeminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptx
Madan Karki
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
People as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimalaPeople as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimala
riddhimaagrawal986
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...
IJECEIAES
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
Prakhyath Rai
 
Certificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi AhmedCertificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi Ahmed
Mahmoud Morsy
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
artificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptxartificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptx
GauravCar
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
RamonNovais6
 
Welding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdfWelding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdf
AjmalKhan50578
 
Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
gowrishankartb2005
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
VANDANAMOHANGOUDA
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
ElakkiaU
 

Recently uploaded (20)

Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 
Seminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptxSeminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptx
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
People as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimalaPeople as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimala
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
 
Certificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi AhmedCertificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi Ahmed
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
artificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptxartificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptx
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
 
Welding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdfWelding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdf
 
Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
 

HA SOA Application with GlusterFS

  • 1. High Availability SOA APP with GlusterFS Vladimir Vitkov 2017.10.07 / TarnovoConf High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 2.
  • 3. Who am I • Vladimir • Sysadmin / DevOPS • FOSS proponent and addopter • Experimentor • Relatively nice guy for a chat* High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 4. What is SOA High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 5. Let’s put the basis on what SOA is and why it is usefull for the world. Service Oriented Architecture is a way of thinking and coincidentaly separates the application into multiple services (not necessarily micro ones).
  • 6. The monolith High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 7. The monolith approach is usually the first one. It is easier to construct as everything is in the same place. There is no need to account for delays, communication failures and similar. Of course it has it’s drawbacks. The piece of code is huge, hard to maintain and scale. Sometimes ugly, but always hard on supporting.
  • 8. Services High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 9. The services approach usually evolves from the monolith one. The big APPLICATION (yes all capital) gets split at some point into smaller more contained chunks that do few things (initially). The final incarnation is one service does one and only one thing. The benefits are easier maintenance, scaling and supporting the code. Usually this is done with a total rewrite but sometimes it is done with a state of mind as refactoring code.
  • 10. SOA High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 11. SOA is mostly a pattern in software design in which the components of the system are separated from one another and communicate via a protocol (usually network one). The principles are neutral and independent of vendor, product or technology. Most often this is achieved with the help of the protocols. Most common ones are SOAP and REST. As such it is in fact microservices architecture but on a conceptual level. Currently large-scale applications are based on the SOA principles and microservices model.
  • 12. The Application High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 13. Well one of the services only
  • 14. What is the system • Large scale Ecommerce product • Quite a few services that interact • Lots of users • Lots of traffic High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 15. I am running a fairly complex and large application, we have quite some services, lots of interactions, lots of traffic and users and this needs to always be available and run.
  • 16. What is the service • Brand New service • Replacing custom hacks • To be in service in 3 weeks • After several total redesigns High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 17. The service i am going to tell you today was brand new. It was born in 3 weeks. Main purpose of it was to replace some custom hacks in our processess and more fluidly control access to resources. It has been totally redesigned several times. It has the core of it changed at least 3 times. And finally introduced without anyone noticing (except directly involved parties).
  • 18. What is the service (2) • Speaks REST • Stores some local data • Transforms requests • Pulls data from 3rd party service • Is stateless High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 19. This service speaks rest, stores some configuration in local storage. When someone asks it the right question, respoonds after pulling some 3rd party data, applying transforms and generally humming along. The best thing: it was stateless.
  • 20. Wha the service was not • Highly available • Redundant • Without central data store • But needs to be • Does not know of changes High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 21. Unfortunately not everything is hunky-dory in the SOA land. The service was not highly available, not redundant, had no idea of central storage and generally was not ready for prime time. But it needed to be all this things. So OPS had to rescue it and give it wings.
  • 22. The Solution High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 23. Leave the devs to develop and ops to operate. But join them for a synergy.
  • 24. Highly Available • Bring up more instances • Spread them around • Load balance them • Monitor them for health • Recover/replace them High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 25. To make the service more highly available do the sane thing. The service is stateless so apply the regular tricks. Add more instances/server. Put them in a load balancer (either DNS or some other like HAProxy). Of course do not forget to monitor the stuff. Use your best judgement. Monitoring is moot if there are no procedures to detect, recover or replace failed instances. Doing this in an automated fashion helps a lot.
  • 26. Redundant • High Availability • Monitoring • Recover/replace High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 27. Keep that service stateless and Highly available. Redundancy is necessary for high availability anyways.
  • 28. No central data store • Core issue • Create GlusterFS cluster for replica • Reconfigure app to use clustered data store • Monitor it • Recover/replace High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 29. The missing central data store become the core issue that prompted developing this approach. The application was aware only of local storage and porting it to support remote/central storage would have missed deadlines. So ops had to rescue the situation. The solution we thought of included creating a replicated GlusterFS cluster. It took care to synchronise and replicate the needed local data to all nodes. After that it was just necessary to reconfigure the application to use this local (but in reality replicated) data storage. As a recurring theme do not forget the monitoring. Monitor all components available and monitor them well. Again do not forget to automate recovery in case of troubles with the nodes.
  • 30. Become aware of changes • App does not know about new data • Build update mechanism • Inotify + curl • NFS is not a friend • FUSE is not a friend too High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 31. Another problem with this approach was that the application is not monitoring local data store for changes. To solve this add a mechanism to inform it that the data store has changed and should be reread/reconsidered. Devs built a mechanism to do this and exposed it. The detect the changes on the filesystem level and trigger this mechanism. Inotify and curl fit nicelu into this. But unfortunately NFS and FUSE do not support inotify events. FUSE may support them but requires special codding in the FS to have it.
  • 32. How to do it High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 33. Show how it is built
  • 34. Components • GlusterFS • nfs-common • inotify-hookable • nice utils around High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 35. First step is to install everything necessary. This includes the GlusterFS itself, nfs client, inotify monitoring tool and any utilities you may need
  • 36. Create GlusterFS cluster • Start gluster daemon • Assemble cluster gluster peer probe remote.peer.host • /var/lib/glusterd/peers/* High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 37. Next step is to build the cluster. Building the cluster is basically probing the peers. Do the probing from one node only. No need to do it from the other nodes. Make sure your DNS works properly and can resolve the names. If you don’t want to mix names/ip addressess you may have to manually edit gluster peers to use names.
  • 38. Create volume • Create replicated volume gluster volume create vol1 replica 2 transport tcp peer1:/vol peer2:/vol High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 39. Creating the volume is a simple command. This will initialize the so called bricks that form the GlusterFS fabric. As we are aiming for redundancy and replication we create the volume with replica count 2 and add only 2 bricks. If bricks are created on the root partition you will need to use "force"option. Take some time to review the GlusterFS tunning options (Resources slide).
  • 40. Reconfigure • mount mount -t nfs localhost:/vol1 /app • Start the app High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 41. We chose to use local nfs mount to enable functioning of the service in a split brain/down situation. The data is replicated everywhere so it is not important from where we serve. GlusterFS has a reconciliation mechanism that can handle split brain situations. Of course chosing NFS (FUSE also won’t help you) leads us to the next problem. No inotify events
  • 42. Update info • Data added on other node inotify-hookable --watch-directories /vol --on-modify-command curl High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 43. It is important to update the applications view of the data store. We do this by detecting changes (to the local brick) and triggering the update cycle with curl. monitoring the local brick is necessary due to inotify events not being emitted for nfs.
  • 44. DEMO Time High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 45. In this demo we’ll show you the final result. We’ll play with disabling the update mechanism, so we can demonstrate that content is properly replicated but the application is not aware of it.
  • 46. Closing High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 47.
  • 48. Q/A? High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 49. Contact • Demo: http://is.gd/gluster_demo • Slides: https://is.gd/ha_soa_tarnovoconf • mail: vvitkov@linux-bg.org • GPG: A162 1211 8ACB 4CC5 High Availability SOA APP with GlusterFS Vladimir Vitkov
  • 50. Resources • http://is.gd/gluster_tune • http://is.gd/gluster_quickstart • http://flask.pocoo.org/ High Availability SOA APP with GlusterFS Vladimir Vitkov