Skip to content

An example of docker compose to set up a single Spark node connecting to MongoDB via Spark Connector using JAVA

Notifications You must be signed in to change notification settings

sindbach/mongodb-javaspark-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker for MongoDB and Apache Spark.

An example of docker-compose to set up a single Apache Spark node connecting to MongoDB via MongoDB Spark Connector using JAVA.

** For demo purposes only **

Environment :

  • Ubuntu v14.04
  • Apache Spark v1.6.2
  • MongoDB Spark Connector v1.1.0
  • MongoDB v3.2.x
  • Java 1.7
  • Maven

Starting up

You can start by running command :

docker-compose run java bash

Which would run the spark node and the mongodb node, and provides you with bash shell for the java spark instance.

From the spark instance, you could reach the MongoDB instance using mongodb hostname.

From the home dir /home/ubuntu, you should be able to compile the Java introduction file:

mvn package 

Which should generate a jar file in the target directory. You can then execute using:

spark-submit --class tour.JavaIntroduction ./target/tour-1.0-SNAPSHOT.jar 

More Information.

See related article:

About

An example of docker compose to set up a single Spark node connecting to MongoDB via Spark Connector using JAVA

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages