I have a standalone spark 2.4.0 cluster to which I need to deploy app passing some extra java options (to both driver and executors).
To do that I use spark.driver.extraJavaOptions
and spark.executor.extraJavaOptions
described here.
It works perfectly fine in client mode however there are problems in cluster mode - variables are not passed to driver (for executors it's still fine).
I was facing similar issues for spark.driver.extraClassPath
as well so I guess problem is more generic.
Anyway, I've managed to find a solution for that:
- We need to submit using REST submission server (typically running on port 6066, i.e. spark://localhost:6066 )
- To make above possible we need to explicitly enable REST submission using property
spark.master.rest.enabled
(since 2.4.0 it's false by default, true in older releases - see PR)
Questions:
I was not able to find in documentation that we actually need to deploy via REST when using cluster mode to make
spark.driver.extraJavaOptions
(and similar) option work as expected. Official doc doesn't mention it. Is it documented anywhere else or am I missing something obvious?I guess submitting in cluster mode is quite a common use case. If doing this properly requires using REST submission server (please, correct me if I'm wrong) why was it disabled by default?
When I try to submit in regular way (7077 port) with
spark.master.rest.enabled
set to true I get following info in logs:Warning: Master endpointspark://localhost:7077 was not a REST server. Falling back to legacy submission gateway instead.
Judging by that I would say that in general not submitting via REST is legacy but again - it's not documented anywhere and also why would they disable REST submission by default (see my 2nd question)?
- When I try to deploy in client mode via REST it always fails with error
StandaloneAppClient$ClientEndpoint:87 - Failed to connect to master localhost:6066
Does that mean that we always must switch a port when we change deploy mode? What's the point, why can't we have one way to deploy our app?