2

I used pg_isready -h localhost which gives output as localhost:5432 - accepting connections

But when i used my host-ip instead of localhost ,it gives output as pg_isready -h 18.191.7.185 output is 18.191.7.185:5432 - no response

My localhost isn't my ip-address?

1 Answer 1

1

No, it isn't. Verify with

ping localhost

which will show you the IP address that localhost resolves to.

The “loopback interface” is a special network interface that only contains your computer.

The cause of the problem is probably that the PostgreSQL parameter listen_addresses, which specifies the network interfaces on which PostgreSQL is listening, is set to the default value localhost.

Change the value to * and restart PostgreSQL, and it should work.

A second possibility is that you have restrictive firewall settings on your machine. Actually, reading your question again, that is probably your problem, since you are receiving no response rather that an error saying that nothing is listening on that port.

Sign up to request clarification or add additional context in comments.

6 Comments

ping localhost gives ip as '127.0.0.1' and pg_isready -h 127.0.0.1 is accepting connections. but my host-ip is different not 127.0.0.1. I also changes listen_addresses to '*' ..still not working
Exactly, that confirms my answer (the last paragraph). Disable the firewall and try again.
I did by sudo ufw disable but didn't work..FYI i am on kuberenetes master node and hostname -I doesn't list my ip-address as well.
You should ask your system administrator for help.
well i am student ..not working somewhere.. so no system administrator..anyway thanks for you help
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.