Przeglądaj źródła

AMBARI-2345. ambari-server setup flow is confusing when the user does not have the Oracle client installed. (mahadev)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1491553 13f79535-47bb-0310-9956-ffa450edef68
Mahadev Konar 12 lat temu
rodzic
commit
54c27e6a4a
1 zmienionych plików z 19 dodań i 16 usunięć
  1. 19 16
      ambari-server/src/main/python/ambari-server.py

+ 19 - 16
ambari-server/src/main/python/ambari-server.py

@@ -912,7 +912,7 @@ def check_jdbc_drivers(args):
   result = find_jdbc_driver(args)
   if result == -1:
     msg = 'WARNING: Before starting Ambari Server, ' \
-          'the {0} JDBC driver JAR file must be placed to {1}. Press enter to continue.'.format(
+          'the {0} JDBC driver JAR file must be copied to {1}. Press enter to continue.'.format(
       DATABASE_FULL_NAMES[args.database],
       JAVA_SHARE_PATH
     )
@@ -950,6 +950,21 @@ def setup(args):
   print 'Configuring database...'
   prompt_db_properties(args)
 
+  print 'Checking JDK...'
+  retcode = download_jdk(args)
+  if not retcode == 0:
+    print_error_msg ('Downloading or installing JDK failed. Exiting.')
+    sys.exit(retcode)
+
+  print 'Completing setup...'
+  retcode = configure_os_settings()
+  if not retcode == 0:
+    print_error_msg ('Configure of OS settings in '
+                   'ambari.properties failed. Exiting.')
+    sys.exit(retcode)
+  
+  #DB setup should be done last after doing any setup.
+  
   if is_local_database(args):
     print 'Default properties detected. Using built-in database.'
     store_local_properties(args)
@@ -984,7 +999,7 @@ def setup(args):
     print 'Configuring remote database connection properties...'
     retcode = setup_remote_db(args)
     if retcode == -1:
-      # means the cli was not found
+      #means the cli was not found
       sys.exit(retcode)
       
     if not retcode == 0:
@@ -992,20 +1007,6 @@ def setup(args):
       sys.exit(retcode)
 
 
-
-  print 'Checking JDK...'
-  retcode = download_jdk(args)
-  if not retcode == 0:
-    print_error_msg ('Downloading or installing JDK failed. Exiting.')
-    sys.exit(retcode)
-
-  print 'Completing setup...'
-  retcode = configure_os_settings()
-  if not retcode == 0:
-    print_error_msg ('Configure of OS settings in '
-                   'ambari.properties failed. Exiting.')
-    sys.exit(retcode)
-
   if args.warnings:
     print "Ambari Server 'setup' finished with warnings:"
     for warning in args.warnings:
@@ -1573,6 +1574,8 @@ def store_local_properties(args):
   except Exception, e:
     print 'Could not read ambari config file "%s": %s' % (conf_file, e)
     return -1
+  properties.removeOldProp(JDBC_SCHEMA_PROPERTY)
+  properties.removeOldProp(JDBC_HOSTNAME_PROPERTY)
   properties.removeOldProp(JDBC_DATABASE_PROPERTY)
   properties.removeOldProp(JDBC_RCA_DRIVER_PROPERTY)
   properties.removeOldProp(JDBC_RCA_URL_PROPERTY)