HAWQ state should be able to report the status of both RPS and standby RPS
@@ -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("-----------------------------------------------------")
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)
+ 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("----------------------------------------------------- ")
