You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2015/08/20 00:24:27 UTC

ambari git commit: AMBARI-12763. Adding Support for WebHDFS HA mode in Knox Configuration. (Zachary Blanco via jaimin)

Repository: ambari
Updated Branches:
  refs/heads/trunk 0a815fac8 -> 7b3974106


AMBARI-12763. Adding Support for WebHDFS HA mode in Knox Configuration. (Zachary Blanco via jaimin)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7b397410
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7b397410
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7b397410

Branch: refs/heads/trunk
Commit: 7b39741064b3693290fdc00afed7f746c938af58
Parents: 0a815fa
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Wed Aug 19 15:20:08 2015 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Wed Aug 19 15:20:08 2015 -0700

----------------------------------------------------------------------
 .../KNOX/0.5.0.2.2/configuration/topology.xml   |  2 +-
 .../0.5.0.2.2/package/scripts/params_linux.py   | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7b397410/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml
index 80a226c..89527b3 100644
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml
@@ -86,7 +86,7 @@
 
             &lt;service&gt;
                 &lt;role&gt;WEBHDFS&lt;/role&gt;
-                &lt;url&gt;http://{{namenode_host}}:{{namenode_http_port}}/webhdfs&lt;/url&gt;
+                {{webhdfs_service_urls}}
             &lt;/service&gt;
 
             &lt;service&gt;

http://git-wip-us.apache.org/repos/asf/ambari/blob/7b397410/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py
index 733caf1..5b520ef 100644
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py
@@ -103,6 +103,26 @@ if has_namenode:
     if 'dfs.namenode.rpc-address' in config['configurations']['hdfs-site']:
       namenode_rpc_port = get_port_from_url(config['configurations']['hdfs-site']['dfs.namenode.rpc-address'])
 
+webhdfs_service_urls = ""
+
+
+def buildUrlElement(protocol, hdfs_host, port, servicePath) :
+  openTag = "<url>"
+  closeTag = "</url>"
+  proto = protocol + "://"
+  newLine = "\n"
+  if hdfs_host is None or port is None:
+      return ""
+  else:
+    return openTag + proto + hdfs_host + ":" + port + servicePath + closeTag + newLine
+
+if type(namenode_hosts) is list:
+    for host in namenode_hosts:
+      webhdfs_service_urls += buildUrlElement("http", host, namenode_http_port, "/webhdfs")
+else:
+  webhdfs_service_urls = buildUrlElement("http", namenode_hosts, namenode_http_port, "/webhdfs")
+
+
 rm_hosts = default("/clusterHostInfo/rm_host", None)
 if type(rm_hosts) is list:
   rm_host = rm_hosts[0]