Connection refused.Check that hostname and port are correct and the postmaster is accepting TCP/IP connections
<p>I have Virtual Box installed where two instances of Centos are running. Lets 
call them Centos 1 and Centos 2. I have successfully setup Confluence application on Centos with localhost Postgres DB in Centos 1.</p>

<p>The Problem:</p>

<p>When I am trying to setup confluence in Centos 2 it requires DB Connection If I provide the URL with the jdbc syntax it does not connect to the DB instance of Centos 1.</p>

<p>JDBC URL:  <code>jdbc:postgresql://192.168.56.13:5432/confluence</code></p>

<blockquote>
  <p>The Error:org.postgresql.util.PSQLException: Connection refused.Check that hostname and port are correct and the postmaster is accepting TCP/IP connections.</p>
</blockquote>

<p>The nmap command from instance two to instance 1 is successful.</p>

<p>I am trying to edit the configuration as shown below
<a href="https://confluence.atlassian.com/confkb/confluence-postgresql-jdbc-direct-connection-refused-683543784.html" rel="nofollow">https://confluence.atlassian.com/confkb/confluence-postgresql-jdbc-direct-connection-refused-683543784.html</a></p>

<p>But I get a error when I give the command service postgresql restart
I guess it is not taking my entry of
host all all 192.168.56.105 trust</p>

<p>Please Clarify.</p>