关注 spark技术分享,
撸spark源码 玩spark最佳实践

Management Scripts for Standalone Master

Management Scripts for Standalone Master

You can start a Spark Standalone master (aka standalone Master) using sbin/start-master.sh and stop it using sbin/stop-master.sh.

sbin/start-master.sh

sbin/start-master.sh script starts a Spark master on the machine the script is executed on.

The script prepares the command line to start the class org.apache.spark.deploy.master.Master and by default runs as follows:

Note
The command sets SPARK_PRINT_LAUNCH_COMMAND environment variable to print out the launch command to standard error output. Refer to Print Launch Command of Spark Scripts.

It has support for starting Tachyon using --with-tachyon command line option. It assumes tachyon/bin/tachyon command be available in Spark’s home directory.

The script uses the following helper scripts:

  • sbin/spark-config.sh

  • bin/load-spark-env.sh

  • conf/spark-env.sh contains environment variables of a Spark executable.

Ultimately, the script calls sbin/spark-daemon.sh start to kick off org.apache.spark.deploy.master.Master with parameter 1 and --ip, --port, and --webui-port command-line options.

Command-line Options

You can use the following command-line options:

  • --host or -h the hostname to listen on; overrides SPARK_MASTER_HOST.

  • --ip or -i (deprecated) the IP to listen on

  • --port or -p – command-line version of SPARK_MASTER_PORT that overrides it.

  • --webui-port – command-line version of SPARK_MASTER_WEBUI_PORT that overrides it.

  • --properties-file (default: $SPARK_HOME/conf/spark-defaults.conf) – the path to a custom Spark properties file. Refer to spark-defaults.conf.

  • --help – prints out help

sbin/stop-master.sh

You can stop a Spark Standalone master using sbin/stop-master.sh script.

Caution
FIXME Review the script

It effectively sends SIGTERM to the master’s process.

You should see the ERROR in master’s logs:

赞(0) 打赏
未经允许不得转载:spark技术分享 » Management Scripts for Standalone Master
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏