按正常Gitlab备份数据gitlab-rake gitlab:backup:create
Gitlab恢复数据出现错误提示:
ERROR: must be owner of extension plpgsql
ERROR: must be owner of schema public
ERROR: schema “public” already exists
ERROR: must be owner of schema public
ERROR: must be owner of extension plpgsql
WARNING: no privileges could be revoked for “public”
WARNING: no privileges could be revoked for “public”
WARNING: no privileges were granted for “public”
WARNING: no privileges were granted for “public”
解决方法:
cd /var/opt/gitlab/postgresql/data
修改这个文件/var/opt/gitlab/postgresql/data/postgresql.conf
找到listen_addresses = ” 改为listen_addresses = ‘*’
修改 /var/opt/gitlab/postgresql/data/pg_hba.conf
在这个文件最后面加入
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
重启gitlab生效
gitlab-ctl restart
进入postgresql命令行
cd /opt/gitlab/embedded/bin
su gitlab-psql
./psql -h 127.0.0.1 gitlabhq_production
执行修改gitlab用户为超级权限
ALTER USER gitlab WITH SUPERUSER;
退出
\q
# 从1462989681编号备份中恢复
gitlab-rake gitlab:backup:restore BACKUP=1462989681
这样Gitlab恢复数据就不会再报must be owner of extension plpgsql错误。
|