2015-06-19 104 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

的尝试和你的命令来启动。