You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2015/07/13 20:35:15 UTC
[2/2] ambari git commit: AMBARI-12399. Ambari 2.1 upgrade: Save yarn
configs fails due to error from stack advisor (aonishuk)
AMBARI-12399. Ambari 2.1 upgrade: Save yarn configs fails due to error from stack advisor (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1d38d6ac
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1d38d6ac
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1d38d6ac
Branch: refs/heads/branch-2.1
Commit: 1d38d6ac93c2979d2413e376f4bdd65df61a8621
Parents: a90d381
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Mon Jul 13 21:34:45 2015 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Mon Jul 13 21:34:45 2015 +0300
----------------------------------------------------------------------
ambari-server/src/main/python/upgradeHelper.py | 24 ++++++++++++++++++++
.../catalog/UpgradeCatalog_2.1_to_2.3.json | 11 +++++++++
2 files changed, 35 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/1d38d6ac/ambari-server/src/main/python/upgradeHelper.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/upgradeHelper.py b/ambari-server/src/main/python/upgradeHelper.py
index 4cffe78..8811a0c 100644
--- a/ambari-server/src/main/python/upgradeHelper.py
+++ b/ambari-server/src/main/python/upgradeHelper.py
@@ -1260,6 +1260,28 @@ def get_ranger_service_details():
return data
+def get_hive_security_authorization_setting():
+ # this pattern should be used only once, changes here mimic UpgradeCatalog210.java -> updateRangerHiveConfigs
+ response = "None"
+ old_ranger_catalog = "ranger-hive-plugin-properties"
+ old_ranger_setting = "ranger-hive-plugin-enabled"
+ hive_server_catalog = "hiveserver2-site"
+ hive_sec_property = "hive.security.authorization.enabled"
+
+ scf = Options.server_config_factory
+ if scf is not None and old_ranger_catalog in scf.items():
+ cfg = scf.get_config(old_ranger_catalog)
+ prop = cfg.properties
+ if old_ranger_setting in prop and cfg.properties[old_ranger_setting].upper() == "YES":
+ response = "Ranger"
+ if hive_server_catalog in scf.items():
+ hive_props = scf.get_config(hive_server_catalog).properties
+ hive_props[hive_sec_property] = "true"
+ if old_ranger_setting in prop:
+ del prop[old_ranger_setting]
+
+ return response
+
def _substitute_handler(upgrade_catalog, tokens, value):
"""
Substitute handler
@@ -1275,6 +1297,8 @@ def _substitute_handler(upgrade_catalog, tokens, value):
value = value.replace(token, get_jt_host(upgrade_catalog))
elif token == "{ZOOKEEPER_QUORUM}":
value = value.replace(token, get_zookeeper_quorum())
+ elif token == "{HIVE_SECURITY_AUTHORIZATION}":
+ value = value.replace(token, get_hive_security_authorization_setting())
elif token == "{TEZ_HISTORY_URL_BASE}":
value = value.replace(token, get_tez_history_url_base())
elif token == "{RANGER_JDBC_DRIVER}":
http://git-wip-us.apache.org/repos/asf/ambari/blob/1d38d6ac/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.3.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.3.json b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.3.json
index d3694af..05ae509 100644
--- a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.3.json
+++ b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.3.json
@@ -29,6 +29,10 @@
"hive-site": {
"merged-copy": "yes"
},
+ "hive-env": {
+ "merged-copy": "yes",
+ "required-services": ["HIVE"]
+ },
"oozie-site": {
"merged-copy": "yes"
},
@@ -47,6 +51,13 @@
}
},
"properties": {
+ "hive-env": {
+ "hive_security_authorization": {
+ "value": "{HIVE_SECURITY_AUTHORIZATION}",
+ "template": "yes",
+ "override": "no"
+ }
+ },
"falcon-startup.properties": {
"*.application.services": "org.apache.falcon.security.AuthenticationInitializationService, org.apache.falcon.workflow.WorkflowJobEndNotificationService, org.apache.falcon.service.ProcessSubscriberService, org.apache.falcon.entity.store.ConfigurationStore, org.apache.falcon.rerun.service.RetryService, org.apache.falcon.rerun.service.LateRunService, org.apache.falcon.service.LogCleanupService",
"*.dfs.namenode.kerberos.principal": "nn/_HOST@EXAMPLE.COM",