Fork

通過 Supervisor 在前台啟動 Spark

  • January 9, 2017

我們有一個通過主管啟動的火花集群。摘錄:

/etc/supervisor/conf.d/spark_master.conf:
command=./sbin/start-master.sh
directory=/opt/spark-1.4.1

/etc/supervisor/conf.d/spark_worker.conf:
command=./sbin/start-slave.sh spark://spark-master:7077
directory=/opt/spark-1.4.1

主管面臨的挑戰是這些腳本啟動一個守護程序並分離,主管希望事情在沒有分叉的情況下在前台執行。到目前為止,我說服主管分叉是可以的,或者說服 spark 不要分叉的努力都付諸東流。有人找到更好的方法嗎?謝謝!

我從以前版本的文件中推斷出的解決方案:

/etc/supervisor/conf.d/spark_master.conf:
command=/opt/spark-1.4.1/bin/spark-class org.apache.spark.deploy.master.Master
directory=/opt/spark-1.4.1

/etc/supervisor/conf.d/spark_worker.conf:
command=/opt/spark-1.4.1/bin/spark-class org.apache.spark.deploy.worker.Worker spark://spark-master:7077
directory=/opt/spark-1.4.1

通過bin/spark-class命令啟動保持在前台,並且不會使“從屬”術語永久化而增加了滿意度。

引用自:https://unix.stackexchange.com/questions/223098