[postgres]could not bind IPv4 address "0.0.0.0": Address already in use

Hi All,

Currently i have the gitlab setup in ubuntu and currently i have another application installed and configured with a different posgres setup in different directory than the default postgres which got installed along with gitlab.

so currently the situation is that i can make only one application work at a time which can be either gitlab or alm tool , currently i am having the alm tool running and working fine with postgres port set to 5434 and gitlab with port 5432 is failing with below error (gitlab-ctl tail)


==> /var/log/gitlab/postgres-exporter/current <==
2019-09-09_10:53:12.64474 time=“2019-09-09T16:23:12+05:30” level=info msg=“Established new database connection.” source=“postgres_exporter.go:1035”
2019-09-09_10:53:12.64494 time=“2019-09-09T16:23:12+05:30” level=info msg="Error while closing non-pinging DB connection: " source=“postgres_exporter.go:1041”
2019-09-09_10:53:12.64502 time=“2019-09-09T16:23:12+05:30” level=info msg=“Error opening connection to database (user=gitlab-psql%20host=/var/opt/gitlab/postgresql%20database=postgres%20sslmode=allow): dial unix /var/opt/gitlab/postgresql/.s.PGSQL.5432: connect: no such file or directory” source=“postgres_exporter.go:1070”

==> /var/log/gitlab/postgresql/current <==
2019-09-09_10:53:12.25203 LOG: could not bind IPv4 address “0.0.0.0”: Address already in use
2019-09-09_10:53:12.25206 HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
2019-09-09_10:53:12.25207 LOG: could not bind IPv6 address “::”: Address already in use
2019-09-09_10:53:12.25207 HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
2019-09-09_10:53:12.25208 WARNING: could not create listen socket for “*”
2019-09-09_10:53:12.25208 FATAL: could not create any TCP/IP sockets
2019-09-09_10:53:12.25209 LOG: database system is shut down

found the solution after i killed the process running on that port.