Repository: ambari Updated Branches: refs/heads/trunk ec6ba0abb -> 1bf025988
AMBARI-19654. Increase ambari server timeout for checking PID file and other log improvements (Madhuvanthi Radhakrishnan via smohanty) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1bf02598 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1bf02598 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1bf02598 Branch: refs/heads/trunk Commit: 1bf025988d1bd1ca4bbce6ff8fb7dea21091a3c2 Parents: ec6ba0a Author: Sumit Mohanty <[email protected]> Authored: Fri Jan 20 15:20:01 2017 -0800 Committer: Sumit Mohanty <[email protected]> Committed: Fri Jan 20 15:20:01 2017 -0800 ---------------------------------------------------------------------- .../src/main/python/ambari_server_main.py | 21 ++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/1bf02598/ambari-server/src/main/python/ambari_server_main.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/python/ambari_server_main.py b/ambari-server/src/main/python/ambari_server_main.py index 11958cb..7a21333 100644 --- a/ambari-server/src/main/python/ambari_server_main.py +++ b/ambari-server/src/main/python/ambari_server_main.py @@ -117,6 +117,7 @@ CHECK_DATABASE_SKIPPED_PROPERTY = "check_database_skipped" AMBARI_SERVER_DIE_MSG = "Ambari Server java process died with exitcode {0}. Check {1} for more information." AMBARI_SERVER_NOT_STARTED_MSG = "Ambari Server java process hasn't been started or can't be determined." +AMBARI_SERVER_STARTED_SUCCESS_MSG = "Ambari Server has started successfully" # linux open-file limit ULIMIT_OPEN_FILES_KEY = 'ulimit.open.files' @@ -224,6 +225,7 @@ def wait_for_server_start(pidFile, scmStatus): locate_all_file_paths('bash', '/bin') + locate_all_file_paths('dash', '/bin'), IS_FOREGROUND): server_started = True + sys.stdout.write("Server PID determined " + AMBARI_SERVER_STARTED_SUCCESS_MSG + "\n") break else: sys.stdout.write("Unable to determine server PID. Retrying...\n") @@ -241,16 +243,19 @@ def wait_for_server_start(pidFile, scmStatus): else: exception = FatalException(-1, AMBARI_SERVER_NOT_STARTED_MSG) - if 'Database consistency check: failed' in open(configDefaults.SERVER_OUT_FILE).read(): - print "DB configs consistency check failed. Run \"ambari-server start --skip-database-check\" to skip. " \ - "You may try --auto-fix-database flag to attempt to fix issues automatically. " \ - "If you use this \"--skip-database-check\" option, do not make any changes to your cluster topology " \ - "or perform a cluster upgrade until you correct the database consistency issues. See " + \ + if os.path.isfile(configDefaults.SERVER_OUT_FILE): + if 'Database consistency check: failed' in open(configDefaults.SERVER_OUT_FILE).read(): + print "DB configs consistency check failed. Run \"ambari-server start --skip-database-check\" to skip. " \ + "You may try --auto-fix-database flag to attempt to fix issues automatically. " \ + "If you use this \"--skip-database-check\" option, do not make any changes to your cluster topology " \ + "or perform a cluster upgrade until you correct the database consistency issues. See " + \ configDefaults.DB_CHECK_LOG + " for more details on the consistency issues." - elif 'Database consistency check: warning' in open(configDefaults.SERVER_OUT_FILE).read(): - print "DB configs consistency check found warnings. See " + configDefaults.DB_CHECK_LOG + " for more details." + elif 'Database consistency check: warning' in open(configDefaults.SERVER_OUT_FILE).read(): + print "DB configs consistency check found warnings. See " + configDefaults.DB_CHECK_LOG + " for more details." + else: + print "DB configs consistency check: no errors and warnings were found." else: - print "DB configs consistency check: no errors and warnings were found." + sys.stdout.write(configDefaults.SERVER_OUT_FILE + " does not exist") if exception: raise exception
