2015-12-01 66 views
2

我正在運行postgres-k /tmp/tmp-postgres/,但我得到一個端口衝突vs我的主要postgres。Postgres端口衝突與-k

我正在運行另一個postgres在該端口上偵聽,但我的印象是使用套接字目錄集運行將使它使用unix套接字而不是tcp,並且它不需要tcp端口。我究竟做錯了什麼?

/usr/lib/postgresql/9.4/bin/postgres -F -k /tmp/tmp-postgres/ -D /tmp/tmp-postgres/ 
LOG: could not bind IPv6 socket: Address already in use 
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. 
LOG: could not bind IPv4 socket: Address already in use 
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. 
WARNING: could not create listen socket for "localhost" 
FATAL: could not create any TCP/IP sockets 

這裏的上下文是爲集成測試設置一個臨時postgres;我接受其他方法。

回答

1

在另一個目錄中初始化數據庫,並在另一個端口上啓動它並嘗試在該端口上進行連接。

+0

該目錄實際上來自'mktemp',它並不衝突。我確實更改了端口號,現在它正在工作 – Daenyth

+0

@Daenyth如果它是有用的,你可以接受並且贊成答案。 –