SlideShare une entreprise Scribd logo
1  sur  32
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

Contenu connexe

Tendances

OpenStack DevStack Configuration localrc local.conf Tutorial
OpenStack DevStack Configuration localrc local.conf TutorialOpenStack DevStack Configuration localrc local.conf Tutorial
OpenStack DevStack Configuration localrc local.conf TutorialSaju Madhavan
 
OpenStack DevStack Tutorial
OpenStack DevStack TutorialOpenStack DevStack Tutorial
OpenStack DevStack TutorialSaju Madhavan
 
EMC Networker installation Document
EMC Networker installation DocumentEMC Networker installation Document
EMC Networker installation Documentuzzal basak
 
Setting up your virtual infrastructure using fi lab cloud
Setting up your virtual infrastructure using fi lab cloudSetting up your virtual infrastructure using fi lab cloud
Setting up your virtual infrastructure using fi lab cloudHenar Muñoz Frutos
 
Docker for Ruby Developers
Docker for Ruby DevelopersDocker for Ruby Developers
Docker for Ruby DevelopersAptible
 
OpenStack Development Using devstack
OpenStack Development Using devstackOpenStack Development Using devstack
OpenStack Development Using devstackmestery
 
OpenStack in 10 minutes with Devstack
OpenStack in 10 minutes with DevstackOpenStack in 10 minutes with Devstack
OpenStack in 10 minutes with DevstackSean Dague
 
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and FelixProvisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and FelixDavid Bosschaert
 
OpenStack : DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)
OpenStack: DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)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 guideAmending and Testing changes lab guide
Amending and Testing changes lab guideopenstackcisco
 
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris WhitepaperEucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris WhitepaperTorry Harris Business Solutions
 
Oracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11gOracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11guzzal basak
 
Install Solaris 11.1 on a Virtualbox VM
Install Solaris 11.1 on a Virtualbox VMInstall Solaris 11.1 on a Virtualbox VM
Install Solaris 11.1 on a Virtualbox VMLaurent Leturgez
 
Installing WordPress on AWS
Installing WordPress on AWSInstalling WordPress on AWS
Installing WordPress on AWSManish Jain
 
Harmonia open iris_basic_v0.1
Harmonia open iris_basic_v0.1Harmonia open iris_basic_v0.1
Harmonia open iris_basic_v0.1Yongyoon Shin
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and AgentRanjit Avasarala
 
Vulnerability Exploitation in Docker Container Environments
Vulnerability Exploitation in Docker Container EnvironmentsVulnerability Exploitation in Docker Container Environments
Vulnerability Exploitation in Docker Container EnvironmentsFlawCheck
 

Tendances (20)

OpenStack DevStack Configuration localrc local.conf Tutorial
OpenStack DevStack Configuration localrc local.conf TutorialOpenStack DevStack Configuration localrc local.conf Tutorial
OpenStack DevStack Configuration localrc local.conf Tutorial
 
OpenStack DevStack Tutorial
OpenStack DevStack TutorialOpenStack DevStack Tutorial
OpenStack DevStack Tutorial
 
EMC Networker installation Document
EMC Networker installation DocumentEMC Networker installation Document
EMC Networker installation Document
 
Setting up your virtual infrastructure using fi lab cloud
Setting up your virtual infrastructure using fi lab cloudSetting up your virtual infrastructure using fi lab cloud
Setting up your virtual infrastructure using fi lab cloud
 
Docker for Ruby Developers
Docker for Ruby DevelopersDocker for Ruby Developers
Docker for Ruby Developers
 
OpenStack Development Using devstack
OpenStack Development Using devstackOpenStack Development Using devstack
OpenStack Development Using devstack
 
OpenStack in 10 minutes with Devstack
OpenStack in 10 minutes with DevstackOpenStack in 10 minutes with Devstack
OpenStack in 10 minutes with Devstack
 
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and FelixProvisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
 
OpenStack : DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)
OpenStack: DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)OpenStack: DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)
OpenStack : DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)
 
Oracle linux kube
Oracle linux kubeOracle linux kube
Oracle linux kube
 
Python on exadata
Python on exadataPython on exadata
Python on exadata
 
Amending and Testing changes lab guide
Amending and Testing changes lab guideAmending and Testing changes lab guide
Amending and Testing changes lab guide
 
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris WhitepaperEucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
 
Oracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11gOracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11g
 
DevStack
DevStackDevStack
DevStack
 
Install Solaris 11.1 on a Virtualbox VM
Install Solaris 11.1 on a Virtualbox VMInstall Solaris 11.1 on a Virtualbox VM
Install Solaris 11.1 on a Virtualbox VM
 
Installing WordPress on AWS
Installing WordPress on AWSInstalling WordPress on AWS
Installing WordPress on AWS
 
Harmonia open iris_basic_v0.1
Harmonia open iris_basic_v0.1Harmonia open iris_basic_v0.1
Harmonia open iris_basic_v0.1
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and Agent
 
Vulnerability Exploitation in Docker Container Environments
Vulnerability Exploitation in Docker Container EnvironmentsVulnerability Exploitation in Docker Container Environments
Vulnerability Exploitation in Docker Container Environments
 

En vedette

Adding Identity Management and Access Control to your Application, Authorization
Adding Identity Management and Access Control to your Application, AuthorizationAdding Identity Management and Access Control to your Application, Authorization
Adding Identity Management and Access Control to your Application, AuthorizationFernando Lopez Aguilar
 
Think Like Spark
Think Like SparkThink Like Spark
Think Like SparkAlpine Data
 
Cloud Portal - Lesson 3. Launching an Instance
Cloud Portal - Lesson 3. Launching an InstanceCloud 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)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)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 OverviewCloud 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...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 productionFaster 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 productionCloudera, Inc.
 
Clickstream Analysis with Spark
Clickstream Analysis with Spark Clickstream Analysis with Spark
Clickstream Analysis with Spark Josef Adersberger
 
Lessons Learned: Using Spark and Microservices
Lessons Learned: Using Spark and MicroservicesLessons Learned: Using Spark and Microservices
Lessons Learned: Using Spark and MicroservicesAlexis 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 regionFIWARE 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 regionFernando Lopez Aguilar
 
Unit testing of spark applications
Unit testing of spark applicationsUnit testing of spark applications
Unit testing of spark applicationsKnoldus Inc.
 

En vedette (20)

Adding Identity Management and Access Control to your Application, Authorization
Adding Identity Management and Access Control to your Application, AuthorizationAdding Identity Management and Access Control to your Application, Authorization
Adding Identity Management and Access Control to your Application, Authorization
 
What is FIWARE Lab
What is FIWARE LabWhat is FIWARE Lab
What is FIWARE Lab
 
Federating new FIWARE Lab nodes
Federating new FIWARE Lab nodesFederating new FIWARE Lab nodes
Federating new FIWARE Lab nodes
 
MLeap: Release Spark ML Pipelines
MLeap: Release Spark ML PipelinesMLeap: Release Spark ML Pipelines
MLeap: Release Spark ML Pipelines
 
Think Like Spark
Think Like SparkThink Like Spark
Think Like Spark
 
Cloud Portal - Lesson 3. Launching an Instance
Cloud Portal - Lesson 3. Launching an InstanceCloud Portal - Lesson 3. Launching an Instance
Cloud Portal - Lesson 3. Launching an Instance
 
Fiware ops demo meeting (health) (06 07-15)
Fiware ops demo meeting (health) (06 07-15)Fiware ops demo meeting (health) (06 07-15)
Fiware ops demo meeting (health) (06 07-15)
 
Fiware ops demo meeting (health) (09 06-15)
Fiware ops demo meeting (health) (09 06-15)Fiware ops demo meeting (health) (09 06-15)
Fiware ops demo meeting (health) (09 06-15)
 
Cloud Portal - Lesson 2. Cloud Portal Overview
Cloud Portal - Lesson 2. Cloud Portal OverviewCloud Portal - Lesson 2. Cloud Portal Overview
Cloud Portal - Lesson 2. Cloud Portal Overview
 
Cloud Portal - Lesson 1. Introduction
Cloud Portal - Lesson 1. IntroductionCloud Portal - Lesson 1. Introduction
Cloud Portal - Lesson 1. Introduction
 
Spark Uber Development Kit
Spark Uber Development KitSpark Uber Development Kit
Spark Uber Development Kit
 
Spark meets Smart Meters
Spark meets Smart MetersSpark meets Smart Meters
Spark meets Smart Meters
 
Advanced Visualization of Spark jobs
Advanced Visualization of Spark jobsAdvanced Visualization of Spark jobs
Advanced Visualization of Spark jobs
 
Adding Identity Management and Access Control to your Application, Account Ma...
Adding Identity Management and Access Control to your Application, Account Ma...Adding Identity Management and Access Control to your Application, Account Ma...
Adding Identity Management and Access Control to your Application, Account Ma...
 
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 productionFaster 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
 
Clickstream Analysis with Spark
Clickstream Analysis with Spark Clickstream Analysis with Spark
Clickstream Analysis with Spark
 
Lessons Learned: Using Spark and Microservices
Lessons Learned: Using Spark and MicroservicesLessons Learned: Using Spark and Microservices
Lessons Learned: Using Spark and Microservices
 
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 regionFIWARE 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
 
Unit testing of spark applications
Unit testing of spark applicationsUnit testing of spark applications
Unit testing of spark applications
 
Producing Spark on YARN for ETL
Producing Spark on YARN for ETLProducing Spark on YARN for ETL
Producing Spark on YARN for ETL
 

Similaire à Deploy Spark HA using Ansible in FIWARE Lab

Ansible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonAnsible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonMyNOG
 
Basics of Ansible - Sahil Davawala
Basics of Ansible - Sahil DavawalaBasics of Ansible - Sahil Davawala
Basics of Ansible - Sahil DavawalaSahil Davawala
 
A DevOps guide to Kubernetes
A DevOps guide to KubernetesA DevOps guide to Kubernetes
A DevOps guide to KubernetesPaul Czarkowski
 
Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017Mohamad Hassan
 
Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdfNigussMehari4
 
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets Ansible
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets AnsibleCloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets Ansible
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets AnsibleBenjamin Zores
 
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12Keith Resar
 
DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​
DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​
DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​Ramit Surana
 
maXbox Starter87
maXbox Starter87maXbox Starter87
maXbox Starter87Max Kleiner
 
Intro to-ansible-sep7-meetup
Intro to-ansible-sep7-meetupIntro to-ansible-sep7-meetup
Intro to-ansible-sep7-meetupRamesh Godishela
 
Using Ansible Dynamic Inventory with Amazon EC2
Using Ansible Dynamic Inventory with Amazon EC2Using Ansible Dynamic Inventory with Amazon EC2
Using Ansible Dynamic Inventory with Amazon EC2Brian Schott
 
Just one-shade-of-openstack
Just one-shade-of-openstackJust one-shade-of-openstack
Just one-shade-of-openstackRoberto Polli
 
Aucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricksAucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricksGlen Ogilvie
 

Similaire à Deploy Spark HA using Ansible in FIWARE Lab (20)

Ansible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonAnsible & Salt - Vincent Boon
Ansible & Salt - Vincent Boon
 
Basics of Ansible - Sahil Davawala
Basics of Ansible - Sahil DavawalaBasics of Ansible - Sahil Davawala
Basics of Ansible - Sahil Davawala
 
A DevOps guide to Kubernetes
A DevOps guide to KubernetesA DevOps guide to Kubernetes
A DevOps guide to Kubernetes
 
Ansible intro
Ansible introAnsible intro
Ansible intro
 
Introducing Ansible
Introducing AnsibleIntroducing Ansible
Introducing Ansible
 
Ansible - Hands on Training
Ansible - Hands on TrainingAnsible - Hands on Training
Ansible - Hands on Training
 
Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017
 
Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdf
 
Managing Postgres with Ansible
Managing Postgres with AnsibleManaging Postgres with Ansible
Managing Postgres with Ansible
 
DevOps for database
DevOps for databaseDevOps for database
DevOps for database
 
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets Ansible
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets AnsibleCloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets Ansible
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets Ansible
 
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
 
Ansible
AnsibleAnsible
Ansible
 
DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​
DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​
DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​
 
maXbox Starter87
maXbox Starter87maXbox Starter87
maXbox Starter87
 
Intro to-ansible-sep7-meetup
Intro to-ansible-sep7-meetupIntro to-ansible-sep7-meetup
Intro to-ansible-sep7-meetup
 
Ansible_Basics_ppt.pdf
Ansible_Basics_ppt.pdfAnsible_Basics_ppt.pdf
Ansible_Basics_ppt.pdf
 
Using Ansible Dynamic Inventory with Amazon EC2
Using Ansible Dynamic Inventory with Amazon EC2Using Ansible Dynamic Inventory with Amazon EC2
Using Ansible Dynamic Inventory with Amazon EC2
 
Just one-shade-of-openstack
Just one-shade-of-openstackJust one-shade-of-openstack
Just one-shade-of-openstack
 
Aucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricksAucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricks
 

Plus de Fernando Lopez Aguilar

Building the Smart City Platform on FIWARE Lab
Building the Smart City Platform on FIWARE LabBuilding the Smart City Platform on FIWARE Lab
Building the Smart City Platform on FIWARE LabFernando Lopez Aguilar
 
Big Data and Machine Learning with FIWARE
Big Data and Machine Learning with FIWAREBig Data and Machine Learning with FIWARE
Big Data and Machine Learning with FIWAREFernando Lopez Aguilar
 
Operational Dashboards with FIWARE WireCloud
Operational Dashboards with FIWARE WireCloudOperational Dashboards with FIWARE WireCloud
Operational Dashboards with FIWARE WireCloudFernando Lopez Aguilar
 
Creating a Context-Aware solution, Complex Event Processing with FIWARE Perseo
Creating a Context-Aware solution, Complex Event Processing with FIWARE PerseoCreating a Context-Aware solution, Complex Event Processing with FIWARE Perseo
Creating a Context-Aware solution, Complex Event Processing with FIWARE PerseoFernando Lopez Aguilar
 
FIWARE Identity Management and Access Control
FIWARE Identity Management and Access ControlFIWARE Identity Management and Access Control
FIWARE Identity Management and Access ControlFernando Lopez Aguilar
 
Data persistency (draco, cygnus, sth comet, quantum leap)
Data persistency (draco, cygnus, sth comet, quantum leap)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 sectorCloud and Big Data in the agriculture sector
Cloud and Big Data in the agriculture sectorFernando Lopez Aguilar
 
Context Information Management in IoT enabled smart systems - the basics
Context Information Management in IoT enabled smart systems - the basicsContext Information Management in IoT enabled smart systems - the basics
Context Information Management in IoT enabled smart systems - the basicsFernando Lopez Aguilar
 

Plus de Fernando Lopez Aguilar (20)

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

Dernier

Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Dana Luther
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Lucknow
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Sonam Pathan
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一Fs
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作ys8omjxb
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012rehmti665
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Excelmac1
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一Fs
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMartaLoveguard
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhimiss dipika
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一Fs
 

Dernier (20)

Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
 
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptx
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
 
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
 

Deploy Spark HA using Ansible in FIWARE Lab

  • 1. 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
  • 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 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
  • 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 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.
  • 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/

Notes de l'éditeur

  1. openstack keypair create spark > spark.pem openstack help
  2. 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.
  3. 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
  4. ansible-test ansible_ssh_host=130.206.122.3 ansible_ssh_user=ubuntu ansible_ssh_private_key_file=spark.pem
  5. YAML: YAML Ain't Markup Language
  6. 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.
  7. --- # 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