SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Downloaden Sie, um offline zu lesen
FIWARE Data Management in
High Availability
Federico M. Facca (Martel Innovate)
Head of Martel Lab, FIWARE TSC Member
federico.facca@martel-innovate.com
@chicco785
1
Outline
§ Basic High Availability Principles
§ How to apply HA principles to FIWARE?
§ On going and future activities in FIWARE
Basic High Availability Principles
2
3
What is High Availability?
High availability is a characteristic of a
system, which aims to ensure an agreed
level of operational performance, usually
uptime, for a higher than normal period
[https://en.wikipedia.org/wiki/High_availability]
Why do I need high availability?
4
Keep your
customers happy
5
Eliminate single points of failure
6
Ensure reliable crossover
7
Detect failures as they occur
Cool I want to have my service in High
Availability!
8
Cool I want to have my service in High
Availability!
9
To	define	an	HA	architecture	for	your	service,
you	need	to	understand	how	you	service	works
10
Stateless vs Stateful services
§ Stateless services
§ The output of the service depends only on the input
§ Easy to scale and distribute
§ Stateful
§ The output of the service depends on the input and on
a set of information stored by the service itself
§ Not so easy to scale and distribute (maintaining a
consistent state)
11
Stateless vs Stateful services
§ Stateless services
§ The output of the service depends only on the input
§ Easy to scale and distribute
§ Stateful
§ The output of the service depends on the input and on
a set of information stored by the service itself
§ Not so easy to scale and distribute (maintaining a
consistent state)
If	your	services	is	stateless,	things	are	very	easy
12
CAP Theorem
§ The CAP theorem states that it is impossible for a
distributed computer system to simultaneously provide all
three of the following guarantees:
§ Consistency: Every read receives the most recent write or an
error
§ Availability: Every request receives a response, without
guarantee that it contains the most recent version of the
information
§ Partition tolerance: The system continues to operate despite an
arbitrary number of messages being dropped by the network
between nodes
§ I.e. when you implement HA in a stateful service, you can
choose of being CA, AP, CP. In general you strive to AP and
eventually consistent.
13
CAP Theorem
§ The CAP theorem states that it is impossible for a
distributed computer system to simultaneously provide all
three of the following guarantees:
§ Consistency: Every read receives the most recent write or an
error
§ Availability: Every request receives a response, without
guarantee that it contains the most recent version of the
information
§ Partition tolerance: The system continues to operate despite an
arbitrary number of messages being dropped by the network
between nodes
§ I.e. when you implement HA in a stateful service, you can
choose of being CA, AP, CP. In general you strive to AP and
eventually consistent.
When	your	services	is	stateful,	you	need	to	decide	
what	you	are	ready	to	give	up	(or	eventually	the	
specific	database	you	use	is	already	deciding	for	you)
14
How HA relates to Cloud architectures?
§ You do not need Cloud solutions to implement
high availability but…
§ Cloud solutions simplifies the implementation of
High Available architectures
§ High Available architectures are a prerequisite to
implement many scalable services
15
Queue centric workflow patterns
16
Scalability patterns
How to apply HA principles to FIWARE?
17
18
Context Broker
§ Context Broker is perhaps the most
used GE J
§ It includes to components:
§ The API
§ The Backend
§ The API is HTTP based
§ The Backend in based on MongoDB
§ How to make it high available?
§ An easy crossover mechanism for
HTTP APIs are Load Balancers
§ MongoDB has is proprietary HA
mechanism (replica set)
Context	Broker
MongoDB
19
Context Broker
Context	Broker
MongoDB
20
Context Broker
Context	Broker
MongoDB
Context	Broker
MongoDB
Context	Broker
MongoDB
HA	Proxy HA	Proxy HA	Proxy
MongoDB	replica	set
Virtual	IP
21
Context Broker
Context	Broker
MongoDB
Context	Broker
MongoDB
Context	Broker
MongoDB
HA	Proxy HA	Proxy HA	Proxy
MongoDB	replica	set
Virtual	IP
1. Provides	the	reliable	cross	over	(i.e.	transparent	access	to	different	instances)
2. Provides	the	transparent	detection	failure
3. Relies	on	virtual	IP	mechanism
22
Context Broker
Context	Broker
MongoDB
Context	Broker
MongoDB
Context	Broker
MongoDB
HA	Proxy HA	Proxy HA	Proxy
MongoDB	replica	set
Virtual	IP
1. Provides	the	reliable	cross	over	(i.e.	transparent	access	to	different	instances)
2. Provides	the	transparent	detection	failure
3. Relies	on	virtual	IP	mechanism
1. N-instances	of	context	broker,	removing	single	point	of	failure
2. You	can	have	M	HA	Proxy	and	O	Mongos	DB	(this	are	not	vertical	silos)
23
Context Broker
Context	Broker
MongoDB
Context	Broker
MongoDB
Context	Broker
MongoDB
HA	Proxy HA	Proxy HA	Proxy
MongoDB	replica	set
Virtual	IP
1. Provide	high	available	and	partion tolerant	distributed	data
2. Eventually	consistent
3. MongoDB	HA	solutions	use	quora mechanism	for	evaluate	consistency,	so	O	as	to	
be	an	odd	number	(max	actually	is	7)
1. Provides	the	reliable	cross	over	(i.e.	transparent	access	to	different	instances)
2. Provides	the	transparent	detection	failure
3. Relies	on	virtual	IP	mechanism
1. N-instances	of	context	broker,	removing	single	point	of	failure
2. You	can	have	M	HA	Proxy	and	O	Mongos	DB	(this	are	not	vertical	silos)
24
Example configuration
§ Load Balancer 1: lb1.example.com, IP address: 192.168.0.100
§ Load Balancer 2: lb2.example.com, IP address: 192.168.0.101
§ Context Broker 1: ctx1.example.com, IP address: 192.168.0.102
§ Context Broker 2: ctx2.example.com, IP address: 192.168.0.103
§ Mongo DB 1: mdb1.example.com, IP address: 192.168.0.104
§ Mongo DB 2: mdb2.example.com, IP address: 192.168.0.105
§ Mongo DB 3: mdb3.example.com, IP address: 192.168.0.106
§ Shared IP=192.168.0.99
25
HA Proxy Installation (LB1/LB2)
§ Install HA Proxy (ubuntu)
§ sudo apt-get install haproxy
§ Configure HA Proxy to start at boot time
§ sudo nano /etc/default/haproxy
§ change the value of ENABLED to “1”
§ Configure HA Proxy
§ sudo nano /etc/haproxy/haproxy.cfg
...
defaults
log global
mode tcp
option tcplog
...
frontend www
bind
load_balancer_anchor_IP:1026
default_backend ctx_pool
backend ctx_pool
balance roundrobin
mode tcp
server ctx1 ctx1_private_IP:1026
check
server ctx2 ctx2_private_IP:1026
check
26
Install keepalived active/passive (LB1/LB2)
§ Install keepalived (ubuntu)
§ sudo apt-get install keepalived
§ Ensure HA Proxy will be able to bind to
non local addresses
§ sudo nano /etc/sysctl.conf
§ change the value of
net.ipv4.ip_nonlocal_bind to “1”
§ sudo sysctl -p
§ Configure keepalived
§ sudo nano
/etc/keepalived/keepalived.conf
§ For LB2, change state to BACKUP
and priority to 100
global_defs {
…
}
# Check if haproxy is still working
vrrp_script chk_haproxy {
script "killall -0 haproxy"
interval 2
weight 2
}
# Configuation for the virtual
Interface
vrrp_instance VI_1 {
interface eth0
state MASTER
priority 101
virtual_router_id 51
virtual_ipaddress {
192.168.0.99
}
track_script {
chk_haproxy
}
}
27
Install keepalived active/passive (LB1/LB2)
§ Install keepalived (ubuntu)
§ sudo apt-get install keepalived
§ Ensure HA Proxy will be able to bind to
non local addresses
§ sudo nano /etc/sysctl.conf
§ change the value of
net.ipv4.ip_nonlocal_bind to “1”
§ sudo sysctl -p
§ Configure keepalived
§ sudo nano
/etc/keepalived/keepalived.conf
§ For LB2, change state to BACKUP
and priority to 100
global_defs {
…
}
# Check if haproxy is still working
vrrp_script chk_haproxy {
script "killall -0 haproxy"
interval 2
weight 2
}
# Configuation for the virtual
Interface
vrrp_instance VI_1 {
interface eth0
state MASTER
priority 101
virtual_router_id 51
virtual_ipaddress {
192.168.0.99
}
track_script {
chk_haproxy
}
}
Active/Passive	is	not	the	best	solution…	you	can	also	run	an	Active/Active	load	
balancer.	That	is	a	bit	more	complex	though.
Keepalived	can	be	replaced	with	more	complex	monitor	and	management	solutions
like	corosynch/pacemaker	combination
28
Install MongoDB Replica Set (MDB1, MDB2,
MDB3)
§ Install MongoDB (ubuntu xenial)
§ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv
EA312927
§ echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4
multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
§ sudo apt-get update
§ sudo apt-get install -y mongodb-org
§ Start mongodb on each node
§ mongod --replSet ”orion_rs"
§ Access a mongodb instance and configure the replicaset
§ mongo
§ In mongo console type:
§ rs.initiate()
§ rs.add(" mdb2.example.com ")
§ rs.add(" mdb3.example.com ")
§ rs.conf()
§ rs.status()
29
Install ContextBroker (CTX1, CTX2)
§ Install Context Broker (centos/rh)
§ Create a file fiware.repo in
/etc/yum.repos.d/ with the following
lines:
§ [fiware]
§ name=Fiware Repository
§ baseurl=http://repositories.lab.fiware.or
g/repo/rpm/$releasever
§ gpgcheck=0
§ enabled=1
§ yum install contextBroker
§ Configure the Context Broker
§ sudo nano /etc/sysconfig/contextBroker
§ Start the Context Broker
§ /etc/init.d/contextBroker start
…
BROKER_DATABASE_HOST=mdb1.example.co
m,mdb2.example.com,mdb3.example.com
BROKER_DATABASE_NAME=orion
# Replica set configuration. Note
that if you set this parameter, the
BROKER_DATBASE_HOST is interpreted
as the list of host (or host:port)
separated by commas to use as##
replica set seed list (single
element lists are also allowed). If
BROKER_DATABASE_RPL_SET parameter is
unset, Orion CB assumes that the
BROKER_DATABASE_HOST is an stand-
alone mongod instance
BROKER_DATABASE_RPLSET=orion_rs
You made it!
30
31
Additional considerations
§ Scale up
§ Scaling up context broker processing capacity requires only to add a
new entry in the HA Proxy and deploy a new instance of context broker
§ Hardware failures
§ If all your service instances (context broker, ha proxy, mongodb) run on
the same physical server you achieved only HA within respect software
failures
§ Shared configuration
§ For many of the services large part of the configuration is shared, plans
for easy ways to keep it in synch (e.g. NFS, github)
32
What about other GEs?
§ STH and IoT Agent have similar architecture to the Context Broker
§ You can adopt a similar strategy
§ Cygnus is based on Apache FLUME
§ It can be configured HA with Active/Passive modality using a load
balancer and at least 2 Cygnus agents
§ Some are HA by design
§ COSMOS is based on Hadoop and Hadoop is basically an HA cluster
On going and future activities in FIWARE
33
Did it look complex?
34
Data
models
Enablers
Architecture
Patterns
App
App GE
GE
GE App
City
Star
tup
App App
City
Star
tup
Smart Security
• Common architecture patterns: e.g.
scalability pattern
• Common generic enablers: e.g. orion
context-broker
• Common data models: e.g. geo-location
• Specific architecture patterns: e.g.
secured data access pattern
• Specific and customised generic enablers:
e.g. security risk detection filters for
kurento media server
• Specific data models: e.g. security’s
events
Smart
Security
Application
“recipe”
36
Smart Security
• Common architecture patterns: e.g.
scalability pattern
• Common generic enablers: e.g. orion
context-broker
• Common data models: e.g. geo-location
• Specific architecture patterns: e.g.
secured data access pattern
• Specific and customised generic enablers:
e.g. security risk detection filters for
kurento media server
• Specific data models: e.g. security’s
events
Smart
Security
Application
“recipe”
37
1. Analyse	HA	architectures	for	the	different	Data	and	IoT Management	enablers
2. Creating	Docker	compose	recipes	to	allow	easy	deployment	of	HA	enablers
3. Making	them	available	in	FIWARE	Lab	to	experimenters
Do you have questions?
Do you want to contribute?
38
Contact Us
www.martel-innovate.com
Federico M. Facca
Head of Martel Lab
federico.facca@martel-innovate.com
Dorfstrasse 73 – 3073
Gümligen (Switzerland)
0041 78 807 58 38
Thank you!
http://fiware.org
Follow @FIWARE on Twitter

Weitere ähnliche Inhalte

Was ist angesagt?

Unix Automation using centralized configuration management tool
Unix Automation using centralized configuration management toolUnix Automation using centralized configuration management tool
Unix Automation using centralized configuration management tool
Torrid Networks Private Limited
 

Was ist angesagt? (20)

[발표자료] 오픈소스 Pacemaker 활용한 zabbix 이중화 방안(w/ Zabbix Korea Community)
[발표자료] 오픈소스 Pacemaker 활용한 zabbix 이중화 방안(w/ Zabbix Korea Community) [발표자료] 오픈소스 Pacemaker 활용한 zabbix 이중화 방안(w/ Zabbix Korea Community)
[발표자료] 오픈소스 Pacemaker 활용한 zabbix 이중화 방안(w/ Zabbix Korea Community)
 
Openstack Networking Internals - first part
Openstack Networking Internals - first partOpenstack Networking Internals - first part
Openstack Networking Internals - first part
 
Demystifying openvswitch
Demystifying openvswitchDemystifying openvswitch
Demystifying openvswitch
 
V sphere vds_poc_primer
V sphere vds_poc_primerV sphere vds_poc_primer
V sphere vds_poc_primer
 
IETF 100: Surviving IPv6 fragmentation
IETF 100: Surviving IPv6 fragmentationIETF 100: Surviving IPv6 fragmentation
IETF 100: Surviving IPv6 fragmentation
 
2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy
2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy
2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy
 
Open Stack compute-service-nova
Open Stack compute-service-novaOpen Stack compute-service-nova
Open Stack compute-service-nova
 
How Splunk Is Using Pulsar IO
How Splunk Is Using Pulsar IOHow Splunk Is Using Pulsar IO
How Splunk Is Using Pulsar IO
 
The value of reactive
The value of reactiveThe value of reactive
The value of reactive
 
Hacking on OpenStack\'s Nova source code
Hacking on OpenStack\'s Nova source codeHacking on OpenStack\'s Nova source code
Hacking on OpenStack\'s Nova source code
 
GopherFest 2017 - Adding Context to NATS
GopherFest 2017 -  Adding Context to NATSGopherFest 2017 -  Adding Context to NATS
GopherFest 2017 - Adding Context to NATS
 
EAP TLS, the Rolls-Royce of extensible authentication protocol (EAP) methods ...
EAP TLS, the Rolls-Royce of extensible authentication protocol (EAP) methods ...EAP TLS, the Rolls-Royce of extensible authentication protocol (EAP) methods ...
EAP TLS, the Rolls-Royce of extensible authentication protocol (EAP) methods ...
 
Anatomy of neutron from the eagle eyes of troubelshoorters
Anatomy of neutron from the eagle eyes of troubelshoortersAnatomy of neutron from the eagle eyes of troubelshoorters
Anatomy of neutron from the eagle eyes of troubelshoorters
 
[OpenStack Days Korea 2016] Track3 - OpenStack on 64-bit ARM with X-Gene
[OpenStack Days Korea 2016] Track3 - OpenStack on 64-bit ARM with X-Gene[OpenStack Days Korea 2016] Track3 - OpenStack on 64-bit ARM with X-Gene
[OpenStack Days Korea 2016] Track3 - OpenStack on 64-bit ARM with X-Gene
 
Distributed Lock Manager
Distributed Lock ManagerDistributed Lock Manager
Distributed Lock Manager
 
Designing for Distributed Systems with Reactor and Reactive Streams
Designing for Distributed Systems with Reactor and Reactive StreamsDesigning for Distributed Systems with Reactor and Reactive Streams
Designing for Distributed Systems with Reactor and Reactive Streams
 
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
 
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
 
[OpenStack 하반기 스터디] HA using DVR
[OpenStack 하반기 스터디] HA using DVR[OpenStack 하반기 스터디] HA using DVR
[OpenStack 하반기 스터디] HA using DVR
 
Unix Automation using centralized configuration management tool
Unix Automation using centralized configuration management toolUnix Automation using centralized configuration management tool
Unix Automation using centralized configuration management tool
 

Andere mochten auch

Andere mochten auch (8)

FIWARE: the best is yet to come
FIWARE: the best is yet to comeFIWARE: the best is yet to come
FIWARE: the best is yet to come
 
Schema.fiware.org: FIWARE Harmonized Data Models
Schema.fiware.org: FIWARE Harmonized Data ModelsSchema.fiware.org: FIWARE Harmonized Data Models
Schema.fiware.org: FIWARE Harmonized Data Models
 
FIWARE Mundus Ecosystem Support Committee: The Road Ahead
FIWARE Mundus Ecosystem Support Committee: The Road AheadFIWARE Mundus Ecosystem Support Committee: The Road Ahead
FIWARE Mundus Ecosystem Support Committee: The Road Ahead
 
FIWARE for Smart Cities: City of Ancona - Parking Advisor
FIWARE for Smart Cities: City of Ancona - Parking AdvisorFIWARE for Smart Cities: City of Ancona - Parking Advisor
FIWARE for Smart Cities: City of Ancona - Parking Advisor
 
The FIWARE Marketplace
The FIWARE MarketplaceThe FIWARE Marketplace
The FIWARE Marketplace
 
The 'Serverless' Paradigm, OpenWhisk and FIWARE
The 'Serverless' Paradigm, OpenWhisk and FIWAREThe 'Serverless' Paradigm, OpenWhisk and FIWARE
The 'Serverless' Paradigm, OpenWhisk and FIWARE
 
Welcome to the 1st FIWARE Summit
Welcome to the 1st FIWARE SummitWelcome to the 1st FIWARE Summit
Welcome to the 1st FIWARE Summit
 
MongoDB World 2016: Scaling MongoDB with Docker and cGroups
MongoDB World 2016: Scaling MongoDB with Docker and cGroupsMongoDB World 2016: Scaling MongoDB with Docker and cGroups
MongoDB World 2016: Scaling MongoDB with Docker and cGroups
 

Ähnlich wie FIWARE Data Management in High Availability

Installation of pfSense on Soekris 6501
Installation of pfSense on Soekris 6501Installation of pfSense on Soekris 6501
Installation of pfSense on Soekris 6501
robertguerra
 
Distribute Key Value Store
Distribute Key Value StoreDistribute Key Value Store
Distribute Key Value Store
Santal Li
 
Distribute key value_store
Distribute key value_storeDistribute key value_store
Distribute key value_store
drewz lin
 

Ähnlich wie FIWARE Data Management in High Availability (20)

Docker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsDocker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platforms
 
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE PlatformsFIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
 
Resilience Testing
Resilience Testing Resilience Testing
Resilience Testing
 
Installation of pfSense on Soekris 6501
Installation of pfSense on Soekris 6501Installation of pfSense on Soekris 6501
Installation of pfSense on Soekris 6501
 
Installation of pfSense on Soekris 6501
Installation of pfSense on Soekris 6501Installation of pfSense on Soekris 6501
Installation of pfSense on Soekris 6501
 
Distribute Key Value Store
Distribute Key Value StoreDistribute Key Value Store
Distribute Key Value Store
 
Distribute key value_store
Distribute key value_storeDistribute key value_store
Distribute key value_store
 
Everything you always wanted to know about Distributed databases, at devoxx l...
Everything you always wanted to know about Distributed databases, at devoxx l...Everything you always wanted to know about Distributed databases, at devoxx l...
Everything you always wanted to know about Distributed databases, at devoxx l...
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a Microservice
 
Webinar - Minimise your security risk with Hybrid Cloud and OVH vRack
Webinar - Minimise your security risk with Hybrid Cloud and OVH vRackWebinar - Minimise your security risk with Hybrid Cloud and OVH vRack
Webinar - Minimise your security risk with Hybrid Cloud and OVH vRack
 
Planning to Fail #phpne13
Planning to Fail #phpne13Planning to Fail #phpne13
Planning to Fail #phpne13
 
Infinit's Next Generation Key-value Store - Julien Quintard and Quentin Hocqu...
Infinit's Next Generation Key-value Store - Julien Quintard and Quentin Hocqu...Infinit's Next Generation Key-value Store - Julien Quintard and Quentin Hocqu...
Infinit's Next Generation Key-value Store - Julien Quintard and Quentin Hocqu...
 
High availability virtualization with proxmox
High availability virtualization with proxmoxHigh availability virtualization with proxmox
High availability virtualization with proxmox
 
2 fhrp,hsrp,vrrp,gblp,ntp,nat glbp
2 fhrp,hsrp,vrrp,gblp,ntp,nat   glbp2 fhrp,hsrp,vrrp,gblp,ntp,nat   glbp
2 fhrp,hsrp,vrrp,gblp,ntp,nat glbp
 
HA in OpenStack service - meetup #9
HA in OpenStack service - meetup #9HA in OpenStack service - meetup #9
HA in OpenStack service - meetup #9
 
Streaming Processing with a Distributed Commit Log
Streaming Processing with a Distributed Commit LogStreaming Processing with a Distributed Commit Log
Streaming Processing with a Distributed Commit Log
 
prodops.io k8s presentation
prodops.io k8s presentationprodops.io k8s presentation
prodops.io k8s presentation
 
Introduction to LAVA Workload Scheduler
Introduction to LAVA Workload SchedulerIntroduction to LAVA Workload Scheduler
Introduction to LAVA Workload Scheduler
 
Kamailio with Docker and Kubernetes
Kamailio with Docker and KubernetesKamailio with Docker and Kubernetes
Kamailio with Docker and Kubernetes
 
Bluemix paas 기반 saas 개발 사례
Bluemix paas 기반 saas 개발 사례Bluemix paas 기반 saas 개발 사례
Bluemix paas 기반 saas 개발 사례
 

Mehr von Federico Michele Facca

FI Business: Value proposition for cities, access to data and ICT infrastruct...
FI Business: Value proposition for cities, access to data and ICT infrastruct...FI Business: Value proposition for cities, access to data and ICT infrastruct...
FI Business: Value proposition for cities, access to data and ICT infrastruct...
Federico Michele Facca
 

Mehr von Federico Michele Facca (16)

FIWARE: Open APIs for Open Cities
FIWARE: Open APIs for Open CitiesFIWARE: Open APIs for Open Cities
FIWARE: Open APIs for Open Cities
 
FIWARE Primer - Learn FIWARE in 60 Minutes
FIWARE Primer - Learn FIWARE in 60 MinutesFIWARE Primer - Learn FIWARE in 60 Minutes
FIWARE Primer - Learn FIWARE in 60 Minutes
 
FIWARE Meetup Trento: Latest News
FIWARE Meetup Trento: Latest NewsFIWARE Meetup Trento: Latest News
FIWARE Meetup Trento: Latest News
 
Join FIWARE Lab
Join FIWARE LabJoin FIWARE Lab
Join FIWARE Lab
 
Fiware Overiew - Trento FI-PPP info day
Fiware Overiew - Trento FI-PPP info dayFiware Overiew - Trento FI-PPP info day
Fiware Overiew - Trento FI-PPP info day
 
CommunityCloud4PA
CommunityCloud4PACommunityCloud4PA
CommunityCloud4PA
 
Fi ware, fi-lab e il trentino
Fi ware, fi-lab e il trentinoFi ware, fi-lab e il trentino
Fi ware, fi-lab e il trentino
 
Trento IoT Day: Build IoT apps with FI-WARE, FI-Lab and FI-Ops
Trento IoT Day: Build IoT apps with FI-WARE, FI-Lab and FI-OpsTrento IoT Day: Build IoT apps with FI-WARE, FI-Lab and FI-Ops
Trento IoT Day: Build IoT apps with FI-WARE, FI-Lab and FI-Ops
 
FI Business: Value proposition for cities, access to data and ICT infrastruct...
FI Business: Value proposition for cities, access to data and ICT infrastruct...FI Business: Value proposition for cities, access to data and ICT infrastruct...
FI Business: Value proposition for cities, access to data and ICT infrastruct...
 
XIFI: how we did federate different FI infrastructures
XIFI: how we did federate different FI infrastructuresXIFI: how we did federate different FI infrastructures
XIFI: how we did federate different FI infrastructures
 
Xipi Overview
Xipi OverviewXipi Overview
Xipi Overview
 
Mobicap
MobicapMobicap
Mobicap
 
Infinity Wire Frame
Infinity Wire FrameInfinity Wire Frame
Infinity Wire Frame
 
Infinity's Overview
Infinity's OverviewInfinity's Overview
Infinity's Overview
 
Shape Project Overview
Shape Project OverviewShape Project Overview
Shape Project Overview
 
Silicon Valley Semantic Web Meet Up
Silicon Valley Semantic Web Meet UpSilicon Valley Semantic Web Meet Up
Silicon Valley Semantic Web Meet Up
 

Kürzlich hochgeladen

valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
imonikaupta
 

Kürzlich hochgeladen (20)

valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceReal Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
Dubai Call Girls Milky O525547819 Call Girls Dubai Soft Dating
Dubai Call Girls Milky O525547819 Call Girls Dubai Soft DatingDubai Call Girls Milky O525547819 Call Girls Dubai Soft Dating
Dubai Call Girls Milky O525547819 Call Girls Dubai Soft Dating
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
 

FIWARE Data Management in High Availability

  • 1. FIWARE Data Management in High Availability Federico M. Facca (Martel Innovate) Head of Martel Lab, FIWARE TSC Member federico.facca@martel-innovate.com @chicco785
  • 2. 1 Outline § Basic High Availability Principles § How to apply HA principles to FIWARE? § On going and future activities in FIWARE
  • 3. Basic High Availability Principles 2
  • 4. 3 What is High Availability? High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime, for a higher than normal period [https://en.wikipedia.org/wiki/High_availability]
  • 5. Why do I need high availability? 4 Keep your customers happy
  • 8. 7 Detect failures as they occur
  • 9. Cool I want to have my service in High Availability! 8
  • 10. Cool I want to have my service in High Availability! 9 To define an HA architecture for your service, you need to understand how you service works
  • 11. 10 Stateless vs Stateful services § Stateless services § The output of the service depends only on the input § Easy to scale and distribute § Stateful § The output of the service depends on the input and on a set of information stored by the service itself § Not so easy to scale and distribute (maintaining a consistent state)
  • 12. 11 Stateless vs Stateful services § Stateless services § The output of the service depends only on the input § Easy to scale and distribute § Stateful § The output of the service depends on the input and on a set of information stored by the service itself § Not so easy to scale and distribute (maintaining a consistent state) If your services is stateless, things are very easy
  • 13. 12 CAP Theorem § The CAP theorem states that it is impossible for a distributed computer system to simultaneously provide all three of the following guarantees: § Consistency: Every read receives the most recent write or an error § Availability: Every request receives a response, without guarantee that it contains the most recent version of the information § Partition tolerance: The system continues to operate despite an arbitrary number of messages being dropped by the network between nodes § I.e. when you implement HA in a stateful service, you can choose of being CA, AP, CP. In general you strive to AP and eventually consistent.
  • 14. 13 CAP Theorem § The CAP theorem states that it is impossible for a distributed computer system to simultaneously provide all three of the following guarantees: § Consistency: Every read receives the most recent write or an error § Availability: Every request receives a response, without guarantee that it contains the most recent version of the information § Partition tolerance: The system continues to operate despite an arbitrary number of messages being dropped by the network between nodes § I.e. when you implement HA in a stateful service, you can choose of being CA, AP, CP. In general you strive to AP and eventually consistent. When your services is stateful, you need to decide what you are ready to give up (or eventually the specific database you use is already deciding for you)
  • 15. 14 How HA relates to Cloud architectures? § You do not need Cloud solutions to implement high availability but… § Cloud solutions simplifies the implementation of High Available architectures § High Available architectures are a prerequisite to implement many scalable services
  • 18. How to apply HA principles to FIWARE? 17
  • 19. 18 Context Broker § Context Broker is perhaps the most used GE J § It includes to components: § The API § The Backend § The API is HTTP based § The Backend in based on MongoDB § How to make it high available? § An easy crossover mechanism for HTTP APIs are Load Balancers § MongoDB has is proprietary HA mechanism (replica set) Context Broker MongoDB
  • 22. 21 Context Broker Context Broker MongoDB Context Broker MongoDB Context Broker MongoDB HA Proxy HA Proxy HA Proxy MongoDB replica set Virtual IP 1. Provides the reliable cross over (i.e. transparent access to different instances) 2. Provides the transparent detection failure 3. Relies on virtual IP mechanism
  • 23. 22 Context Broker Context Broker MongoDB Context Broker MongoDB Context Broker MongoDB HA Proxy HA Proxy HA Proxy MongoDB replica set Virtual IP 1. Provides the reliable cross over (i.e. transparent access to different instances) 2. Provides the transparent detection failure 3. Relies on virtual IP mechanism 1. N-instances of context broker, removing single point of failure 2. You can have M HA Proxy and O Mongos DB (this are not vertical silos)
  • 24. 23 Context Broker Context Broker MongoDB Context Broker MongoDB Context Broker MongoDB HA Proxy HA Proxy HA Proxy MongoDB replica set Virtual IP 1. Provide high available and partion tolerant distributed data 2. Eventually consistent 3. MongoDB HA solutions use quora mechanism for evaluate consistency, so O as to be an odd number (max actually is 7) 1. Provides the reliable cross over (i.e. transparent access to different instances) 2. Provides the transparent detection failure 3. Relies on virtual IP mechanism 1. N-instances of context broker, removing single point of failure 2. You can have M HA Proxy and O Mongos DB (this are not vertical silos)
  • 25. 24 Example configuration § Load Balancer 1: lb1.example.com, IP address: 192.168.0.100 § Load Balancer 2: lb2.example.com, IP address: 192.168.0.101 § Context Broker 1: ctx1.example.com, IP address: 192.168.0.102 § Context Broker 2: ctx2.example.com, IP address: 192.168.0.103 § Mongo DB 1: mdb1.example.com, IP address: 192.168.0.104 § Mongo DB 2: mdb2.example.com, IP address: 192.168.0.105 § Mongo DB 3: mdb3.example.com, IP address: 192.168.0.106 § Shared IP=192.168.0.99
  • 26. 25 HA Proxy Installation (LB1/LB2) § Install HA Proxy (ubuntu) § sudo apt-get install haproxy § Configure HA Proxy to start at boot time § sudo nano /etc/default/haproxy § change the value of ENABLED to “1” § Configure HA Proxy § sudo nano /etc/haproxy/haproxy.cfg ... defaults log global mode tcp option tcplog ... frontend www bind load_balancer_anchor_IP:1026 default_backend ctx_pool backend ctx_pool balance roundrobin mode tcp server ctx1 ctx1_private_IP:1026 check server ctx2 ctx2_private_IP:1026 check
  • 27. 26 Install keepalived active/passive (LB1/LB2) § Install keepalived (ubuntu) § sudo apt-get install keepalived § Ensure HA Proxy will be able to bind to non local addresses § sudo nano /etc/sysctl.conf § change the value of net.ipv4.ip_nonlocal_bind to “1” § sudo sysctl -p § Configure keepalived § sudo nano /etc/keepalived/keepalived.conf § For LB2, change state to BACKUP and priority to 100 global_defs { … } # Check if haproxy is still working vrrp_script chk_haproxy { script "killall -0 haproxy" interval 2 weight 2 } # Configuation for the virtual Interface vrrp_instance VI_1 { interface eth0 state MASTER priority 101 virtual_router_id 51 virtual_ipaddress { 192.168.0.99 } track_script { chk_haproxy } }
  • 28. 27 Install keepalived active/passive (LB1/LB2) § Install keepalived (ubuntu) § sudo apt-get install keepalived § Ensure HA Proxy will be able to bind to non local addresses § sudo nano /etc/sysctl.conf § change the value of net.ipv4.ip_nonlocal_bind to “1” § sudo sysctl -p § Configure keepalived § sudo nano /etc/keepalived/keepalived.conf § For LB2, change state to BACKUP and priority to 100 global_defs { … } # Check if haproxy is still working vrrp_script chk_haproxy { script "killall -0 haproxy" interval 2 weight 2 } # Configuation for the virtual Interface vrrp_instance VI_1 { interface eth0 state MASTER priority 101 virtual_router_id 51 virtual_ipaddress { 192.168.0.99 } track_script { chk_haproxy } } Active/Passive is not the best solution… you can also run an Active/Active load balancer. That is a bit more complex though. Keepalived can be replaced with more complex monitor and management solutions like corosynch/pacemaker combination
  • 29. 28 Install MongoDB Replica Set (MDB1, MDB2, MDB3) § Install MongoDB (ubuntu xenial) § sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 § echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list § sudo apt-get update § sudo apt-get install -y mongodb-org § Start mongodb on each node § mongod --replSet ”orion_rs" § Access a mongodb instance and configure the replicaset § mongo § In mongo console type: § rs.initiate() § rs.add(" mdb2.example.com ") § rs.add(" mdb3.example.com ") § rs.conf() § rs.status()
  • 30. 29 Install ContextBroker (CTX1, CTX2) § Install Context Broker (centos/rh) § Create a file fiware.repo in /etc/yum.repos.d/ with the following lines: § [fiware] § name=Fiware Repository § baseurl=http://repositories.lab.fiware.or g/repo/rpm/$releasever § gpgcheck=0 § enabled=1 § yum install contextBroker § Configure the Context Broker § sudo nano /etc/sysconfig/contextBroker § Start the Context Broker § /etc/init.d/contextBroker start … BROKER_DATABASE_HOST=mdb1.example.co m,mdb2.example.com,mdb3.example.com BROKER_DATABASE_NAME=orion # Replica set configuration. Note that if you set this parameter, the BROKER_DATBASE_HOST is interpreted as the list of host (or host:port) separated by commas to use as## replica set seed list (single element lists are also allowed). If BROKER_DATABASE_RPL_SET parameter is unset, Orion CB assumes that the BROKER_DATABASE_HOST is an stand- alone mongod instance BROKER_DATABASE_RPLSET=orion_rs
  • 32. 31 Additional considerations § Scale up § Scaling up context broker processing capacity requires only to add a new entry in the HA Proxy and deploy a new instance of context broker § Hardware failures § If all your service instances (context broker, ha proxy, mongodb) run on the same physical server you achieved only HA within respect software failures § Shared configuration § For many of the services large part of the configuration is shared, plans for easy ways to keep it in synch (e.g. NFS, github)
  • 33. 32 What about other GEs? § STH and IoT Agent have similar architecture to the Context Broker § You can adopt a similar strategy § Cygnus is based on Apache FLUME § It can be configured HA with Active/Passive modality using a load balancer and at least 2 Cygnus agents § Some are HA by design § COSMOS is based on Hadoop and Hadoop is basically an HA cluster
  • 34. On going and future activities in FIWARE 33
  • 35. Did it look complex? 34
  • 37. Smart Security • Common architecture patterns: e.g. scalability pattern • Common generic enablers: e.g. orion context-broker • Common data models: e.g. geo-location • Specific architecture patterns: e.g. secured data access pattern • Specific and customised generic enablers: e.g. security risk detection filters for kurento media server • Specific data models: e.g. security’s events Smart Security Application “recipe” 36
  • 38. Smart Security • Common architecture patterns: e.g. scalability pattern • Common generic enablers: e.g. orion context-broker • Common data models: e.g. geo-location • Specific architecture patterns: e.g. secured data access pattern • Specific and customised generic enablers: e.g. security risk detection filters for kurento media server • Specific data models: e.g. security’s events Smart Security Application “recipe” 37 1. Analyse HA architectures for the different Data and IoT Management enablers 2. Creating Docker compose recipes to allow easy deployment of HA enablers 3. Making them available in FIWARE Lab to experimenters
  • 39. Do you have questions? Do you want to contribute? 38 Contact Us www.martel-innovate.com Federico M. Facca Head of Martel Lab federico.facca@martel-innovate.com Dorfstrasse 73 – 3073 Gümligen (Switzerland) 0041 78 807 58 38