gitlab.rb 配置mysql_GitLab修改PostgreSQL数据库文件位置的问题

本文介绍如何更改GitLab的默认数据库位置,并解决迁移过程中遇到的错误。通过修改配置文件及使用命令行工具,确保数据库文件成功迁移至新路径。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

默认情况下,GitLab会将数据库文件放在 /var/opt/gitlab/postgresql/data 中。

如果要修改数据库文件位置,需要将 /var/opt/gitlab/postgresql/data 中的所有文件复制到新的位置,然后在 /etc/gitlab/gitlab.rb 中设置以下4个配置至新的位置:

postgresql['dir'] =

postgresql['data_dir'] =

postgresql['log_directory'] =

postgresql['home'] =

进行这样的设置后,运行gitlab-ctl reconfigure,却出现下面的错误提示:

================================================================================

Error executing action `create` on resource 'user[gitlab-psql]'

================================================================================

Mixlib::ShellOut::ShellCommandFailed

------------------------------------

Expected process to exit with [0], but received '8'

---- Begin output of ["usermod", "-d", "/gitlab/postgresql/data", "gitlab-psql"] ----

STDOUT:

STDERR: usermod: user gitlab-psql is currently logged in

---- End output of ["usermod", "-d", "/gitlab/postgresql/data", "gitlab-psql"] ----

Ran ["usermod", "-d", "/gitlab/postgresql/data", "gitlab-psql"] returned 8

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值