我已经安装了Centos 6.4的VPS。 我曾经在Digital Ocean有一个VPS,当我启动绑定到本地主机的PostgreSQL或Monit时,他们都能正常工作。 但是在新的VPS上,当我有PostgreSQL监听“localhost”时,PostgreSQL说:
WARNING: could not create listen socket for "localhost"
Monit,当我告诉Monit听“localhost”的时候,Monit说:
http server: Could not create a server socket at port 2812 -- Cannot assign requested address
我不知道什么是我的VPS导致这种行为可能是错的。 如果我有PostgreSQL在'*'上而不是“本地主机”,那么它运行得很好。
更新 :
我的ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:50:56:0A:01:3D inet addr:xxx.xx.xxx.xxx Bcast:103.27.236.127 Mask:255.255.255.192 inet6 addr: fe80::250:56ff:fe0a:13d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:198875 errors:0 dropped:0 overruns:0 frame:0 TX packets:49492 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:135854898 (129.5 MiB) TX bytes:7779876 (7.4 MiB) lo Link encap:Local Loopback LOOPBACK MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
我的/etc/hosts
127.0.0.1 localhost.localdomain localhost localhost4 localhost4.localdomain4 CentOS64 ::1 localhost localhost.localdomain localhost6.localdomain6 localhost6
你的界面已经closures了。 请注意,它明确没有说它是UP ,并没有其关联的IP地址127.0.0.1。 我不知道会如何发生,因为这应该总是提出来。
如果lo界面closures,程序不能绑定或连接到本地主机。
把它自己提起来:
ifup lo