SlideServe
Menu
Préférences
© SlideServe · v2026

Spark

kendra avatar
17 diapositives · 482 Views · Jul 11, 2014

Spark. Lightning-Fast Cluster Computing. www.spar k-project.org. UC BERKELEY. This Meetup. Project history and plans Spark tutorial Running locally and on EC2 Interactive shell Standalone jobs Spark at Quantifind. Project Goals. AMP Lab: design next-gen data analytics stack

Spark - slide 1
01 / 17Spark
1 / 17

Télécharger la présentation

Spark
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Spark Lightning-Fast Cluster Computing www.spark-project.org UC BERKELEY

  2. This Meetup • Project history and plans • Spark tutorial • Running locally and on EC2 • Interactive shell • Standalone jobs • Spark at Quantifind

  3. Project Goals • AMP Lab: design next-gen data analytics stack • By scaling up Algorithms, Machines and People • Mesos: cluster manager • Make it easy to write and deploy distributed apps • Spark: parallel computing system • General and efficient computing model supporting in-memory execution • High-level API in Scalalanguage • Substrate for even higher APIs (SQL, Pregel, …)

  4. Where We’re Going Shark (Hive on Spark) Bagel (Pregel on Spark) Streaming Spark … Hadoop MPI Spark Debug Tools … Mesos Private Cluster Amazon EC2

  5. Some Users

  6. Project Stats • Core classes: 8,700 LOC • Interpreter: 3,300 LOC • Examples: 1,300 LOC • Tests: 1,100 LOC • Total: 15,000 LOC

  7. Getting Spark • Requirements: Java 6+, Scala 2.9.1 • gitclone git://github.com/mesos/spark.git • cd spark • sbt/sbt compile Wiki data: tinyurl.com/wikisample These slides: tinyurl.com/sum-talk

  8. Running Locally • # run one of the example jobs: • ./run spark.examples.SparkPi local • # launch the interpreter: • ./spark-shell

  9. Running on EC2 • git clone git://github.com/apache/mesos.git • cd mesos/ec2 • ./mesos-ec2 -k keypair –iid_rsa.pem –s slaves \ [launch|stop|start|destroy] clusterName • Details: tinyurl.com/mesos-ec2

  10. Programming Concepts • SparkContext: entry point to Spark functions • Resilient distributed datasets (RDDs): • Immutable, distributed collections of objects • Can be cached in memory for fast reuse • Operations on RDDs: • Transformations: define a new RDD (map, join, …) • Actions: return or output a result (count, save, …)

  11. Creating a SparkContext • importspark.SparkContext • importspark.SparkContext._ • valsc = newSparkContext(“master”, “jobName”) • // Master can be: • // local – run locally with 1 thread • // local[K] – run locally with K threads • // mesos://master@host:port

  12. Creating RDDs • // turn a Scala collection into an RDD • sc.parallelize(List(1, 2, 3)) • // text file from local FS, HDFS, S3, etc • sc.textFile(“file.txt”) • sc.textFile(“directory/*.txt”) • sc.textFile(“hdfs://namenode:9000/path/file”) • // general Hadoop InputFormat: • sc.hadoopFile(keyCls, valCls, inputFmt, conf)

  13. RDD Operations

  14. Standalone Jobs • Without Maven: package Spark into a jar • sbt/sbt assembly • # use core/target/spark-core-assembly-*.jar • With Maven: • sbt/sbt publish-local • # add dep. on org.spark-project / spark-core

  15. Standalone Jobs • Configure Spark’s install location and your job’s classpathas environment variables: • export SPARK_HOME=... • export SPARK_CLASSPATH=... • Or pass extra args to SparkContext: • new SparkContext(master, name, sparkHome, jarList)

  16. Where to Go From Here • Programming guide: www.spark-project.org/documentation.html • Example programs: examples/src/main/scala • RDD ops: RDD.scala, PairRDDFunctions.scala

  17. Next Meetup • Thursday, Feb 23rd at 6:30 PM • Conviva, Inc2 Waters Park DriveSan Mateo, CA 94403