-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-29465][YARN][WEBUI] Adding Check to not to set UI port (spark.ui.port) property if mentioned explicitly #28880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ce4b6ea
10b9f7e
b42c3ed
2703edb
8fe0aa9
bee8b21
24ecfcf
2b190c4
1896905
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -211,9 +211,13 @@ private[spark] class ApplicationMaster( | |
| final def run(): Int = { | ||
| try { | ||
| val attemptID = if (isClusterMode) { | ||
| // Set the web ui port to be ephemeral for yarn so we don't conflict with | ||
| // other spark processes running on the same box | ||
| System.setProperty(UI_PORT.key, "0") | ||
| // Set the web ui port to be ephemeral for yarn if not set explicitly | ||
| // so we don't conflict with other spark processes running on the same box | ||
| // If set explicitly, Web UI will attempt to run on UI_PORT and try | ||
| // incrementally until UI_PORT + `spark.port.maxRetries` | ||
| if (System.getProperty(UI_PORT.key) == null) { | ||
| System.setProperty(UI_PORT.key, "0") | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, @rajatahujaatinmobi . While reviewing this PR, I noticed that SPARK-29465 is a previous one for this issue.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, please see the discussions there, I think a range of ports would be much better. A single port set on a multi-tenant yarn cluster could easily end up with conflicts. What requirements do you have from Knox, a certain range or ports?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct me if I am wrong As per the discussions that UI port is always get assigned in the range based on spark.port.maxRetries. So we can always mention the starting port and afterward, it will try to start service based in between (starting port, starting port +spark.port.maxRetries). So we are including the range implicitly. Copying the comment We have a Knox proxy that accesses UI via RM link. And Knox proxy has a certain range of ports that it can access on the cluster which is (18000-18159). Unless we start web UI on that range, we can not access the UI. and we can achieve above the range if we set the following properties Hence setting up a spark.ui.port as starting port is enough instead of setting up a random port number in the range.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yea, I think yet Spark could utilize the combination of What else the "range port" do you refer to? @tgravescs
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah yes you are correct you can get range that way. the ports originally wouldn't do the retries or at least we didn't allow configuring maxRetries.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I blocked ports from 18000 to 18050 so now spark.ui.port can not get port b/w that range. But in Spark properties, I mentioned spark.ui.port as 18018 and spark.port.maxRetries=60 so now spark service will start trying from 18018 port until 18018 + 60 in an increment way but ports are blocked until 18050 so spark.ui.port will pick up 18051 port. @Ngone51
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. This is what we expected, right?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that's expected. So I think we are good to go unless someone else has any other doubts.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for testing that, please update the comment like my below comment requests.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tgravescs I have done that. Can we proceed further? |
||
|
|
||
| // Set the master and deploy mode property to match the requested mode. | ||
| System.setProperty("spark.master", "yarn") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets update the comment to say if explicitly set, it acts as a port range based on spark.port.maxRetries so make sure that is sufficiently large for your setup to avoid port conflicts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tgravescs Updated my comment. If that looks okay, can we merge this request ? And I would like to backport this change until spark 2.4