栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

postgresql 重启失败

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

postgresql 重启失败

由于重启服务器,需要重新启动 postgres

之前重新映射postgres的data目录为其他数据盘,重启的时候出现以下错误

5月 27 14:36:30 xydc-pre01 systemd[1]: Starting PostgreSQL 12 database server...
-- Subject: Unit postgresql-12.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit postgresql-12.service has begun starting up.
5月 27 14:36:30 xydc-pre01 postgresql-12-check-db-dir[10368]: "/var/lib/pgsql/12/data/" is missing or empty.
5月 27 14:36:30 xydc-pre01 systemd[1]: postgresql-12.service: control process exited, code=exited status=1
5月 27 14:36:30 xydc-pre01 postgresql-12-check-db-dir[10368]: Use "/usr/pgsql-12/bin/postgresql-12-setup initdb" to initialize the database cluster.
5月 27 14:36:30 xydc-pre01 postgresql-12-check-db-dir[10368]: See /usr/share/doc/postgresql12-12.5/README.rpm-dist for more information.
5月 27 14:36:30 xydc-pre01 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.
5月 27 14:36:30 xydc-pre01 systemd[1]: Unit postgresql-12.service entered failed state.
5月 27 14:36:30 xydc-pre01 systemd[1]: postgresql-12.service failed.
5月 27 14:36:30 xydc-pre01 polkitd[596]: Unregistered Authentication Agent for unix-process:10361:1070035 (system bus name :1.1214, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale zh_CN.UTF-8) (disconnected from bus)
5月 27 14:36:32 xydc-pre01 polkitd[596]: Registered Authentication Agent for unix-process:10434:1070303 (system bus name :1.1215 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale zh_CN.UTF-8)
5月 27 14:36:32 xydc-pre01 polkitd[596]: Unregistered Authentication Agent for unix-process:10434:1070303 (system bus name :1.1215, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale zh_CN.UTF-8) (disconnected from bus)

由于数据库需要快速恢复,查验了/var/lib/pgsql/12/data/,就是把原来的数据拷贝回原来的目录,还是失败。

由于使用的是 root 用户进行操作的,拷贝完之后,还是不能重启

明明已经存在,但是还是有问题。

"/var/lib/pgsql/12/data/" is missing or empty.

最后发现是当前目录没有权限

chown -R  postgres:postgres /var/lib/pgsql/12/data

然后数据库重启成功

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/941934.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号