如何在一台服务器上使用 GitLab 并将所有存储库存储在另一台服务器上? [英] How can I use GitLab on one server and store all of the repositories on another?

查看:17
本文介绍了如何在一台服务器上使用 GitLab 并将所有存储库存储在另一台服务器上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的团队在 /net/CM/repo.git/net/CM/repo2.git 的 NAS 服务器上有几个 git 存储库.我最近加入了团队并向他们介绍了 GitLab,他们认为这将是一个很好的实施工具.

My team has a couple git repositories on a NAS server at /net/CM/repo.git and /net/CM/repo2.git. I have recently joined the team and told them about GitLab, they thought it would be a great tool to implement.

但是,他们希望我将 GitLab 安装在不同的服务器上,我们将其称为超级服务器,而将另一个称为 NAS 服务器.

However, they want me to install GitLab on a different server, we'll call it the Super Server, and the other we'll call the NAS Server.

我已经在超级服务器上安装了 GitLab,它运行良好,但我很难让它检测到我在 NAS 服务器上的 git 存储库.那可能吗?如果可能的话,我不希望团队的其他成员不得不在他们的 git repos 上更改他们的远程来源.我希望他们继续推送到标准仓库,GitLab 应该会检测到更改.

I've installed GitLab on the Super Server and it runs great, but I'm having difficulty getting it to detect my git repos on the NAS Server. Is that possible? I don't want the rest of the team to have to change their remote origin's on their git repos if possible. I'd like them to continue to push to the standard repo and GitLab should detect the change.

我尝试设置 git_data_dir,如 这篇 Stack Overflow 帖子中所述:p>

I tried to set the git_data_dir as mentioned in this Stack Overflow post:

git_data_dir "/net/CM/"

但是当我运行 sudo gitlab-ctl reconfigure 时,我最终会遇到权限错误.它说它不能在 /net/CM/ 上创建目录.

But when I run sudo gitlab-ctl reconfigure, I end up with permission errors. It says it can't create directories at /net/CM/.

我也尝试创建一个 /net/git-data/ 目录,并将权限设置为 777 只是为了看看它是否可以工作,但无济于事.

I also tried making a /net/git-data/ directory, and I set the permissions to 777 just to see if it would work, but to no avail.

总结一下,如何让 GitLab 的网络软件在我的超级服务器上运行,而我的所有存储库都在我的 NAS 服务器上?

更新

有人问我如何安装 NAS 服务器.我按照加入团队时提供的说明进行操作,但这里是:

Someone asked me how I mounted the NAS server. I followed instructions provided to me when I joined the team, but here they are:

# I pulled out the ip's and ports for security purposes.
sudo apt-get install nfs-common
sudo mkdir /net
sudo mount -t nfs -o proto=tcp,port=[port] [ip]:/net /net
sudo vim /etc/fstab
# Add the following lines to fstab:
[ip]:/net /net nfs auto 0 0
[ip]:/project_name /projectname nfs auto 0 0

推荐答案

我进入我们的 NAS 配置并将我的超级服务器 IP 地址添加到启用 Root 权限的主机",一切都很好.我还没有测试过我是否可以在重新配置后取消选中该框并查看是否仍然有效.

I went into our NAS configuration and added my Super Server ip address to the "Root privilege-enabled hosts" and all is good. I haven't tested to see if I can uncheck that box after I've reconfigured and see if things still work.

这篇关于如何在一台服务器上使用 GitLab 并将所有存储库存储在另一台服务器上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆