0

I have installed greenplum in a AWS linux system and when i am trying to connect to greenplum from java code i am getting an error :

exception in thread "main" org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

How to solve this issue?

user10512791
  • 63
  • 1
  • 13
  • Did u add the user which you are trying to connect from java code in pg_hba config file? – Anuraag Veerapaneni Jan 21 '19 at 09:40
  • i am unable to find that file, where can i find it in linux and do i need to add ip address of my local system? @AnuraagVeerapaneni – user10512791 Jan 21 '19 at 09:50
  • usually it presents in path "/data/master/gpseg-1/pg_hba.conf". For more info go through this link https://stackoverflow.com/questions/20825734/postgresql-connection-refused-check-that-the-hostname-and-port-are-correct-an – Anuraag Veerapaneni Jan 22 '19 at 06:38
  • getting same error , greenplum is on xx.xx.xxx.xxx and i am connecting to greenplum from my java code in local system. I have added listen_addresses ='*' and host all all 0.0.0.0/0 md5 in pg_hba.conf . why am i still facing the issue? @AnuraagVeerapaneni – user10512791 Jan 23 '19 at 14:04
  • First, can you check that the master is listening on 0.0.0.0, port 5432? The "netstat" command will tell you. Second, can you reach the master from your local machine, using "telnet" or "netcat", on the designated port? – A. Scherbaum Jan 23 '19 at 19:56

0 Answers0