ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhuvnesh2...@apache.org
Subject ambari git commit: AMBARI-16917: Use postgres database instead of template1 during service check in HAWQ (bhuvnesh2703)
Date Fri, 27 May 2016 23:16:58 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 24aca1254 -> 8721b56f8


AMBARI-16917: Use postgres database instead of template1 during service check in HAWQ (bhuvnesh2703)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8721b56f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8721b56f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8721b56f

Branch: refs/heads/branch-2.4
Commit: 8721b56f8d908a224e5f1cc89359285c1dd8cbd5
Parents: 24aca12
Author: Bhuvnesh Chaudhary <bhuvnesh2703@gmail.com>
Authored: Fri May 27 16:18:39 2016 -0700
Committer: Bhuvnesh Chaudhary <bhuvnesh2703@gmail.com>
Committed: Fri May 27 16:18:39 2016 -0700

----------------------------------------------------------------------
 .../2.0.0/package/alerts/alert_segment_registration_status.py     | 3 ++-
 .../HAWQ/2.0.0/package/alerts/alert_sync_status.py                | 3 ++-
 .../common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py  | 1 +
 .../resources/common-services/HAWQ/2.0.0/package/scripts/utils.py | 2 +-
 4 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8721b56f/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/alerts/alert_segment_registration_status.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/alerts/alert_segment_registration_status.py
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/alerts/alert_segment_registration_status.py
index 17724bc..ee8999e 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/alerts/alert_segment_registration_status.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/alerts/alert_segment_registration_status.py
@@ -28,6 +28,7 @@ HAWQ_HOME='/usr/local/hawq'
 HAWQ_GREENPLUM_PATH_FILE = "{0}/greenplum_path.sh".format(HAWQ_HOME)
 HAWQ_SLAVES_FILE= "{0}/etc/slaves".format(HAWQ_HOME)
 HAWQMASTER_PORT = '{{hawq-site/hawq_master_address_port}}'
+POSTGRES = 'postgres'
 
 RESULT_STATE_OK = 'OK'
 RESULT_STATE_WARNING = 'WARNING'
@@ -94,7 +95,7 @@ def get_segment_list_db(port):
   """
   logger.debug("Fetching segment list from HAWQ Master Database.")
   query = " SELECT hostname FROM gp_segment_configuration where role = 'p' and status = 'u'
"
-  cmd = "source {0} && psql -p {1} -t -d template1 -c \"{2};\"".format(HAWQ_GREENPLUM_PATH_FILE,
port, query)
+  cmd = "source {0} && psql -p {1} -t -d {2} -c \"{3};\"".format(HAWQ_GREENPLUM_PATH_FILE,
port, POSTGRES, query)
  
   returncode, command_output = call(cmd, user=HAWQ_USER, timeout=60)
   if returncode:

http://git-wip-us.apache.org/repos/asf/ambari/blob/8721b56f/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/alerts/alert_sync_status.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/alerts/alert_sync_status.py
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/alerts/alert_sync_status.py
index e916f07..8e5d7e5 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/alerts/alert_sync_status.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/alerts/alert_sync_status.py
@@ -23,6 +23,7 @@ from resource_management.core.shell import call
 
 HAWQ_USER = 'gpadmin'
 HAWQ_GREENPLUM_PATH_FILE = '/usr/local/hawq/greenplum_path.sh'
+POSTGRES = 'postgres'
 
 HAWQMASTER_PORT = '{{hawq-site/hawq_master_address_port}}'
 HAWQSTANDBY_ADDRESS = '{{hawq-site/hawq_standby_address_host}}'
@@ -81,7 +82,7 @@ def get_sync_status(port):
   """
   
   query = "SELECT summary_state, error_message FROM gp_master_mirroring"
-  cmd = "source {0} && psql -p {1} -t --no-align -d template1 -c \"{2};\"".format(HAWQ_GREENPLUM_PATH_FILE,
port, query)
+  cmd = "source {0} && psql -p {1} -t --no-align -d {2} -c \"{3};\"".format(HAWQ_GREENPLUM_PATH_FILE,
port, POSTGRES, query)
 
   returncode, output = call(cmd, user=HAWQ_USER, timeout=60)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8721b56f/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py
index 4a75a78..1804f11 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py
@@ -28,6 +28,7 @@ CLUSTER = "cluster"
 IMMEDIATE = "immediate"
 FAST = "fast"
 ACTIVATE = "activate"
+POSTGRES = "postgres"
 
 # Users
 root_user = "root"

http://git-wip-us.apache.org/repos/asf/ambari/blob/8721b56f/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/utils.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/utils.py
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/utils.py
index f37b13f..12d3511 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/utils.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/utils.py
@@ -87,7 +87,7 @@ def exec_ssh_cmd(hostname, cmd):
   return process.returncode, stdout, stderr
 
 
-def exec_psql_cmd(command, host, port, db="template1", tuples_only=True):
+def exec_psql_cmd(command, host, port, db=hawq_constants.POSTGRES, tuples_only=True):
   """
   Sets up execution environment and runs the HAWQ queries
   """


Mime
View raw message