You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vb...@apache.org on 2014/01/13 11:44:46 UTC

git commit: AMBARI-4251. Support for adding custom properties to ZK configs.(vbrodetskyi)

Updated Branches:
  refs/heads/trunk 93338ed9f -> 46d3fa97d


AMBARI-4251. Support for adding custom properties to ZK configs.(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: 46d3fa97d728bf0e475e8ef40a44d6b1a7dd6b4e
Parents: 93338ed
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Mon Jan 13 12:43:51 2014 +0200
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Mon Jan 13 12:43:51 2014 +0200

----------------------------------------------------------------------
 .../HDP/1.3.4/services/ZOOKEEPER/package/scripts/params.py    | 6 ++++++
 .../HDP/1.3.4/services/ZOOKEEPER/package/templates/zoo.cfg.j2 | 7 +++++++
 .../HDP/2.0.8/services/ZOOKEEPER/package/scripts/params.py    | 6 ++++++
 .../HDP/2.0.8/services/ZOOKEEPER/package/templates/zoo.cfg.j2 | 7 +++++++
 4 files changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/46d3fa97/ambari-server/src/main/resources/stacks/HDP/1.3.4/services/ZOOKEEPER/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.4/services/ZOOKEEPER/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/1.3.4/services/ZOOKEEPER/package/scripts/params.py
index e643c66..9acc0c9 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.4/services/ZOOKEEPER/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.4/services/ZOOKEEPER/package/scripts/params.py
@@ -45,6 +45,12 @@ initLimit = config['configurations']['global']['initLimit']
 syncLimit = config['configurations']['global']['syncLimit']
 clientPort = config['configurations']['global']['clientPort']
 
+if 'zoo.cfg' in config['configurations']:
+  zoo_cfg_properties_map = config['configurations']['zoo.cfg']
+else:
+  zoo_cfg_properties_map = {}
+zoo_cfg_properties_map_length = len(zoo_cfg_properties_map)
+
 zk_primary_name = "zookeeper"
 zk_principal_name = "zookeeper/_HOST@EXAMPLE.COM"
 zk_principal = zk_principal_name.replace('_HOST',hostname)

http://git-wip-us.apache.org/repos/asf/ambari/blob/46d3fa97/ambari-server/src/main/resources/stacks/HDP/1.3.4/services/ZOOKEEPER/package/templates/zoo.cfg.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.4/services/ZOOKEEPER/package/templates/zoo.cfg.j2 b/ambari-server/src/main/resources/stacks/HDP/1.3.4/services/ZOOKEEPER/package/templates/zoo.cfg.j2
index 63dc6cf..5b68218 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.4/services/ZOOKEEPER/package/templates/zoo.cfg.j2
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.4/services/ZOOKEEPER/package/templates/zoo.cfg.j2
@@ -42,3 +42,10 @@ jaasLoginRenew=3600000
 kerberos.removeHostFromPrincipal=true
 kerberos.removeRealmFromPrincipal=true
 {% endif %}
+
+{% if zoo_cfg_properties_map_length > 0 %}
+# Custom properties
+{% endif %}
+{% for key, value in zoo_cfg_properties_map.iteritems() %}
+{{key}}={{value}}
+{% endfor %}

http://git-wip-us.apache.org/repos/asf/ambari/blob/46d3fa97/ambari-server/src/main/resources/stacks/HDP/2.0.8/services/ZOOKEEPER/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.8/services/ZOOKEEPER/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.8/services/ZOOKEEPER/package/scripts/params.py
index e643c66..9acc0c9 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.8/services/ZOOKEEPER/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.8/services/ZOOKEEPER/package/scripts/params.py
@@ -45,6 +45,12 @@ initLimit = config['configurations']['global']['initLimit']
 syncLimit = config['configurations']['global']['syncLimit']
 clientPort = config['configurations']['global']['clientPort']
 
+if 'zoo.cfg' in config['configurations']:
+  zoo_cfg_properties_map = config['configurations']['zoo.cfg']
+else:
+  zoo_cfg_properties_map = {}
+zoo_cfg_properties_map_length = len(zoo_cfg_properties_map)
+
 zk_primary_name = "zookeeper"
 zk_principal_name = "zookeeper/_HOST@EXAMPLE.COM"
 zk_principal = zk_principal_name.replace('_HOST',hostname)

http://git-wip-us.apache.org/repos/asf/ambari/blob/46d3fa97/ambari-server/src/main/resources/stacks/HDP/2.0.8/services/ZOOKEEPER/package/templates/zoo.cfg.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.8/services/ZOOKEEPER/package/templates/zoo.cfg.j2 b/ambari-server/src/main/resources/stacks/HDP/2.0.8/services/ZOOKEEPER/package/templates/zoo.cfg.j2
index 63dc6cf..5b68218 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.8/services/ZOOKEEPER/package/templates/zoo.cfg.j2
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.8/services/ZOOKEEPER/package/templates/zoo.cfg.j2
@@ -42,3 +42,10 @@ jaasLoginRenew=3600000
 kerberos.removeHostFromPrincipal=true
 kerberos.removeRealmFromPrincipal=true
 {% endif %}
+
+{% if zoo_cfg_properties_map_length > 0 %}
+# Custom properties
+{% endif %}
+{% for key, value in zoo_cfg_properties_map.iteritems() %}
+{{key}}={{value}}
+{% endfor %}