Przeglądaj źródła

AMBARI-15856. Getting WARNING on ambari server setup + start (aonishuk)

Andrew Onishuk 9 lat temu
rodzic
commit
12b00a4d99

+ 6 - 1
ambari-server/src/main/python/ambari_server/serverClassPath.py

@@ -33,7 +33,9 @@ AMBARI_SERVER_LIB = "AMBARI_SERVER_LIB"
 JDBC_DRIVER_PATH_PROPERTY = "server.jdbc.driver.path"
 JAR_FILE_PATTERN = re.compile(r'^(.*)(-\d.*\.jar$)')
 AMBARI_SERVER_JAR_FILE_PATTERN = re.compile(r'^ambari-server(-\d.*\.jar$)')
-
+JAR_DUPLICATES_TO_IGNORE = [
+  'javax.servlet.jsp.jstl', # org.eclipse.jetty dependency requires two different libraries with this name
+]
 
 class ServerClassPath():
 
@@ -126,6 +128,9 @@ class ServerClassPath():
       match = JAR_FILE_PATTERN.match(os.path.basename(jar))
       if match:
         for group in match.groups():
+          if group in JAR_DUPLICATES_TO_IGNORE:
+            break
+          
           if group in jar_names:
             err = "Multiple versions of {0}.jar found in java class path " \
                   "({1} and {2}). \n Make sure that you include only one " \

+ 2 - 1
ambari-server/src/main/python/ambari_server/serverConfiguration.py

@@ -889,7 +889,8 @@ def store_password_file(password, filename):
     passFile.write(password)
   print_info_msg("Adjusting filesystem permissions")
   ambari_user = read_ambari_user()
-  set_file_permissions(passFilePath, "660", ambari_user, False)
+  if ambari_user: # at the first install ambari_user can be None. Which is fine since later on password.dat is chowned with the correct ownership.
+    set_file_permissions(passFilePath, "660", ambari_user, False)
 
   #Windows paths need double backslashes, otherwise the Ambari server deserializer will think the single \ are escape markers
   return passFilePath.replace('\\', '\\\\')