我在 RedHat Linux 7 的主机上安装了 Postgres-11,它已经初始化并正常启动。
然后我listen_addresses = '*'
在配置文件中添加/var/lib/pgsql/11/data/pg_hba.conf
,希望让Postgres在非本地接口上监听。但是,当尝试通过命令重新启动 Postgres 时systemctl restart postgresql-11
,它总是会收到以下关于“未注册的身份验证代理”的错误。
我试图删除listen_addresses = '*'
,一切又恢复了正常。
不知道这里出了什么问题,任何提示都将受到高度赞赏。
Aug 10 17:45:50 payv.local.example.com polkitd[697]: Registered Authentication Agent for unix-process:20400:1691804 (system bus name :1.49 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object
Aug 10 17:45:50 payv.local.example.com systemd[1]: Starting PostgreSQL 11 database server...
-- Subject: Unit postgresql-11.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql-11.service has begun starting up.
Aug 10 17:45:50 payv.local.example.com postmaster[20413]: 2021-08-10 17:45:50.584 MDT [20413] LOG: listening on IPv4 address "127.0.0.1", port 5432
Aug 10 17:45:50 payv.local.example.com postmaster[20413]: 2021-08-10 17:45:50.588 MDT [20413] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Aug 10 17:45:50 payv.local.example.com postmaster[20413]: 2021-08-10 17:45:50.593 MDT [20413] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
Aug 10 17:45:50 payv.local.example.com postmaster[20413]: 2021-08-10 17:45:50.600 MDT [20413] LOG: redirecting log output to logging collector process
Aug 10 17:45:50 payv.local.example.com postmaster[20413]: 2021-08-10 17:45:50.600 MDT [20413] HINT: Future log output will appear in directory "log".
Aug 10 17:45:50 payv.local.example.com systemd[1]: postgresql-11.service: main process exited, code=exited, status=1/FAILURE
Aug 10 17:45:50 payv.local.example.com systemd[1]: Failed to start PostgreSQL 11 database server.
-- Subject: Unit postgresql-11.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql-11.service has failed.
--
-- The result is failed.
Aug 10 17:45:50 payv.local.example.com systemd[1]: Unit postgresql-11.service entered failed state.
Aug 10 17:45:50 payv.local.example.com systemd[1]: postgresql-11.service failed.
Aug 10 17:45:50 payv.local.example.com polkitd[697]: Unregistered Authentication Agent for unix-process:20400:1691804 (system bus name :1.49, object path /org/freedesktop/PolicyKit1/Authenticat
pg_hba.conf
是错误的文件。listen_addresses
必须在 中指定postgresql.conf
。