Обсуждение: Canot access PostgreSQL via psql -h (Vmware Fusion)
Hi all; I've fired up 2 CentOS 6.2 VM's via vmware fusion 5 (on a mac). I disables selinux on both, and installed postgres 8.4.13 on both VM's I set listen_addresses = '*' and I added a trust entry for each server in the opposite server's pg_hba.conf file. However I cannot access one server from the other one via psql -h <I.P. address> I get the standard error: psql -h 192.168.91.145 psql: could not connect to server: No route to host Is the server running on host "192.168.91.145" and accepting TCP/IP connections on port 5432? I can ssh between servers, I see no entry in the postgres log per the connection attempt (I have log_connections set to on) Currently I have networking set to "share with my mac" or NAT. I tried setting networking to "Private to my mac" with thesame results. Tried Autodetect (Bridged) as well, no luck Can anyone help me debug this? Thanks in advance
Hi, are there any firewalls up (check iptabled) ? try running telnet 192.168.91.145 5432 what is happening ? regards, Andreas On 08/24/2012 06:15 AM, CS DBA wrote: > Hi all; > > I've fired up 2 CentOS 6.2 VM's via vmware fusion 5 (on a mac). > > I disables selinux on both, and installed postgres 8.4.13 on both VM's > > I set listen_addresses = '*' > and I added a trust entry for each server in the opposite server's pg_hba.conf file. > > However I cannot access one server from the other one via psql -h <I.P. address> > > I get the standard error: > > psql -h 192.168.91.145 > psql: could not connect to server: No route to host > Is the server running on host "192.168.91.145" and accepting > TCP/IP connections on port 5432? > > > I can ssh between servers, I see no entry in the postgres log per the connection attempt (I have log_connections set toon) > > Currently I have networking set to "share with my mac" or NAT. I tried setting networking to "Private to my mac" withthe same results. Tried Autodetect (Bridged) as well, no luck > > > Can anyone help me debug this? > > Thanks in advance >
CS DBA <cs_dba@consistentstate.com> wrote: > I've fired up 2 CentOS 6.2 VM's via vmware fusion 5 (on a mac). > psql -h 192.168.91.145 > psql: could not connect to server: No route to host That problem has nothing to do with PostgreSQL; you might have better luck on a list related to the other technologies. FWIW, on Linux I would start with `netstat -plnt` to see if the process was listening on the expected port and host address. -Kevin
On Fri, Aug 24, 2012 at 7:08 AM, Kevin Grittner <Kevin.Grittner@wicourts.gov> wrote: > CS DBA <cs_dba@consistentstate.com> wrote: > >> I've fired up 2 CentOS 6.2 VM's via vmware fusion 5 (on a mac). > >> psql -h 192.168.91.145 >> psql: could not connect to server: No route to host > > That problem has nothing to do with PostgreSQL; you might have > better luck on a list related to the other technologies. > > FWIW, on Linux I would start with `netstat -plnt` to see if the > process was listening on the expected port and host address. Or even simpler, do ifconfig and make sure that you have the right IP address, followed by "ping 192.168.91.145" (assuming that's the right address) to see if your network is even running. Another thing to try: psql -h localhost Craig
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes: > CS DBA <cs_dba@consistentstate.com> wrote: >> psql: could not connect to server: No route to host > That problem has nothing to do with PostgreSQL; you might have > better luck on a list related to the other technologies. > FWIW, on Linux I would start with `netstat -plnt` to see if the > process was listening on the expected port and host address. "No route to host" doesn't have anything to do with whether there's anything listening on the target port ... what's more likely is that the OP mistyped the IP address, or else there's something wrong with his network layout, interface netmask assignments, that sort of thing. regards, tom lane
On Fri, 24 Aug 2012 10:35:54 -0400, Tom Lane wrote: > "No route to host" doesn't have anything to do with whether there's > anything listening on the target port ... what's more likely is that the > OP mistyped the IP address, or else there's something wrong with his > network layout, interface netmask assignments, > that sort of thing. I don't know about VMWare, but with VirtualBox if you set up two guests with NAT they are sharing the host's IP address as far as the outside world is concerned. So each can see the host and the outside world, but they can't see one another.
He wrote: "I can ssh between servers," regards, Andreas On 08/24/2012 06:57 PM, Walter Hurry wrote: > On Fri, 24 Aug 2012 10:35:54 -0400, Tom Lane wrote: > >> "No route to host" doesn't have anything to do with whether there's >> anything listening on the target port ... what's more likely is that the >> OP mistyped the IP address, or else there's something wrong with his >> network layout, interface netmask assignments, >> that sort of thing. > I don't know about VMWare, but with VirtualBox if you set up two guests > with NAT they are sharing the host's IP address as far as the outside > world is concerned. So each can see the host and the outside world, but > they can't see one another. > > > >
Hi! Try to check the iptables. If you don't need a firewall just disable it. As root, try the following: service iptables status service iptables stop To disable it from starting at boot time, use: chkconfig iptables off Regards, Anderson Lunz. On 2012-08-24, at 00:15, CS DBA wrote: > Hi all; > > I've fired up 2 CentOS 6.2 VM's via vmware fusion 5 (on a mac). > > I disables selinux on both, and installed postgres 8.4.13 on both VM's > > I set listen_addresses = '*' > and I added a trust entry for each server in the opposite server's pg_hba.conf file. > > However I cannot access one server from the other one via psql -h <I.P. address> > > I get the standard error: > > psql -h 192.168.91.145 > psql: could not connect to server: No route to host > Is the server running on host "192.168.91.145" and accepting > TCP/IP connections on port 5432? > > > I can ssh between servers, I see no entry in the postgres log per the connection attempt (I have log_connections set toon) > > Currently I have networking set to "share with my mac" or NAT. I tried setting networking to "Private to my mac" withthe same results. Tried Autodetect (Bridged) as well, no luck > > > Can anyone help me debug this? > > Thanks in advance > > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin