How to submit a job via REST API?

我怕爱的太早我们不能终老 提交于 2019-12-03 21:14:32
  • Check that you have started a Spark master and worker (using start-all.sh)

  • Check that in the log file there is a message like

INFO rest.StandaloneRestServer: Started REST server for submitting applications on port 6066

  • Check the started process is really listening on port 6066 (using netstat)

It should look like this:

root@x:~# netstat -apn | grep 11572 | grep LISTEN
tcp6       0      0 :::8080                 :::*                    LISTEN      11572/java      
tcp6       0      0 10.0.0.9:6066           :::*                    LISTEN      11572/java      
tcp6       0      0 10.0.0.9:7077           :::*                    LISTEN      11572/java      

Then replace "spark-master-ip" in the script with the IP address you see in the output of netstat (the example shows "10.0.0.9").

Using Spark 2.4.3, we found that the REST API is disabled by default. When the REST API is disabled, calls to port 6066 will fail with the error you have shown.

We found that the REST API had to be enabled by adding the following entry to your spark-defaults.conf file.

spark.master.rest.enabled true

Once this entry was added, we restarted the Spark instance on the machine and the REST API came to life.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!