You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by di...@apache.org on 2017/07/22 02:36:38 UTC
ambari git commit: AMBARI-21555 Hive restart fails to restart MySQL
after Ambari upgrade against IOP 4.2.5 (dili)
Repository: ambari
Updated Branches:
refs/heads/branch-2.5 f0b03147f -> 61df6972d
AMBARI-21555 Hive restart fails to restart MySQL after Ambari upgrade against IOP 4.2.5 (dili)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/61df6972
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/61df6972
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/61df6972
Branch: refs/heads/branch-2.5
Commit: 61df6972d3105baf2dd7718fe0d26c711d23beed
Parents: f0b0314
Author: Di Li <di...@apache.org>
Authored: Fri Jul 21 22:35:58 2017 -0400
Committer: Di Li <di...@apache.org>
Committed: Fri Jul 21 22:35:58 2017 -0400
----------------------------------------------------------------------
.../server/upgrade/UpgradeCatalog252.java | 31 ++++++++++++++++++++
1 file changed, 31 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/61df6972/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog252.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog252.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog252.java
index ea1b034..ca7ab3f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog252.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog252.java
@@ -27,6 +27,7 @@ import java.util.Map;
import java.util.Set;
import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.controller.AmbariManagementController;
import org.apache.ambari.server.orm.DBAccessor.DBColumnInfo;
import org.apache.ambari.server.orm.dao.ClusterDAO;
import org.apache.ambari.server.orm.entities.ClusterConfigMappingEntity;
@@ -36,6 +37,7 @@ import org.apache.ambari.server.state.Clusters;
import org.apache.ambari.server.state.Config;
import org.apache.ambari.server.state.ConfigHelper;
import org.apache.ambari.server.state.PropertyInfo;
+import org.apache.ambari.server.state.StackId;
import org.apache.commons.lang.StringUtils;
import com.google.common.collect.Sets;
@@ -63,6 +65,9 @@ public class UpgradeCatalog252 extends AbstractUpgradeCatalog {
private static final String CLUSTER_ENV = "cluster-env";
+ private static final String HIVE_ENV = "hive-env";
+ private static final String MARIADB_REDHAT_SUPPORT = "mariadb_redhat_support";
+
private static final List<String> configTypesToEnsureSelected = Arrays.asList("spark2-javaopts-properties");
/**
@@ -119,6 +124,7 @@ public class UpgradeCatalog252 extends AbstractUpgradeCatalog {
protected void executeDMLUpdates() throws AmbariException, SQLException {
resetStackToolsAndFeatures();
ensureConfigTypesHaveAtLeastOneVersionSelected();
+ updateMariaDBRedHatSupportHive();
}
/**
@@ -296,4 +302,29 @@ public class UpgradeCatalog252 extends AbstractUpgradeCatalog {
}
}
}
+
+ /**
+ * Insert mariadb_redhat_support to hive-env if the current stack is BigInsights 4.2.5
+ * @throws AmbariException
+ * */
+ private void updateMariaDBRedHatSupportHive() throws AmbariException {
+ AmbariManagementController ambariManagementController = injector.getInstance(AmbariManagementController.class);
+ Clusters clusters = ambariManagementController.getClusters();
+ if (clusters != null) {
+ Map<String, Cluster> clusterMap = getCheckedClusterMap(clusters);
+ if (clusterMap != null && !clusterMap.isEmpty()) {
+ for (final Cluster cluster : clusterMap.values()) {
+ Set<String> installedServices = cluster.getServices().keySet();
+ if (installedServices.contains("HIVE")) {
+ StackId currentStack = cluster.getCurrentStackVersion();
+ if (currentStack.getStackName().equals("BigInsights") && currentStack.getStackVersion().equals("4.2.5")) {
+ Map<String, String> newProperties = new HashMap<>();
+ newProperties.put(MARIADB_REDHAT_SUPPORT, "true");
+ updateConfigurationPropertiesForCluster(cluster, HIVE_ENV, newProperties, true, false);
+ }
+ }
+ }
+ }
+ }
+ }
}