Pivotal Knowledge Base

Follow

Starting a GPCC instance fails with "could not connect to server: Connection refused"

Environment

Product Version
Pivotal Greenplum (GPDB) 4.3.x
OS RHEL 6.x

Symptom

When attempting to start a Pivotal Greenplum Command Center (GPCC) instance, it fails with the error message “could not connect to server: Connection refused”.

Error Message:

[gpadmin@mdw]$ gpcmdr --start "db4382"
Traceback (most recent call last):
File "/usr/local/greenplum-cc-web-2.3.0-build-51/bin/gpcmdr.py", line 1638, in <module>
run()
File "/usr/local/greenplum-cc-web-2.3.0-build-51/bin/gpcmdr.py", line 1490, in run
create_master_log_ext_table(cfg)
File "/usr/local/greenplum-cc-web-2.3.0-build-51/bin/gpcmdr.py", line 1448, in create_master_log_ext_table
raise Exception, 'Exception encountered while fetching GPDB version info %s' % err
Exception: Exception encountered while fetching GPDB version info Connection error for query
CREATE OR REPLACE FUNCTION create_master_log_tbl() RETURNS void AS
$$
BEGIN
IF EXISTS (SELECT * FROM pg_catalog.pg_tables WHERE schemaname = 'public' AND tablename = 'gp_log_master_ext') THEN
NULL;
ELSE
CREATE EXTERNAL WEB TABLE public.gp_log_master_ext (LIKE gp_toolkit.__gp_log_master_ext)
EXECUTE E'find $GP_SEG_DATADIR/pg_log/ -name "gpdb*.csv" | sort -r | head -n 2 | xargs cat'
ON MASTER FORMAT 'csv' (delimiter E',' null E'' escape E'"' quote E'"') ENCODING 'UTF8';
END IF;

END;
$$ LANGUAGE plpgsql;

SELECT create_master_log_tbl();
: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?

Cause

There is a defect in the gpcmdr utility which causes it to skip reading the GPCC instance configuration file, gpperfmonui.conf. And if environment variables PGHOST and PGPORT are not correctly set, gpcmdr will use "localhost:5432" to establish a connection to the remote database.

Resolution

The issue has been reported to engineering via an internal JIRA. One workaround could be to modify gpcmdr to read the gpperfmonui.conf file correctly. Please refer to the JIRA for details.

If modification of gpcmdr is not an option, then another workaround is to set PGHOST/PGPORT first before running gpcmdr. An example is shown below:

[gpadmin@mdw ~]$ export PGHOST=mdw
[gpadmin@mdw ~]$ export PGPORT=3000
[gpadmin@mdw ~]$ gpcmdr --start "db4382"

Additional Information

Internal JIRA CMDR-1999 

Comments

Powered by Zendesk