Repository: incubator-hawq Updated Branches: refs/heads/master 0079c2d68 -> 8f5aceb91
HAWQ-1451. HAWQ state should be able to report the status of both RPS and standby RPS Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/8f5aceb9 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/8f5aceb9 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/8f5aceb9 Branch: refs/heads/master Commit: 8f5aceb91b4db57dd6fc6ad12ebac7252d4a3296 Parents: 0079c2d Author: stanlyxiang <[email protected]> Authored: Wed May 3 15:28:43 2017 +0800 Committer: Wen Lin <[email protected]> Committed: Thu May 4 11:55:33 2017 +0800 ---------------------------------------------------------------------- tools/bin/hawqstate | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8f5aceb9/tools/bin/hawqstate ---------------------------------------------------------------------- diff --git a/tools/bin/hawqstate b/tools/bin/hawqstate index 7dd1f4f..5f623d9 100755 --- a/tools/bin/hawqstate +++ b/tools/bin/hawqstate @@ -71,8 +71,8 @@ def get_guc_value(guc): if row[0] == guc: return row[1] -def check_rps_status(): - hawq_rps_address_host = get_guc_value("hawq_rps_address_host") +def check_rps_status(master_or_standby): + hawq_rps_address_host = get_guc_value(master_or_standby) hawq_rps_address_port = get_guc_value("hawq_rps_address_port") hawq_rps_address_suffix = get_guc_value("hawq_rps_address_suffix") params = ["curl --connect-timeout 2 http://", hawq_rps_address_host.strip(), ":", hawq_rps_address_port.strip(), "/", hawq_rps_address_suffix.strip(), "/version"] @@ -126,6 +126,9 @@ def show_brief_status(hawq_site, segment_list, standby_host): seg_pid_file_path = hawq_site.hawq_dict['hawq_segment_directory'] + "/postmaster.pid" total_seg_pid_file_found = len(check_file_exist_list(seg_pid_file_path, segment_list, '' )) total_seg_pid_file_miss = total_seg_num - total_seg_pid_file_found + hawq_acl_type = "standalone" + if 'hawq_acl_type' in hawq_site.hawq_dict: + hawq_acl_type = hawq_site.hawq_dict['hawq_acl_type'] logger.info("- HAWQ instance status summary") logger.info("-----------------------------------------------------") logger.info("- Master instance = %s" % master_status) @@ -135,12 +138,14 @@ def show_brief_status(hawq_site, segment_list, standby_host): else: logger.info("- No Standby master defined ") logger.info("- Total segment instance count from config file = %s"% total_seg_num) - if 'hawq_acl_type' in hawq_site.hawq_dict: - hawq_acl_type = hawq_site.hawq_dict['hawq_acl_type'] - logger.info("- Current HAWQ acl type = %s" % hawq_acl_type) - if hawq_acl_type == "ranger": - hawq_rps_status = check_rps_status() - logger.info("- HAWQ Ranger plugin service state = %s" % hawq_rps_status) + logger.info("-----------------------------------------------------") + logger.info("- Current HAWQ acl type = %s" % hawq_acl_type) + if hawq_acl_type == "ranger": + hawq_master_rps_status = check_rps_status('hawq_master_address_host') + logger.info("- HAWQ master Ranger plugin service state = %s" % hawq_master_rps_status) + if 'hawq_standby_address_host' in hawq_site.hawq_dict: + hawq_standby_rps_status = check_rps_status('hawq_standby_address_host') + logger.info("- HAWQ standby Ranger plugin service state = %s" % hawq_standby_rps_status) logger.info("----------------------------------------------------- ") logger.info("- Segment Status ") logger.info("----------------------------------------------------- ")
