0

I am having trouble with starting PostgreSQL on my CentOS system. Here are my error logs below. Any help will be greatly appreciated.

2017-04-25 03:18:12.553 CDT > LOG:  could not bind IPv6 socket: Address already in use

2017-04-25 03:18:12.553 CDT > HINT:  Is another postmaster already running on port 5432? If not, wait a few seconds and retry.

2017-04-25 03:18:12.553 CDT > WARNING:  could not create listen socket for "*"

2017-04-25 03:18:12.553 CDT > FATAL:  could not create any TCP/IP sockets

2017-04-25 03:18:12.554 CDT > LOG:  database system is shut down
  • 1
    Perhaps you have another server (e.g. another PostGresql daemon) using the same port – Basile Starynkevitch Apr 25 '17 at 8:29
  • I dont to my knowledge. Postgres was working fine but didn't seem to start again once I had stopped the service. How would I check that there is not another service using the same port? – Grant Apr 25 '17 at 8:35
  • Error seems explicit : HINT: Is another postmaster already running on port 5432? – Archemar Apr 25 '17 at 9:00
1

You're probably running another service using port 5432. To verify try doing ss -lnpt (use sudo in case you're not root). You'll be able to see which process is using TCP port 5432 if this is the case.

  • 1
    Or use netstat(8) to check the same – Basile Starynkevitch Apr 25 '17 at 8:53
  • When I ran this command I got this output for that port. Not sure how to chnage it so that I can get Postgres to start. LISTEN 0 128 :::5432 :::* users:(("postmaster",11717,4)) LISTEN 0 128 :5432 *: – Grant Apr 25 '17 at 8:54
  • @Grant please edit your question to add requested information, comment are hard to read. – Archemar Apr 25 '17 at 8:59
  • @Grant As you can see some process with PID 11717 is using TCP port 5432. Now it depends on your intent. If you're shure that port 5432 shouldn't be used, go ahead and stop the service. If you don't know what is to be stopped, kill the process with kill 11717 or kill -9 11717 if first command doesn't do the job. But it may lead to service interruption for particular process you're trying to kill. – ar_ Apr 25 '17 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.