You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "zhengchenyu (via GitHub)" <gi...@apache.org> on 2023/08/13 06:09:58 UTC
[GitHub] [hadoop] zhengchenyu commented on a diff in pull request #5946: YARN-11154. Make router support proxy server.
zhengchenyu commented on code in PR #5946:
URL: https://github.com/apache/hadoop/pull/5946#discussion_r1292674937
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/Router.java:
##########
@@ -209,9 +215,30 @@ public void startWepApp() {
Builder<Object> builder =
WebApps.$for("cluster", null, null, "ws").with(conf).at(webAppAddress);
+ if(conf.getBoolean(YarnConfiguration.ROUTER_WEBAPP_PROXY_ENABLE,
+ YarnConfiguration.DEFAULT_ROUTER_WEBAPP_PROXY_ENABLE)) {
+ fetcher = new FedAppReportFetcher(conf);
+ builder.withServlet(ProxyUriUtils.PROXY_SERVLET_NAME, ProxyUriUtils.PROXY_PATH_SPEC,
+ WebAppProxyServlet.class);
+ builder.withAttribute(WebAppProxy.FETCHER_ATTRIBUTE, fetcher);
+ String proxyHostAndPort = getProxyHostAndPort(conf);
+ String[] proxyParts = proxyHostAndPort.split(":");
+ builder.withAttribute(WebAppProxy.PROXY_HOST_ATTRIBUTE, proxyParts[0]);
+ }
webApp = builder.start(new RouterWebApp(this));
}
+ public static String getProxyHostAndPort(Configuration conf) {
+ String addr = conf.get(YarnConfiguration.PROXY_ADDRESS);
Review Comment:
We do not need a default value. In this function, router web address is just the default value.
If PROXY_ADDRESS is configured, means that a standalone proxy server is deployed.
If PROXY_ADDRESS is not configured, means that we will regard router web as proxy server.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org