How to connect master and slaves in Apache-Spark? (Standalone Mode)

You can set export SPARK_LOCAL_IP="You-IP" #to set the IP address Spark binds to on this node in $SPARK_HOME/conf/spark-env.sh


I usually start from spark-env.sh template. And I set, properties that I need. For simple cluster you need:

  • SPARK_MASTER_IP

Then, create a file called "slaves" in the same directory as spark-env.sh and slaves ip's (one per line). Assure you reach all slaves through ssh.

Finally, copy this configuration in every machine of your cluster. Then start the entire cluster executing start-all.sh script and try spark-shell to check your configuration.

> sbin/start-all.sh
> bin/spark-shell

Tags:

Apache Spark