我正在尝试为 SLES15 环境中的远程连接配置 Postgresql 14.7。我一直在遵循 Postgres 的Zypper 安装说明并补充了这些说明,因为我注意到两者之间的目录约定之间存在一些细微差别。看来我可以启动 postgresql 服务,但是在更新 conf 文件以接受远程连接后它失败了。
初始化 Postgresql 服务并sudo systemctl start postgresql
确保它处于活动状态后,我编辑了此处和此处postgres.conf
提到的和“pg_hba.conf”文件。
在postgresql.conf
我添加的文件中:
#listen_addresses = 'localhost'
listen_addresses = '*'
我补充说pg_hba.conf
:
# TYPE DATABASE USER ADDRESS METHOD
host all all 0.0.0.0/0 md5
host all all :/0 md5
然后我重新启动服务并sudo systemctl restart postgresql
收到以下错误:
PostgreSQL.service 的作业失败,因为控制进程退出并显示错误代码。
有关详细信息,请参阅“systemctl status postgresql.service”和“journalctl -xeu postgresql.service”`
的输出journalctl -xeu postgresql.service
给出:
journalctl -xeu postgresql.service
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A stop job for unit postgresql.service has begun execution.
░░
░░ The job identifier is 62101.
Apr 05 15:19:15 sph-gcmc2 systemd[1]: postgresql.service: Deactivated successfully.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit postgresql.service has successfully entered the 'dead' state.
Apr 05 15:19:15 sph-gcmc2 systemd[1]: Stopped PostgreSQL database server.
░░ Subject: A stop job for unit postgresql.service has finished
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A stop job for unit postgresql.service has finished.
░░
░░ The job identifier is 62101 and the job result is done.
Apr 05 15:19:15 sph-gcmc2 systemd[1]: Starting PostgreSQL database server...
░░ Subject: A start job for unit postgresql.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit postgresql.service has begun execution.
░░
░░ The job identifier is 62101.
Apr 05 15:19:15 sph-gcmc2 postgresql-script[66239]: 2023-04-05 15:19:15.322 EDT [66239]LOG: redirecting log output to logging collector process
Apr 05 15:19:15 sph-gcmc2 postgresql-script[66239]: 2023-04-05 15:19:15.322 EDT [66239]HINT: Future log output will appear in directory "log".
Apr 05 15:19:15 sph-gcmc2 postgresql-script[66237]: pg_ctl: could not start server
Apr 05 15:19:15 sph-gcmc2 postgresql-script[66237]: Examine the log output.
Apr 05 15:19:15 sph-gcmc2 systemd[1]: postgresql.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ An ExecStart= process belonging to unit postgresql.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Apr 05 15:19:15 sph-gcmc2 systemd[1]: postgresql.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit postgresql.service has entered the 'failed' state with result 'exit-code'.
Apr 05 15:19:15 sph-gcmc2 systemd[1]: Failed to start PostgreSQL database server.
░░ Subject: A start job for unit postgresql.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit postgresql.service has finished with a failure.
░░
░░ The job identifier is 62101 and the job result is failed.
lines 387-440/440 (END)
在这一点上,我还没有尝试更新防火墙规则,这是工作流中的下一步,因为我的更改导致服务崩溃。
我的目标是使用 PostgreSQL 数据库作为 ESRI 企业地理数据库实例的主干,但数据库设置让我感到困惑。
撤消您的修改并启动服务。连接并查看数据目录在哪里:
根据您的消息,日志文件将驻留在
log
该目录的子目录中。为您失败的启动尝试找到相应的日志文件,阅读错误消息并解决问题。如果您不知道如何解决问题,请提出包含错误消息的问题。
如果服务启动在编辑其配置文件后崩溃,则似乎是该版本中的问题。在我看来,新配置的那部分看起来有问题:
上面的那个东西不是正确的 IPv4 和 IPv6 地址。大概应该在这个地方
在我那里应该是其他人,但这不是该站点的问题。