Running Spark Cluster Mode on Windows Prompt
24 May 2017Starting a Master (in terminal 1)
- Navigate to c:\spark\bin directory
- Start the standalone master by running the command as below (Keep in mind the master url e.g. spark://IP:PORT)
spark-class org.apache.spark.deploy.master.Master
- Check the web UI of spark standalong cluster at http://localhost:8080/
Starting a Worker (in terminal 2)
- Navigate to c:\spark\bin directory
- Start a slave by running the command as below (Use the master url e.g. spark://192.168.0.5:7077)
spark-class org.apache.spark.deploy.worker.Worker spark://192.168.0.5:7077
#spark-class org.apache.spark.deploy.worker.Worker --cores 2 --memory 4g spark://192.168.0.5:7077
Running Shell on Cluster Mode
Run the command as below in the terminal
pyspark --master spark://192.168.0.5:7077
Submitting a Job on Cluster Mode
- Navigate to the python file in the terminal
cd c:/users/yohan/documents/spark
- Submit the job specifying the master url
spark-submit --master spark://192.168.0.5:7077 --executor-memory test.py
- Kill the client as below
spark-class org.apache.spark.deploy.Client kill
See more info: