Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Open Source
Aka Hadoop
Chi sono
➢ nico logrillo
➢ IT Business Intelligence Analyst @ Wolters Kluwer
➢Studente (*) Universitario @ Informatica Magistrale di
Bari
*eterno studente
Che cos'è
E' un ecosistema di strumenti open-source orientato al calcolo distribuito di big
➢
Scalabile
➢
Fault tolerant
➢
Numerosi strumenti
➢
Open-Source
➢
Sempre in evoluzione
➢
”
Big Data?
Cosa sono?
• Nel 2001 Doug Laney (analista @ Gartner) definì I big data in termini volume, velocity e
variety:
• Volume. Many factors contribute to the increase in data volume. Transaction-based data
stored through the years. Unstructured data streaming in from social media.
Increasing amounts of sensor and machine-to-machine data being collected.
In the past, excessive data volume was a storage issue. But with decreasing storage costs,
other issues emerge, including how to determine relevance within large data volumes and
how to use analytics to create value from relevant data.
• Velocity. Data is streaming in at unprecedented speed and must be dealt with in a timely
manner. RFID tags, sensors and smart metering are driving the need to deal with torrents
of data in near-real time. Reacting quickly enough to deal with data velocity is a challenge
for most organizations.
• Variety. Data today comes in all types of formats. Structured, numeric data in traditional
databases. Information created from line-of-business applications. Unstructured text
documents, email, video, audio, stock ticker data and financial transactions.
Managing, merging and governing different varieties of data is something many
organizations still grapple with.
Big Data?
Da dove provengono?
• Social networks e social media (Twitter, Facebook, blogs, forum, etc.)
• Email
• Transazioni commerciali
• Documenti cartacei digitalizzati
• Registrazioni video
• Registrazioni audio
• Immagini
• Dati di geo-posizionamento (GPS)
• Dati generati da trasmettitori e sensori (cellulari, wifi, bluetooth, Rfid, NFC, etc.)
o misuratori digitali (digital meters)
• Internet of Things
• Automazione processi produttivi
• Digitalizzazione dei processi di R&D (nella bioinformatica e biogenetica, chimica,
climatologia, etc.)
• Web Log
Big Data?
• l'iter da seguire
• Identificare il problema
• Identificare sorgenti dati e strumenti da utilizzare
• Collezionare I dati
• Preparare I dati (integrazione, trasformazione, pulizia, filtraggio e aggregazione)
• Costruire un modello
• Valutare il modello
• Comunicare I risultati
MASTER
SLAVES
...
Architettura di Hadoop
➢ Architettura Master-Slave
MASTER NameNode
JobTracker
TaskTracker
SLAVES
... DataNode
Architettura di Hadoop
Architettura di Hadoop
MapReduce
Cluster: 15 nodi
Ogni nodo: Utilizzato per
8 cores Il motore di ricerca
16G RAM
1.4T storage
Cluster 2:
300 nodi
2400 cores
3PB
Singolo nodo:
8 cores
12TB
WTF!!!
Hadoop MapReduce
Map Phase
Input <k1, v1>
Output list(<k2, v2>)
Reduce Phase
Input <k2, list(v2)>
Output list(<k3, v3>)
Hadoop MapReduce
(esempio: wordcount)
Hadoop MapReduce
(esempio: wordcount)
Map Phase
Input <k1, v1>
Output list(<k2, v2>)
Map Phase
Input <INDEX, TOKEN>
Output list(<TOKEN, VALORE_ASSEGNATO>)
Reduce Phase
Input <k2, list(v2)>
Output list(<k3, v3>)
Reduce Phase
Input <TOKEN, list(1,1,1,...,1)>
Output list(<TOKEN, sum(list(1,1,1,...,1))>)
3. Ordinare l'output
Esempio di un record:
in24.inetnebr.com - - [01/Aug/1995:00:00:01 -0400] "GET /shuttle/missions/sts-68/news/sts-68-mcc-05.txt HTTP/1.0" 200 1839
Main Class
Mapper Class
Reducer Class
Map Phase
Reduce Phase
Input <TOKEN, list(1,1,1,...,1)> Output list(<TOKEN, sum(list(1,1,1,...,1))>)
Hadoop MapReduce
(esempio: Analisi dei Log)
3. Ordinare l'output
/images/NASA-logosmall.gif 968746
/images/KSC-logosmall.gif 751435
/images/MOSAIC-logosmall.gif 669777
/images/USA-logosmall.gif 666057
/images/WORLD-logosmall.gif 659867
/images/ksclogo-medium.gif 623047
/ksc.html 433947
/history/apollo/images/apollo-logo1.gif 377542
...
Hadoop MapReduce
Velocità:
100X più veloce di MapReduce in memoria
10X più veloce di MapReduce sul caricamento da disco
Linguaggi Supportati:
Java
Scala
Python
R
Librerie presenti:
SparkSQL
SparkStreaming
Mlib
GraphX
Apache
• E' un set di dati suddiviso in partizioni che può restare in memoria o essere
materializzato su disco
• E' immutabile. Lo si può modificare solo per mezzo di trasformazioni
• Ogni nodo (worker) possiede una partizione dell'RDD
Apache
• L'applicazione scritta per Spark definisce un RDD iniziale partendo da un set di dati.
L'applicazione eseguirà trasformazioni come map() o filters() che muteranno l'RDD
in un nuovo RDD.
• Lo scheduler costruisce un grafo contenente le trasformazioni richieste
dall'applicazione
determinando il miglior modo con cui distribuire le trasformazioni sui vari nodi.
• Al termine dell'operazione lo scheduler restituisce l'output al client che ha lanciato
l'applicazione.
Apache
stay tuned
#METTIALINUX
#ESCILADISTRO
https://github.com/colino
facebook.com/philipj.fry.5439
nico_ntrax@hotmail.com