2015-06-19 103 views
1

我開始postgres服務器沒有運氣。我可以從終端向postgres添加新的數據庫,表格等,但不能通過網頁將其添加到表格中。該網頁現在在本地主機上運行。開始Postgres服務器

Postgres的數據文件夾最初在根用戶創建的,但我把它搬到我自己的用戶帳戶,它解決了很多問題,但我回到了老錯誤進入postgres -D data後,我不斷收到(數據是數據集羣文件夾)

EDT LOG: could not bind IPv4 socket: Address already in use 
2015-06-18 11:11:35 EDT HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. 
2015-06-18 11:11:35 EDT LOG: could not bind IPv6 socket: Address already in use 
2015-06-18 11:11:35 EDT HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. 
2015-06-18 11:11:35 EDT WARNING: could not create listen socket for "*" 
2015-06-18 11:11:35 EDT FATAL: could not create any TCP/IP sockets 

我嘗試了兩個不同的命令來啓動服務器。

pg_ctl -D data -l logfile start 

這給了我這一點,但它是不正確

server starting 

pg_ctl -D /Library/PostgreSQL/9.4/data -l log file start 

這給了我這個

LOG: skipping missing configuration file "/Library/PostgreSQL/9.4/data/postgresql.auto.conf" 
pg_ctl: another server might be running; trying to start server anyway 
server starting 

的postgresql.auto.conf文件絕對有正確的名字a找到一切。如果我試圖阻止所謂的啓動服務器,則會導致這種情況,第一個命令是我嘗試的第一個命令,第二個命令是第二個命令。

Is server running? 

LOG: skipping missing configuration file "/Library/PostgreSQL/9.4/data/postgresql.auto.conf" 
pg_ctl: could not send stop signal (PID: 83): Operation not permitted 

回答

1

東西似乎已經使用端口5432

試着找出哪個程序(可能是postgres的另一個實例)阻塞該端口並決定是否停止該另一個進程,或者不。

作爲替代重新配置postgres使用其他端口。

也許你可以找到,什麼是打字到控制檯阻斷端口:

lsof -n -i4TCP:5432 | grep LISTEN 
+0

的Postgres在端口5432確實已經運行的我不知道爲什麼,當我嘗試pg_ctl -D /庫/ PostgreSQL的/9.4/data狀態表示沒有服務器正在運行 – toast9

0

它清楚的是,運行的Postgres的另一個實例。在手動啓動您的設備之前,您必須停止該設置,因爲這會與端口號衝突。

sudo launchctl stop com.edb.launchd.postgresql-9.4

的嘗試和你的命令來啓動。