vps交流

pgsql 重启不起来,帮忙看下什么错误。


运行的命令是 sudo systemctl restart postgresql-14
关键是好像说配置文件错误?但是我把文件从另一台正常的上面复制,也是错误。奇怪。另外问一下,主从好配置么。

Jul 08 00:54:48 ion-2 sudo[16228]: pam_unix(sudo:session): session opened for user root by root(uid=0)
Jul 08 00:54:48 ion-2 polkitd[505]: Registered Authentication Agent for unix-process:16229:316737474 (system bus name :1.1915 [/usr/bin/pkttyagent –notify-fd 5 –fallback], object path /org/
Jul 08 00:54:48 ion-2 systemd[1]: Starting PostgreSQL 14 database server…
— Subject: Unit postgresql-14.service has begun start-up
— Defined-By: systemd
— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

— Unit postgresql-14.service has begun starting up.
Jul 08 00:54:48 ion-2 postgresql-14-check-db-dir[16235]: cat: /var/lib/pgsql/14/data//PG_VERSION: Permission denied
Jul 08 00:54:48 ion-2 postgresql-14-check-db-dir[16235]: cat: /var/lib/pgsql/14/data//PG_VERSION: Permission denied
Jul 08 00:54:48 ion-2 postgresql-14-check-db-dir[16235]: An old version of the database format was found.
Jul 08 00:54:48 ion-2 postgresql-14-check-db-dir[16235]: You need to dump and reload before using PostgreSQL 14.
Jul 08 00:54:48 ion-2 postgresql-14-check-db-dir[16235]: See /usr/share/doc/postgresql14-14.4/README.rpm-dist for more information.
Jul 08 00:54:48 ion-2 systemd[1]: postgresql-14.service: control process exited, code=exited status=1
Jul 08 00:54:48 ion-2 systemd[1]: Failed to start PostgreSQL 14 database server.
— Subject: Unit postgresql-14.service has failed
— Defined-By: systemd
— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

— Unit postgresql-14.service has failed.

— The result is failed.
Jul 08 00:54:48 ion-2 systemd[1]: Unit postgresql-14.service entered failed state.
Jul 08 00:54:48 ion-2 systemd[1]: postgresql-14.service failed.
Jul 08 00:54:48 ion-2 polkitd[505]: Unregistered Authentication Agent for unix-process:16229:316737474 (system bus name :1.1915, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, l
Jul 08 00:54:48 ion-2 sudo[16228]: pam_unix(sudo:session): session closed for user root

没用过
从一般的经验来说,先解决掉这个问题再看吧
Jul 08 00:54:48 ion-2 postgresql-14-check-db-dir[16235]: cat: /var/lib/pgsql/14/data//PG_VERSION: Permission denied
Jul 08 00:54:48 ion-2 postgresql-14-check-db-dir[16235]: cat: /var/lib/pgsql/14/data//PG_VERSION: Permission deniedpgsql 重启不起来,帮忙看下什么错误。
只能看到权限问题几个字

sdqu 发表于 2022-7-8 00:58
没用过
从一般的经验来说,先解决掉这个问题再看吧
Jul 08 00:54:48 ion-2 postgresql-14-check-db-dir[162 …

奇怪的是,我root运行的,修改文件以前没问题,就很奇怪

清蒸三文鱼 发表于 2022-7-8 01:01
只能看到权限问题几个字

http://www.manongjc.com/detail/28-gyyapmgrlzwngdc.html
[[email protected] pgsql]# chown -R postgres:postgres /data/pgsql/12/data
[[email protected] pgsql]# chmod 0700 /data/pgsql/12/data

这样好像就行了。多谢。

斌斌 发表于 2022-7-8 01:10
奇怪的是,我root运行的,修改文件以前没问题,就很奇怪

它在运行的时候会切换到低权限的用户pgsql 重启不起来,帮忙看下什么错误。

sdqu 发表于 2022-7-8 01:36
它在运行的时候会切换到低权限的用户

主从还没研究明白,是有好几种模式么,同步异步?