ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [1/2] ambari git commit: AMBARI-12399. Ambari 2.1 upgrade: Save yarn configs fails due to error from stack advisor (aonishuk)
Date Mon, 13 Jul 2015 18:35:14 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 a90d38114 -> 1d38d6ac9
  refs/heads/trunk 5bda17ca1 -> ac49cda91


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/ac49cda9
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ac49cda9
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ac49cda9

Branch: refs/heads/trunk
Commit: ac49cda9110ca22e32def56a83bbb6a3e3f41e12
Parents: 5bda17c
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Mon Jul 13 21:34:43 2015 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Mon Jul 13 21:34:43 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/ac49cda9/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/ac49cda9/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",


Mime
View raw message