SlideShare a Scribd company logo
How to deploy Spark HA instance using
Ansible 2.0 in FIWARE Lab
Fernando López Aguilar
Technological Expert. IT and Cloud Architect
fernando.lopezaguilar@telefonica.com
@flopezaguilar
1
2
Cookies of the Dark Side
• Use OpenStack locally.
• Use Ansible.
• Use both together.
3
Come to the Dark Side
We use OpenStackClient
4
OpenStack client
 Unified shell command structure and a common language to describe
operations in OpenStack.
 Remote interaction with any OpenStack environment (if it is open).
 Easy install, just execute: pip install python-openstackclient.
 Easy to use, just execute: $ openstack --help
ubuntu@ubuntu:~/malaga$ sudo apt install python-pip
…
ubuntu@ubuntu:~/malaga$ sudo apt install virtualenv
…
ubuntu@ubuntu:~/malaga$ virtualenv env
New python executable in
/home/ubuntu/malaga/env/bin/python
Installing setuptools, pip, wheel...done.
ubuntu@ubuntu:~/malaga$ source env/bin/activate
(env) ubuntu@ubuntu:~/malaga$ pip install 
> python-openstackclient
…
5
OpenStackClient hands-on
 Create a new directory
(e.g. malaga)
 If you do not have, install
pip and virtualenv.
 Create your virtualenv
(virtualenv is a tool to
create isolated Python
environments).
 Activate the isolated
python environment.
 Install the
OpenStackClient
6
OpenStack client hands-on
 After the installation you can execute the command shell openstack.
 To obtain information about the openstack command and its
subcommands, run it:
$ openstack help [subcommand]
$ openstack --help
 Typing openstack switches to the interactive mode.
Typing help [subcommand] for information.
To exit the interactive mode, type quit.
7
OpenStack client hands-on
• Next steps: we need the
credentials of your OpenStack
environment.
• Just login into FIWARE Lab Cloud
Portal (https://cloud.lab.fiware.org/)
and get your data:
ubuntu@ubuntu:~/malaga$ more
fernando.lopezaguilar@telefonica.com-openrc
export
OS_USERNAME=fernando.lopezaguilar@telefonica.com
export OS_PASSWORD=
export OS_TENANT_NAME="Fernando Lopez cloud”
export OS_REGION_NAME=Spain2
export OS_AUTH_URL=http://130.206.84.8:4730/v3/
8
OpenStackClient hands-on
 File downloaded a file with
format:
<your user name>-openrc
 Content:
 OS_USERNAME
 OS_PASSWORD
 OS_TENANT_NAME
 OS_REGION_NAME
 OS_AUTH_URL
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_IDENTITY_API_VERSION=3
export PS1='(`basename "$VIRTUAL_ENV`)[u@FIWARE
Lab W(keystone_user)]$ ’
ubuntu@ubuntu:~/malaga$ source
fernando.lopezaguilar@telefonica.com-openrc
9
OpenStackClient hands-on
 You need to edit the file
and add the following.
 I suggest to add also the
following line.
 Move the file to your work
directory and load it.
10
OpenStackClient hands-on
 Your turn…
 Get help about openstack client
 Create a keypair.
 List of keypairs.
11
THEY HAVE ANIBLE… !!!
I’ve been to the dark side…
12
Ansible
 Ansible is an IT automation tool.
 Manages machines in an agent-less manner.
 Uses of OpenSSH for transport and a YAML language.
 Main focus in software deployment and system configuration.
13
What do you need to know?
 Connect to a remote machine using SSH.
 Interact with the bash command-line shell.
 Install packages.
 Use the sudo command.
 Check and set file permissions.
 Start and stop services.
 Set environment variables.
 Write scripts (any language).
14
Previous action
 Install ansible (v 2.2.0.0)
 Using openstackclient, deploy a server.
 Create a keypair
 Create security group an assign rule
 Create a server
15
First steps with Ansible
 Define inventory file (hosts).
 INI-like format and looks like this::
 <server name>: name of the server
 ansible_ssh_host: IP of the server
 ansible_ssh_user: user to access via ssh
 ansible_ssh_private_key_file: key pair to access the server
ubuntu@ubuntu:~/malaga$ ansible ansible-test -i hosts -m
ping
ansible-test | SUCCESS => {
"changed": false,
"ping": "pong"
}
16
First steps with Ansible
 Connect to the server
named <server name>
and invoke the ping
module.
17
Time to do bigger things
---
invoice: 12345
product:
- id: 987
amount: 2
description: basketball ball
- id: 760
amount: 1
description: football ball
18
Ansible
 Process description in YAML
description file.
 YAML is a human friendly data
serialization standard for all
programming languages.
 A deployment is described in a
“playbook” (e.g.: deploy a web
application).
 A “playbook” can define several
processes o deployments
19
Ansible inventory
 Ansible works against multiple systems in your infrastructure at the
same time.
 By defaults, saved in the location /etc/ansible/hosts but can be
specified a different inventory with –i command.
 Not only is this inventory configurable, but you can also use multiple
inventory files at the same time.
 You can use a script to generate dynamically the inventory.
20
Using Variables: About Jinja2
 Ansible allows you to reference variables in your playbooks using the
Jinja2 templating system.
 Example: in a simple template, you can do something like:
My amp goes to {{ max_amp_value }}
 This is also valid directly in playbooks:
template: src=foo.cfg.j2 dest={{ remote_install_path }}/foo.cfg
 Variables might be defined in YAML file (e.g. vars/main.yml)
21
Ansible modules
 Ansible ships with a number of modules (called the ‘module library’).
 They can be executed directly (-m option) on remote hosts or through
Playbooks.
 Users can also write their own modules.
 These modules can control system resources, like services,
packages, or files (anything really), or handle executing system
commands.
22
Ansible roles
 Instead of creating giant playbooks with hundreds of tasks we can use
roles to organize tasks.
 A role breaks task into smaller more discrete units of work.
 A role is all the tasks, variables and handlers needed to complete the
unit of work.
 This allows a role to be completely self contained or encapsulated
and completely reusable.
 Example of role is the installation and configuration of NTPd service.
23
Ansible Galaxy
24
Where the hell is Spark…?
25
Spark
 Apache Spark is a fast and general-purpose cluster computing
system.
 Provide high-level APIs in Java, Scala, Python and R.
 Support a rich set of higher-level tools:
 Spark SQL for SQL and structured data processing.
 MLlib for machine learning.
 GraphX for graph processing, and Spark Streaming.
26
Spark in HA
 Creation of a Master node and several Slaves nodes.
 Configuration of the instances.
 Configuration of Spark nodes.
…
27
Hands-on Spark deployment with Ansible
 Clone the github repository
https://github.com/flopezag/ansible_spark_openstack
 Follow the instructions in README.md file
 Take a look into /vars/main.yml file.
28
Yeah, if you could just,
come to the dark side…
29
References
 OpenStack Client Command List:
http://docs.openstack.org/developer/python-openstackclient/command-
list.html
 Ansible documentation:
http://docs.ansible.com/ansible/
 FIWARE Lab Account portal:
https://account.lab.fiware.org/idm/
Thank you!
http://fiware.org
Follow @FIWARE on Twitter
30
Thank you!
http://fiware.org
Follow @FIWARE on Twitter
Ad

Recommended

Simple docker hosting in FIWARE Lab
Simple docker hosting in FIWARE Lab
Fernando Lopez Aguilar
 
Simple docker hosting on fiware lab
Simple docker hosting on fiware lab
Kenneth Nagin
 
Setting up your virtual infrastructure using FIWARE Lab Cloud
Setting up your virtual infrastructure using FIWARE Lab Cloud
Fernando Lopez Aguilar
 
Setting up your virtual infrastructure using fi-lab cloud
Setting up your virtual infrastructure using fi-lab cloud
Fernando Lopez Aguilar
 
Process for joining to the FIWARE Lab
Process for joining to the FIWARE Lab
Fernando Lopez Aguilar
 
Dev stacklabguide
Dev stacklabguide
openstackcisco
 
How to Install & Configure Your Own Identity Manager GE
How to Install & Configure Your Own Identity Manager GE
FIWARE
 
How to master OpenStack in 2 hours
How to master OpenStack in 2 hours
OpenCity Community
 
OpenStack DevStack Configuration localrc local.conf Tutorial
OpenStack DevStack Configuration localrc local.conf Tutorial
Saju Madhavan
 
OpenStack DevStack Tutorial
OpenStack DevStack Tutorial
Saju Madhavan
 
EMC Networker installation Document
EMC Networker installation Document
uzzal basak
 
Setting up your virtual infrastructure using fi lab cloud
Setting up your virtual infrastructure using fi lab cloud
Henar Muñoz Frutos
 
Docker for Ruby Developers
Docker for Ruby Developers
Aptible
 
OpenStack Development Using devstack
OpenStack Development Using devstack
mestery
 
OpenStack in 10 minutes with Devstack
OpenStack in 10 minutes with Devstack
Sean Dague
 
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
David Bosschaert
 
OpenStack : DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)
OpenStack : DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)
Ian Choi
 
Oracle linux kube
Oracle linux kube
Ahmed Mekawy
 
Python on exadata
Python on exadata
Rainer Schuettengruber
 
Amending and Testing changes lab guide
Amending and Testing changes lab guide
openstackcisco
 
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
Torry Harris Business Solutions
 
Oracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11g
uzzal basak
 
DevStack
DevStack
Everett Toews
 
Install Solaris 11.1 on a Virtualbox VM
Install Solaris 11.1 on a Virtualbox VM
Laurent Leturgez
 
Installing WordPress on AWS
Installing WordPress on AWS
Manish Jain
 
Harmonia open iris_basic_v0.1
Harmonia open iris_basic_v0.1
Yongyoon Shin
 
Installaling Puppet Master and Agent
Installaling Puppet Master and Agent
Ranjit Avasarala
 
Vulnerability Exploitation in Docker Container Environments
Vulnerability Exploitation in Docker Container Environments
FlawCheck
 
Adding Identity Management and Access Control to your Application, Authorization
Adding Identity Management and Access Control to your Application, Authorization
Fernando Lopez Aguilar
 
What is FIWARE Lab
What is FIWARE Lab
Fernando Lopez Aguilar
 

More Related Content

What's hot (20)

OpenStack DevStack Configuration localrc local.conf Tutorial
OpenStack DevStack Configuration localrc local.conf Tutorial
Saju Madhavan
 
OpenStack DevStack Tutorial
OpenStack DevStack Tutorial
Saju Madhavan
 
EMC Networker installation Document
EMC Networker installation Document
uzzal basak
 
Setting up your virtual infrastructure using fi lab cloud
Setting up your virtual infrastructure using fi lab cloud
Henar Muñoz Frutos
 
Docker for Ruby Developers
Docker for Ruby Developers
Aptible
 
OpenStack Development Using devstack
OpenStack Development Using devstack
mestery
 
OpenStack in 10 minutes with Devstack
OpenStack in 10 minutes with Devstack
Sean Dague
 
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
David Bosschaert
 
OpenStack : DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)
OpenStack : DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)
Ian Choi
 
Oracle linux kube
Oracle linux kube
Ahmed Mekawy
 
Python on exadata
Python on exadata
Rainer Schuettengruber
 
Amending and Testing changes lab guide
Amending and Testing changes lab guide
openstackcisco
 
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
Torry Harris Business Solutions
 
Oracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11g
uzzal basak
 
DevStack
DevStack
Everett Toews
 
Install Solaris 11.1 on a Virtualbox VM
Install Solaris 11.1 on a Virtualbox VM
Laurent Leturgez
 
Installing WordPress on AWS
Installing WordPress on AWS
Manish Jain
 
Harmonia open iris_basic_v0.1
Harmonia open iris_basic_v0.1
Yongyoon Shin
 
Installaling Puppet Master and Agent
Installaling Puppet Master and Agent
Ranjit Avasarala
 
Vulnerability Exploitation in Docker Container Environments
Vulnerability Exploitation in Docker Container Environments
FlawCheck
 
OpenStack DevStack Configuration localrc local.conf Tutorial
OpenStack DevStack Configuration localrc local.conf Tutorial
Saju Madhavan
 
OpenStack DevStack Tutorial
OpenStack DevStack Tutorial
Saju Madhavan
 
EMC Networker installation Document
EMC Networker installation Document
uzzal basak
 
Setting up your virtual infrastructure using fi lab cloud
Setting up your virtual infrastructure using fi lab cloud
Henar Muñoz Frutos
 
Docker for Ruby Developers
Docker for Ruby Developers
Aptible
 
OpenStack Development Using devstack
OpenStack Development Using devstack
mestery
 
OpenStack in 10 minutes with Devstack
OpenStack in 10 minutes with Devstack
Sean Dague
 
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
David Bosschaert
 
OpenStack : DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)
OpenStack : DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)
Ian Choi
 
Amending and Testing changes lab guide
Amending and Testing changes lab guide
openstackcisco
 
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
Torry Harris Business Solutions
 
Oracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11g
uzzal basak
 
Install Solaris 11.1 on a Virtualbox VM
Install Solaris 11.1 on a Virtualbox VM
Laurent Leturgez
 
Installing WordPress on AWS
Installing WordPress on AWS
Manish Jain
 
Harmonia open iris_basic_v0.1
Harmonia open iris_basic_v0.1
Yongyoon Shin
 
Installaling Puppet Master and Agent
Installaling Puppet Master and Agent
Ranjit Avasarala
 
Vulnerability Exploitation in Docker Container Environments
Vulnerability Exploitation in Docker Container Environments
FlawCheck
 

Viewers also liked (20)

Adding Identity Management and Access Control to your Application, Authorization
Adding Identity Management and Access Control to your Application, Authorization
Fernando Lopez Aguilar
 
What is FIWARE Lab
What is FIWARE Lab
Fernando Lopez Aguilar
 
Federating new FIWARE Lab nodes
Federating new FIWARE Lab nodes
Fernando Lopez Aguilar
 
MLeap: Release Spark ML Pipelines
MLeap: Release Spark ML Pipelines
DataWorks Summit/Hadoop Summit
 
Think Like Spark
Think Like Spark
Alpine Data
 
Cloud Portal - Lesson 3. Launching an Instance
Cloud Portal - Lesson 3. Launching an Instance
Álvaro Alonso González
 
Fiware ops demo meeting (health) (06 07-15)
Fiware ops demo meeting (health) (06 07-15)
Fernando Lopez Aguilar
 
Fiware ops demo meeting (health) (09 06-15)
Fiware ops demo meeting (health) (09 06-15)
Fernando Lopez Aguilar
 
Cloud Portal - Lesson 2. Cloud Portal Overview
Cloud Portal - Lesson 2. Cloud Portal Overview
Álvaro Alonso González
 
Cloud Portal - Lesson 1. Introduction
Cloud Portal - Lesson 1. Introduction
Álvaro Alonso González
 
Spark Uber Development Kit
Spark Uber Development Kit
DataWorks Summit/Hadoop Summit
 
Spark meets Smart Meters
Spark meets Smart Meters
DataWorks Summit/Hadoop Summit
 
Advanced Visualization of Spark jobs
Advanced Visualization of Spark jobs
DataWorks Summit/Hadoop Summit
 
Adding Identity Management and Access Control to your Application, Account Ma...
Adding Identity Management and Access Control to your Application, Account Ma...
Fernando Lopez Aguilar
 
Faster Batch Processing with Cloudera 5.7: Hive-on-Spark is ready for production
Faster Batch Processing with Cloudera 5.7: Hive-on-Spark is ready for production
Cloudera, Inc.
 
Clickstream Analysis with Spark
Clickstream Analysis with Spark
Josef Adersberger
 
Lessons Learned: Using Spark and Microservices
Lessons Learned: Using Spark and Microservices
Alexis Seigneurin
 
FIWARE Lab architecture, an open point to start the installation of a new region
FIWARE Lab architecture, an open point to start the installation of a new region
Fernando Lopez Aguilar
 
Unit testing of spark applications
Unit testing of spark applications
Knoldus Inc.
 
Producing Spark on YARN for ETL
Producing Spark on YARN for ETL
DataWorks Summit/Hadoop Summit
 
Adding Identity Management and Access Control to your Application, Authorization
Adding Identity Management and Access Control to your Application, Authorization
Fernando Lopez Aguilar
 
Think Like Spark
Think Like Spark
Alpine Data
 
Cloud Portal - Lesson 3. Launching an Instance
Cloud Portal - Lesson 3. Launching an Instance
Álvaro Alonso González
 
Fiware ops demo meeting (health) (06 07-15)
Fiware ops demo meeting (health) (06 07-15)
Fernando Lopez Aguilar
 
Fiware ops demo meeting (health) (09 06-15)
Fiware ops demo meeting (health) (09 06-15)
Fernando Lopez Aguilar
 
Cloud Portal - Lesson 2. Cloud Portal Overview
Cloud Portal - Lesson 2. Cloud Portal Overview
Álvaro Alonso González
 
Adding Identity Management and Access Control to your Application, Account Ma...
Adding Identity Management and Access Control to your Application, Account Ma...
Fernando Lopez Aguilar
 
Faster Batch Processing with Cloudera 5.7: Hive-on-Spark is ready for production
Faster Batch Processing with Cloudera 5.7: Hive-on-Spark is ready for production
Cloudera, Inc.
 
Clickstream Analysis with Spark
Clickstream Analysis with Spark
Josef Adersberger
 
Lessons Learned: Using Spark and Microservices
Lessons Learned: Using Spark and Microservices
Alexis Seigneurin
 
FIWARE Lab architecture, an open point to start the installation of a new region
FIWARE Lab architecture, an open point to start the installation of a new region
Fernando Lopez Aguilar
 
Unit testing of spark applications
Unit testing of spark applications
Knoldus Inc.
 
Ad

Similar to How to deploy spark instance using ansible 2.0 in fiware lab v2 (20)

Ansible & Salt - Vincent Boon
Ansible & Salt - Vincent Boon
MyNOG
 
Basics of Ansible - Sahil Davawala
Basics of Ansible - Sahil Davawala
Sahil Davawala
 
A DevOps guide to Kubernetes
A DevOps guide to Kubernetes
Paul Czarkowski
 
Ansible intro
Ansible intro
Marcelo Quintiliano da Silva
 
Introducing Ansible
Introducing Ansible
Francesco Pantano
 
Ansible - Hands on Training
Ansible - Hands on Training
Mehmet Ali Aydın
 
Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017
Mohamad Hassan
 
Ansible Tutorial.pdf
Ansible Tutorial.pdf
NigussMehari4
 
Managing Postgres with Ansible
Managing Postgres with Ansible
Gulcin Yildirim Jelinek
 
DevOps for database
DevOps for database
Osama Mustafa
 
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets Ansible
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets Ansible
Benjamin Zores
 
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Keith Resar
 
Ansible
Ansible
Rahul Bajaj
 
DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​
DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​
Ramit Surana
 
maXbox Starter87
maXbox Starter87
Max Kleiner
 
Intro to-ansible-sep7-meetup
Intro to-ansible-sep7-meetup
Ramesh Godishela
 
Ansible_Basics_ppt.pdf
Ansible_Basics_ppt.pdf
PrabhjotSingh976002
 
Using Ansible Dynamic Inventory with Amazon EC2
Using Ansible Dynamic Inventory with Amazon EC2
Brian Schott
 
Just one-shade-of-openstack
Just one-shade-of-openstack
Roberto Polli
 
Aucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricks
Glen Ogilvie
 
Ansible & Salt - Vincent Boon
Ansible & Salt - Vincent Boon
MyNOG
 
Basics of Ansible - Sahil Davawala
Basics of Ansible - Sahil Davawala
Sahil Davawala
 
A DevOps guide to Kubernetes
A DevOps guide to Kubernetes
Paul Czarkowski
 
Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017
Mohamad Hassan
 
Ansible Tutorial.pdf
Ansible Tutorial.pdf
NigussMehari4
 
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets Ansible
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets Ansible
Benjamin Zores
 
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Keith Resar
 
DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​
DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​
Ramit Surana
 
maXbox Starter87
maXbox Starter87
Max Kleiner
 
Intro to-ansible-sep7-meetup
Intro to-ansible-sep7-meetup
Ramesh Godishela
 
Using Ansible Dynamic Inventory with Amazon EC2
Using Ansible Dynamic Inventory with Amazon EC2
Brian Schott
 
Just one-shade-of-openstack
Just one-shade-of-openstack
Roberto Polli
 
Aucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricks
Glen Ogilvie
 
Ad

More from Fernando Lopez Aguilar (20)

Introduction to FIWARE technology
Introduction to FIWARE technology
Fernando Lopez Aguilar
 
DW2020 Data Models - FIWARE Platform
DW2020 Data Models - FIWARE Platform
Fernando Lopez Aguilar
 
FIWARE and Smart Data Models
FIWARE and Smart Data Models
Fernando Lopez Aguilar
 
How to deploy a smart city platform?
How to deploy a smart city platform?
Fernando Lopez Aguilar
 
Building the Smart City Platform on FIWARE Lab
Building the Smart City Platform on FIWARE Lab
Fernando Lopez Aguilar
 
Data Modeling with NGSI, NGSI-LD
Data Modeling with NGSI, NGSI-LD
Fernando Lopez Aguilar
 
FIWARE and Robotics
FIWARE and Robotics
Fernando Lopez Aguilar
 
Big Data and Machine Learning with FIWARE
Big Data and Machine Learning with FIWARE
Fernando Lopez Aguilar
 
Operational Dashboards with FIWARE WireCloud
Operational Dashboards with FIWARE WireCloud
Fernando Lopez Aguilar
 
Creating a Context-Aware solution, Complex Event Processing with FIWARE Perseo
Creating a Context-Aware solution, Complex Event Processing with FIWARE Perseo
Fernando Lopez Aguilar
 
FIWARE Identity Management and Access Control
FIWARE Identity Management and Access Control
Fernando Lopez Aguilar
 
Data persistency (draco, cygnus, sth comet, quantum leap)
Data persistency (draco, cygnus, sth comet, quantum leap)
Fernando Lopez Aguilar
 
How to debug IoT Agents
How to debug IoT Agents
Fernando Lopez Aguilar
 
Core Context Management
Core Context Management
Fernando Lopez Aguilar
 
What is an IoT Agent
What is an IoT Agent
Fernando Lopez Aguilar
 
FIWARE Overview
FIWARE Overview
Fernando Lopez Aguilar
 
Overview of the FIWARE Ecosystem
Overview of the FIWARE Ecosystem
Fernando Lopez Aguilar
 
Cloud and Big Data in the agriculture sector
Cloud and Big Data in the agriculture sector
Fernando Lopez Aguilar
 
Berlin OpenStack Summit'18
Berlin OpenStack Summit'18
Fernando Lopez Aguilar
 
Context Information Management in IoT enabled smart systems - the basics
Context Information Management in IoT enabled smart systems - the basics
Fernando Lopez Aguilar
 
Building the Smart City Platform on FIWARE Lab
Building the Smart City Platform on FIWARE Lab
Fernando Lopez Aguilar
 
Big Data and Machine Learning with FIWARE
Big Data and Machine Learning with FIWARE
Fernando Lopez Aguilar
 
Operational Dashboards with FIWARE WireCloud
Operational Dashboards with FIWARE WireCloud
Fernando Lopez Aguilar
 
Creating a Context-Aware solution, Complex Event Processing with FIWARE Perseo
Creating a Context-Aware solution, Complex Event Processing with FIWARE Perseo
Fernando Lopez Aguilar
 
FIWARE Identity Management and Access Control
FIWARE Identity Management and Access Control
Fernando Lopez Aguilar
 
Data persistency (draco, cygnus, sth comet, quantum leap)
Data persistency (draco, cygnus, sth comet, quantum leap)
Fernando Lopez Aguilar
 
Cloud and Big Data in the agriculture sector
Cloud and Big Data in the agriculture sector
Fernando Lopez Aguilar
 
Context Information Management in IoT enabled smart systems - the basics
Context Information Management in IoT enabled smart systems - the basics
Fernando Lopez Aguilar
 

Recently uploaded (20)

原版一样(ISM毕业证书)德国多特蒙德国际管理学院毕业证多少钱
原版一样(ISM毕业证书)德国多特蒙德国际管理学院毕业证多少钱
taqyed
 
Logging and Automated Alerting Webinar.pdf
Logging and Automated Alerting Webinar.pdf
ControlCase
 
Paper: The World Game (s) Great Redesign.pdf
Paper: The World Game (s) Great Redesign.pdf
Steven McGee
 
Global Networking Trends, presented at the India ISP Conclave 2025
Global Networking Trends, presented at the India ISP Conclave 2025
APNIC
 
Q1 English3 Week5 [email protected]
Q1 English3 Week5 [email protected]
JenniferCawaling1
 
原版澳洲斯文本科技大学毕业证(SUT毕业证书)如何办理
原版澳洲斯文本科技大学毕业证(SUT毕业证书)如何办理
taqyed
 
PROCESS FOR CREATION OF BUSINESS PARTNER IN SAP
PROCESS FOR CREATION OF BUSINESS PARTNER IN SAP
AhmadAli716831
 
history of internet in nepal Class-8 (sparsha).pptx
history of internet in nepal Class-8 (sparsha).pptx
SPARSH508080
 
B M Mostofa Kamal Al-Azad [Document & Localization Expert]
B M Mostofa Kamal Al-Azad [Document & Localization Expert]
Mostofa Kamal Al-Azad
 
ChatGPT_and_Its_Uses_Presentationss.pptx
ChatGPT_and_Its_Uses_Presentationss.pptx
Neha Prakash
 
最新版加拿大奎斯特大学毕业证(QUC毕业证书)原版定制
最新版加拿大奎斯特大学毕业证(QUC毕业证书)原版定制
taqyed
 
ChatGPT A.I. Powered Chatbot and Popularization.pdf
ChatGPT A.I. Powered Chatbot and Popularization.pdf
StanleySamson1
 
The ARUBA Kind of new Proposal Umum .pptx
The ARUBA Kind of new Proposal Umum .pptx
andiwarneri
 
Pitch PitchPitchPitchPitchPitchPitch.pptx
Pitch PitchPitchPitchPitchPitchPitch.pptx
157551
 
DDoS in India, presented at INNOG 8 by Dave Phelan
DDoS in India, presented at INNOG 8 by Dave Phelan
APNIC
 
Transmission Control Protocol (TCP) and Starlink
Transmission Control Protocol (TCP) and Starlink
APNIC
 
Clive Dickens RedTech Public Copy - Collaborate or Die
Clive Dickens RedTech Public Copy - Collaborate or Die
Clive Dickens
 
BASICS OF SAP _ ALL ABOUT SAP _WHY SAP OVER ANY OTHER ERP SYSTEM
BASICS OF SAP _ ALL ABOUT SAP _WHY SAP OVER ANY OTHER ERP SYSTEM
AhmadAli716831
 
原版一样(ANU毕业证书)澳洲澳大利亚国立大学毕业证在线购买
原版一样(ANU毕业证书)澳洲澳大利亚国立大学毕业证在线购买
Taqyea
 
BroadLink Cloud Service introduction.pdf
BroadLink Cloud Service introduction.pdf
DevendraDwivdi1
 
原版一样(ISM毕业证书)德国多特蒙德国际管理学院毕业证多少钱
原版一样(ISM毕业证书)德国多特蒙德国际管理学院毕业证多少钱
taqyed
 
Logging and Automated Alerting Webinar.pdf
Logging and Automated Alerting Webinar.pdf
ControlCase
 
Paper: The World Game (s) Great Redesign.pdf
Paper: The World Game (s) Great Redesign.pdf
Steven McGee
 
Global Networking Trends, presented at the India ISP Conclave 2025
Global Networking Trends, presented at the India ISP Conclave 2025
APNIC
 
原版澳洲斯文本科技大学毕业证(SUT毕业证书)如何办理
原版澳洲斯文本科技大学毕业证(SUT毕业证书)如何办理
taqyed
 
PROCESS FOR CREATION OF BUSINESS PARTNER IN SAP
PROCESS FOR CREATION OF BUSINESS PARTNER IN SAP
AhmadAli716831
 
history of internet in nepal Class-8 (sparsha).pptx
history of internet in nepal Class-8 (sparsha).pptx
SPARSH508080
 
B M Mostofa Kamal Al-Azad [Document & Localization Expert]
B M Mostofa Kamal Al-Azad [Document & Localization Expert]
Mostofa Kamal Al-Azad
 
ChatGPT_and_Its_Uses_Presentationss.pptx
ChatGPT_and_Its_Uses_Presentationss.pptx
Neha Prakash
 
最新版加拿大奎斯特大学毕业证(QUC毕业证书)原版定制
最新版加拿大奎斯特大学毕业证(QUC毕业证书)原版定制
taqyed
 
ChatGPT A.I. Powered Chatbot and Popularization.pdf
ChatGPT A.I. Powered Chatbot and Popularization.pdf
StanleySamson1
 
The ARUBA Kind of new Proposal Umum .pptx
The ARUBA Kind of new Proposal Umum .pptx
andiwarneri
 
Pitch PitchPitchPitchPitchPitchPitch.pptx
Pitch PitchPitchPitchPitchPitchPitch.pptx
157551
 
DDoS in India, presented at INNOG 8 by Dave Phelan
DDoS in India, presented at INNOG 8 by Dave Phelan
APNIC
 
Transmission Control Protocol (TCP) and Starlink
Transmission Control Protocol (TCP) and Starlink
APNIC
 
Clive Dickens RedTech Public Copy - Collaborate or Die
Clive Dickens RedTech Public Copy - Collaborate or Die
Clive Dickens
 
BASICS OF SAP _ ALL ABOUT SAP _WHY SAP OVER ANY OTHER ERP SYSTEM
BASICS OF SAP _ ALL ABOUT SAP _WHY SAP OVER ANY OTHER ERP SYSTEM
AhmadAli716831
 
原版一样(ANU毕业证书)澳洲澳大利亚国立大学毕业证在线购买
原版一样(ANU毕业证书)澳洲澳大利亚国立大学毕业证在线购买
Taqyea
 
BroadLink Cloud Service introduction.pdf
BroadLink Cloud Service introduction.pdf
DevendraDwivdi1
 

How to deploy spark instance using ansible 2.0 in fiware lab v2

  • 1. How to deploy Spark HA instance using Ansible 2.0 in FIWARE Lab Fernando López Aguilar Technological Expert. IT and Cloud Architect [email protected] @flopezaguilar
  • 2. 1
  • 3. 2 Cookies of the Dark Side • Use OpenStack locally. • Use Ansible. • Use both together.
  • 4. 3 Come to the Dark Side We use OpenStackClient
  • 5. 4 OpenStack client  Unified shell command structure and a common language to describe operations in OpenStack.  Remote interaction with any OpenStack environment (if it is open).  Easy install, just execute: pip install python-openstackclient.  Easy to use, just execute: $ openstack --help
  • 6. ubuntu@ubuntu:~/malaga$ sudo apt install python-pip … ubuntu@ubuntu:~/malaga$ sudo apt install virtualenv … ubuntu@ubuntu:~/malaga$ virtualenv env New python executable in /home/ubuntu/malaga/env/bin/python Installing setuptools, pip, wheel...done. ubuntu@ubuntu:~/malaga$ source env/bin/activate (env) ubuntu@ubuntu:~/malaga$ pip install > python-openstackclient … 5 OpenStackClient hands-on  Create a new directory (e.g. malaga)  If you do not have, install pip and virtualenv.  Create your virtualenv (virtualenv is a tool to create isolated Python environments).  Activate the isolated python environment.  Install the OpenStackClient
  • 7. 6 OpenStack client hands-on  After the installation you can execute the command shell openstack.  To obtain information about the openstack command and its subcommands, run it: $ openstack help [subcommand] $ openstack --help  Typing openstack switches to the interactive mode. Typing help [subcommand] for information. To exit the interactive mode, type quit.
  • 8. 7 OpenStack client hands-on • Next steps: we need the credentials of your OpenStack environment. • Just login into FIWARE Lab Cloud Portal (https://cloud.lab.fiware.org/) and get your data:
  • 9. ubuntu@ubuntu:~/malaga$ more [email protected] export [email protected] export OS_PASSWORD= export OS_TENANT_NAME="Fernando Lopez cloud” export OS_REGION_NAME=Spain2 export OS_AUTH_URL=http://130.206.84.8:4730/v3/ 8 OpenStackClient hands-on  File downloaded a file with format: <your user name>-openrc  Content:  OS_USERNAME  OS_PASSWORD  OS_TENANT_NAME  OS_REGION_NAME  OS_AUTH_URL
  • 10. export OS_PROJECT_DOMAIN_NAME=default export OS_USER_DOMAIN_NAME=default export OS_IDENTITY_API_VERSION=3 export PS1='(`basename "$VIRTUAL_ENV`)[u@FIWARE Lab W(keystone_user)]$ ’ ubuntu@ubuntu:~/malaga$ source [email protected] 9 OpenStackClient hands-on  You need to edit the file and add the following.  I suggest to add also the following line.  Move the file to your work directory and load it.
  • 11. 10 OpenStackClient hands-on  Your turn…  Get help about openstack client  Create a keypair.  List of keypairs.
  • 12. 11 THEY HAVE ANIBLE… !!! I’ve been to the dark side…
  • 13. 12 Ansible  Ansible is an IT automation tool.  Manages machines in an agent-less manner.  Uses of OpenSSH for transport and a YAML language.  Main focus in software deployment and system configuration.
  • 14. 13 What do you need to know?  Connect to a remote machine using SSH.  Interact with the bash command-line shell.  Install packages.  Use the sudo command.  Check and set file permissions.  Start and stop services.  Set environment variables.  Write scripts (any language).
  • 15. 14 Previous action  Install ansible (v 2.2.0.0)  Using openstackclient, deploy a server.  Create a keypair  Create security group an assign rule  Create a server
  • 16. 15 First steps with Ansible  Define inventory file (hosts).  INI-like format and looks like this::  <server name>: name of the server  ansible_ssh_host: IP of the server  ansible_ssh_user: user to access via ssh  ansible_ssh_private_key_file: key pair to access the server
  • 17. ubuntu@ubuntu:~/malaga$ ansible ansible-test -i hosts -m ping ansible-test | SUCCESS => { "changed": false, "ping": "pong" } 16 First steps with Ansible  Connect to the server named <server name> and invoke the ping module.
  • 18. 17 Time to do bigger things
  • 19. --- invoice: 12345 product: - id: 987 amount: 2 description: basketball ball - id: 760 amount: 1 description: football ball 18 Ansible  Process description in YAML description file.  YAML is a human friendly data serialization standard for all programming languages.  A deployment is described in a “playbook” (e.g.: deploy a web application).  A “playbook” can define several processes o deployments
  • 20. 19 Ansible inventory  Ansible works against multiple systems in your infrastructure at the same time.  By defaults, saved in the location /etc/ansible/hosts but can be specified a different inventory with –i command.  Not only is this inventory configurable, but you can also use multiple inventory files at the same time.  You can use a script to generate dynamically the inventory.
  • 21. 20 Using Variables: About Jinja2  Ansible allows you to reference variables in your playbooks using the Jinja2 templating system.  Example: in a simple template, you can do something like: My amp goes to {{ max_amp_value }}  This is also valid directly in playbooks: template: src=foo.cfg.j2 dest={{ remote_install_path }}/foo.cfg  Variables might be defined in YAML file (e.g. vars/main.yml)
  • 22. 21 Ansible modules  Ansible ships with a number of modules (called the ‘module library’).  They can be executed directly (-m option) on remote hosts or through Playbooks.  Users can also write their own modules.  These modules can control system resources, like services, packages, or files (anything really), or handle executing system commands.
  • 23. 22 Ansible roles  Instead of creating giant playbooks with hundreds of tasks we can use roles to organize tasks.  A role breaks task into smaller more discrete units of work.  A role is all the tasks, variables and handlers needed to complete the unit of work.  This allows a role to be completely self contained or encapsulated and completely reusable.  Example of role is the installation and configuration of NTPd service.
  • 25. 24 Where the hell is Spark…?
  • 26. 25 Spark  Apache Spark is a fast and general-purpose cluster computing system.  Provide high-level APIs in Java, Scala, Python and R.  Support a rich set of higher-level tools:  Spark SQL for SQL and structured data processing.  MLlib for machine learning.  GraphX for graph processing, and Spark Streaming.
  • 27. 26 Spark in HA  Creation of a Master node and several Slaves nodes.  Configuration of the instances.  Configuration of Spark nodes. …
  • 28. 27 Hands-on Spark deployment with Ansible  Clone the github repository https://github.com/flopezag/ansible_spark_openstack  Follow the instructions in README.md file  Take a look into /vars/main.yml file.
  • 29. 28 Yeah, if you could just, come to the dark side…
  • 30. 29 References  OpenStack Client Command List: http://docs.openstack.org/developer/python-openstackclient/command- list.html  Ansible documentation: http://docs.ansible.com/ansible/  FIWARE Lab Account portal: https://account.lab.fiware.org/idm/

Editor's Notes

  • #12: openstack keypair create spark > spark.pem openstack help
  • #14: An ansible is a fictional communication device that can transfer information faster than the speed of light. More specifically, Michael DeHaan took the name Ansible from the book Ender’s Game by Orson Scott Card. In that book, the ansible was used to control a large number of remote ships at once, over vast distances. Think of it as a metaphor for controlling remote servers.
  • #16: openstack keypair create spark > spark.pem     openstack security group create spark --description "internal security group for spark"     openstack security group rule create spark --protocol tcp --dst-port 1:65535 openstack server create --image base_ubuntu_14.04 --flavor 3  --security-group spark --key-name spark1 --nic net-id=473dacd2-42a6-4c1c-93e8-1b29f098846e ansible-test
  • #17: ansible-test ansible_ssh_host=130.206.122.3 ansible_ssh_user=ubuntu ansible_ssh_private_key_file=spark.pem
  • #20: YAML: YAML Ain't Markup Language
  • #25: Ansible Galaxy is Ansible’s official community hub for sharing Ansible roles. A role is the Ansible way of bundling automation content and making it reusable.
  • #29: --- # Set to absent to take down machines instance_state: present # Number of workers to spawn in the cluster nbr_of_slaves: 2 # The name of the key pair you will use to log in # as set in OpenStack (see the OpenStack security dashboard) key_name: spark # Id of the networks to run in (can be found in the OpenStack # dashboard) network_internal_name: node-int-net-01 network_external_name: public-ext-net-01 # This is the ssh-key which will be distritbuted # across the cluster. It' important that this key # does NOT use password protection ssh_keys_to_use: files/cloud ssh_public_key: files/cloud.pub # This is a ugly hack - but you have to give the # file name of the ssh-key your referencing above name_of_ssh_key: cloud # Name of the user used to install everything # on the remote systems user: ubuntu # Name of hadoop user hadoop_user: ubuntu