问题描述
今天打算把 Gitlab 从 11 版本升级到 12 版本,按默认的步骤试了很多次都没成功。
真不甘心,找了半天,终于在 PostgreSQL 日志里面,发现了错误
command: "/usr/lib/postgresql/10/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/var/lib/postgresql/10/main" -o "-p 50432 -c autovacuum=off -c autovacuum_freeze_max_age=2000000000 -c config_file=/var/lib/postgresql/10/main/postgresql.conf --hba_file=/var/lib/postgresql/10/main/pg_hba.conf --ident_file=/var/lib/postgresql/10/main/pg_ident.conf -c listen_addresses='' -c unix_socket_permissions=0700" start >> "pg_upgrade_server.log" 2>&1
pg_ctl: another server might be running; trying to start server anyway
waiting for server to start....2021-08-23 07:11:37.208 UTC [1385] FATAL: data directory "/var/lib/postgresql/10/main" has group or world access
2021-08-23 07:11:37.208 UTC [1385] DETAIL: Permissions should be u=rwx (0700).
stopped waiting
pg_ctl: could not start server
Examine the log output.
关键的两行日志如下:
2021-08-23 07:11:37.208 UTC [1385] FATAL: data directory "/var/lib/postgresql/10/main" has group or world access
2021-08-23 07:11:37.208 UTC [1385] DETAIL: Permissions should be u=rwx (0700).
stopped waiting