2013-09-29 37 views
0

我的服務器是Debian的7,我使用PostgreSQL 9.3。爲什麼我的PostgreSQL沒有找到我的主機

這是我的hosts文件:

[email protected]:/etc# cat hosts 
127.0.0.1  localhost.localdomian localhost 
127.0.1.1  virtualserver.com  virtualserver 

# The following lines are desirable for IPv6 capable hosts 
::1  localhost ip6-localhost ip6-loopback 
ff02::1 ip6-allnodes 
ff02::2 ip6-allrouters 

而當我想啓動PSQL的一個新的控制檯:

[email protected]:/var/lib/postgresql/9.3/main# service postgresql restart 
[ ok ] Restarting PostgreSQL 9.3 database server: main. 
[email protected]:/var/lib/postgresql/9.3/main# sudo -u postgres psql 
sudo: unable to resolve host localhost.localdomain 
psql (9.3.0) 
Type "help" for help. 

你可以看到,機器不能找到localhsot.localdomain 。但我更改了根文件,並在我的/etc/hosts文件中將其更正爲正確,然後重新啓動它。

+0

在你的'hosts'它說'localdomian',應該是'localdomain'。 – vstm

+0

它涉及到'/等/ host.conf',你應該改變'order'行'爲了主機,bind' – PersianGulf

+4

這個問題似乎是題外話,因爲它是關於錯字錯 – user504909

回答

0

你的/ etc/hosts中有一個錯字,它應該是:

127.0.0.1  localhost.localdomain localhost 
127.0.1.1  virtualserver.com  virtualserver 

# The following lines are desirable for IPv6 capable hosts 
::1  localhost ip6-localhost ip6-loopback 
ff02::1 ip6-allnodes 
ff02::2 ip6-allrouters 

LOCALDOMAIN被拼寫localdomIAn。

相關問題