PostgreSQL教程

postgresql移动文件夹后启动失败,提示权限问题

本文主要是介绍postgresql移动文件夹后启动失败,提示权限问题,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
[root@acs-db data]# 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 Thu 2022-02-24 00:03:52 EST; 6s ago
     Docs: https://www.postgresql.org/docs/12/static/
  Process: 9757 ExecStart=/usr/pgsql-12/bin/postmaster -D ${PGDATA} (code=exited, status=1/FAILURE)
  Process: 9749 ExecStartPre=/usr/pgsql-12/bin/postgresql-12-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
 Main PID: 9757 (code=exited, status=1/FAILURE)

Feb 24 00:03:52 acs-db systemd[1]: Starting PostgreSQL 12 database server...
Feb 24 00:03:52 acs-db postmaster[9757]: 2022-02-24 00:03:52.086 EST [9757] FATAL:  data directory "/data/pgsql/12/data" has wrong ownership
Feb 24 00:03:52 acs-db systemd[1]: postgresql-12.service: main process exited, code=exited, status=1/FAILURE
Feb 24 00:03:52 acs-db systemd[1]: Failed to start PostgreSQL 12 database server.
Feb 24 00:03:52 acs-db systemd[1]: Unit postgresql-12.service entered failed state.
Feb 24 00:03:52 acs-db systemd[1]: postgresql-12.service failed.

提示文件夹权限问题

修改权限后正常

[root@acs-db pgsql]# chown -R postgres:postgres /data/pgsql/12/data
[root@acs-db pgsql]# chmod 0700 /data/pgsql/12/data

 

这篇关于postgresql移动文件夹后启动失败,提示权限问题的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!