Browse Source

AMBARI-9955: Ambari-Server and Ambari-Agent fail to start on Windows (jluniya)

Jayush Luniya 10 years ago
parent
commit
4894eabd5d

+ 2 - 0
ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java

@@ -1343,6 +1343,8 @@ public class Configuration {
       databaseType = DatabaseType.MYSQL;
     } else if (dbUrl.contains(DatabaseType.DERBY.getName())) {
       databaseType = DatabaseType.DERBY;
+    } else if (dbUrl.contains(DatabaseType.SQL_SERVER.getName())) {
+      databaseType = DatabaseType.SQL_SERVER;
     } else {
       throw new RuntimeException(
           "The database type could be not determined from the JDBC URL "

+ 4 - 0
ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py

@@ -183,6 +183,10 @@ class NameNode(Script):
     threshold = name_node_parameters['threshold']
     _print("Starting balancer with threshold = %s\n" % threshold)
 
+    if params.security_enabled:
+      Execute(format("{kinit_path_local} -kt {hdfs_user_keytab} {hdfs_principal_name}"),
+              user = params.hdfs_user)
+
     def calculateCompletePercent(first, current):
       return 1.0 - current.bytesLeftToMove/first.bytesLeftToMove
 

+ 3 - 0
ambari-server/src/test/java/org/apache/ambari/server/configuration/ConfigurationTest.java

@@ -437,5 +437,8 @@ public class ConfigurationTest {
 
     ambariProperties.setProperty(Configuration.SERVER_JDBC_URL_KEY, "jdbc:derby://server");
     Assert.assertEquals( DatabaseType.DERBY, configuration.getDatabaseType() );
+
+    ambariProperties.setProperty(Configuration.SERVER_JDBC_URL_KEY, "jdbc:sqlserver://server");
+    Assert.assertEquals( DatabaseType.SQL_SERVER, configuration.getDatabaseType() );
   }
 }