服务端启动异常

异常原因:数据库无法连接
数据库地址:127.0.0.1:28032
配置目录:/config 读写权限正常
数据库目录:/config/pgsql

请参考官网解决方法https://mtmt.tech/docs/advanced/ifix

Debug信息:

# id postgres

uid=104(postgres) gid=10(postgres) groups=10(postgres),103(ssl-cert)

# stat /config/pgsql

  File: /config/pgsql
  Size: 4096      	Blocks: 8          IO Block: 4096   directory
Device: fd01h/64769d	Inode: 27918342    Links: 3
Access: (0770/drwxrwx---)  Uid: (  104/postgres)   Gid: (   10/postgres)
Access: 2025-12-20 21:43:55.053575738 +0800
Modify: 2025-12-20 21:43:55.637578626 +0800
Change: 2026-04-06 19:03:00.687999907 +0800
 Birth: 2025-12-20 21:43:55.053575738 +0800

请根据 下方红色 提示,检查 上方Debug信息 中,uid是否一致,以及Access是否为0700

# id postgres

uid=103(postgres) gid=105(postgres) ...

# stat /config/pgsql

Access: (0700/drwx------) Uid: ( 103/postgres) Gid: ( 105/postgres)

如果Debug信息中的目录权限没问题
请查看数据库最新的日志 /config/pgsql/serverlog
寻找FATALPANIC开头的日志;

# cat /config/pgsql/serverlog

2026-04-03 10:05:56.641 CST [81] LOG:  received fast shutdown request
2026-04-03 10:05:56.644 CST [81] LOG:  aborting any active transactions
2026-04-03 10:05:56.647 CST [81] LOG:  background worker "logical replication launcher" (PID 88) exited with exit code 1
2026-04-03 10:05:56.653 CST [83] LOG:  shutting down
2026-04-03 10:05:56.667 CST [81] LOG:  database system is shut down
2026-04-03 10:08:19.189 CST [81] FATAL:  data directory "/config/pgsql/data" has invalid permissions
2026-04-03 10:08:19.189 CST [81] DETAIL:  Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).
2026-04-03 10:35:11.667 CST [67] LOG:  starting PostgreSQL 14.12 (Debian 14.12-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2026-04-03 10:35:11.668 CST [67] LOG:  listening on IPv6 address "::1", port 28032
2026-04-03 10:35:11.668 CST [67] LOG:  listening on IPv4 address "127.0.0.1", port 28032
2026-04-03 10:35:11.668 CST [67] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.28032"
2026-04-03 10:35:11.671 CST [68] LOG:  database system was shut down at 2026-04-03 10:05:56 CST
2026-04-03 10:35:11.679 CST [67] LOG:  database system is ready to accept connections
2026-04-06 19:01:11.335 CST [67] LOG:  received fast shutdown request
2026-04-06 19:01:11.336 CST [67] LOG:  aborting any active transactions
2026-04-06 19:01:11.339 CST [67] LOG:  background worker "logical replication launcher" (PID 74) exited with exit code 1
2026-04-06 19:01:11.339 CST [69] LOG:  shutting down
2026-04-06 19:01:11.352 CST [67] LOG:  database system is shut down
2026-04-06 19:03:04.864 CST [81] FATAL:  data directory "/config/pgsql/data" has invalid permissions
2026-04-06 19:03:04.864 CST [81] DETAIL:  Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).