This project is based on TwitterPopularTags and Spark-Docker-Example
- Docker 1.10.0+ and docker-compose 1.6.0+
- SBT
You have to request API keys from twitter to use this application. Create a file named twitter.properties
in sbt-application/docker-resources/
with the follwing content:
spark.debug=true
spark.twitter.consumerKey=XXXXXXXXXXXXXXXX
spark.twitter.consumerSecret=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
spark.twitter.accessToken=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
spark.twitter.accessTokenSecret=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
- go to hadoop folder and build the docker image with the following command
docker build -t spark .
- Create docker image of the sbt-application by executing following command inside
sbt-application
directory:
sbt docker
- Run whole cluster using
docker-compose
(from the directory containingdocker-compose.yml
file):
docker-compose up
Docker-compose will run three images:
- Spark master
- Spark worker
- sbt-application (Spark job)