我安装了postgres-12,但是报这个错误,我已经执行sudo systemctl restart postgresql-12
,然后按照这个在centos 7上安装postgres12,当我进入第5步时:启用远程访问,并执行sudo systemctl restart postgresql-12
它报告错误
[root@localhost ~]# systemctl status postgresql-12
● postgresql-12.service - PostgreSQL 12 database server
Loaded: loaded (/usr/lib/systemd/system/postgresql-12.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2020-10-25 12:29:05 CST; 11min ago
Docs: https://www.postgresql.org/docs/12/static/
Process: 7462 ExecStart=/usr/pgsql-12/bin/postmaster -D ${PGDATA} (code=exited, status=1/FAILURE)
Process: 7456 ExecStartPre=/usr/pgsql-12/bin/postgresql-12-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
Main PID: 7462 (code=exited, status=1/FAILURE)
Oct 25 12:29:05 localhost.localdomain systemd[1]: Starting PostgreSQL 12 database server...
Oct 25 12:29:05 localhost.localdomain systemd[1]: postgresql-12.service: main process exited, code=exited, status...LURE
Oct 25 12:29:05 localhost.localdomain systemd[1]: Failed to start PostgreSQL 12 database server.
Oct 25 12:29:05 localhost.localdomain systemd[1]: Unit postgresql-12.service entered failed state.
Oct 25 12:29:05 localhost.localdomain systemd[1]: postgresql-12.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]# journalctl -xe
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql-12.service has begun starting up.
Oct 25 12:56:02 localhost.localdomain postmaster[7586]: 2020-10-25 12:56:02.994 CST [7586] LOG: starting PostgreSQL 12.4 on x86_64-pc-linux-gnu, compile
Oct 25 12:56:02 localhost.localdomain postmaster[7586]: 2020-10-25 12:56:02.995 CST [7586] LOG: could not bind IPv4 address "172.18.56.1": Cannot assign
Oct 25 12:56:02 localhost.localdomain postmaster[7586]: 2020-10-25 12:56:02.995 CST [7586] HINT: Is another postmaster already running on port 5432? If
Oct 25 12:56:03 localhost.localdomain postmaster[7586]: 2020-10-25 12:56:02.995 CST [7586] WARNING: could not create listen socket for "172.18.56.1"
Oct 25 12:56:03 localhost.localdomain postmaster[7586]: 2020-10-25 12:56:02.995 CST [7586] FATAL: could not create any TCP/IP sockets
Oct 25 12:56:03 localhost.localdomain postmaster[7586]: 2020-10-25 12:56:02.995 CST [7586] LOG: database system is shut down
Oct 25 12:56:02 localhost.localdomain systemd[1]: postgresql-12.service: main process exited, code=exited, status=1/FAILURE
Oct 25 12:56:03 localhost.localdomain systemd[1]: Failed to start PostgreSQL 12 database server.
-- Subject: Unit postgresql-12.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql-12.service has failed.
--
-- The result is failed.
Oct 25 12:56:03 localhost.localdomain systemd[1]: Unit postgresql-12.service entered failed state.
Oct 25 12:56:03 localhost.localdomain systemd[1]: postgresql-12.service failed.
Oct 25 12:56:03 localhost.localdomain sudo[7572]: pam_unix(sudo:session): session closed for user root
Oct 25 12:56:03 localhost.localdomain polkitd[3564]: Unregistered Authentication Agent for unix-process:7574:595409 (system bus name :1.50, object path /
lines 2127-2149/2149 (END)