当我尝试运行服务器时:
postgres@ubuntu:~$ /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data
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@ubuntu:~$
然后我将用户更改为我自己:
postgres@ubuntu:~$ su - michael
michael@ubuntu:~$ sudo netstat -tulpn | grep 5432
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 959/postgres
好吧,postgres 似乎正在监听端口,这似乎是问题所在。
让我们将 pack 更改为 postgres 并尝试终止此进程:
postgres@ubuntu:~$ kill `cat /usr/local/pgsql/data/postmaster.pid`
反应是:
cat: /usr/local/pgsql/data/postmaster.pid: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
你能推荐我如何进行吗?