5

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.

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.

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.

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

git_data_dir "/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/.

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.

So to sum it up, How can I have GitLab's web software run on my Super Server, but have all of my repos on my NAS Server?

Update

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
Community
  • 1
  • 1
ardavis
  • 9,149
  • 10
  • 50
  • 108
  • How did you mount `/net/CM`? – Aaron Digulla Mar 17 '15 at 16:07
  • I'll add that as an update in my question to make it look cleaner than in a comment. – ardavis Mar 17 '15 at 16:09
  • Okay, I added it. So the "Super Server" that I installed GitLab on does indeed have access to `/net/CM`. I can `cd` there just fine and browse. – ardavis Mar 17 '15 at 16:12
  • Have you considered the performance impacts on running git over a network filesystem? It's usually not a good thing to do since git is very disc intense. – iveqy Mar 17 '15 at 18:57
  • But git is a distributed source control. We each have our own local copies of the code, we just store the end result on the network. Can you explain what you mean by git being very disc intense? Note: No one is actually working out of the network directory, just the repository lives on the network. – ardavis Mar 17 '15 at 19:15
  • Gitlab does a lot of random reads on that data which means a lot of network packets. Gitlab may feel slow/sluggish because of that but it depends a lot on your repo sizes as well. – Aaron Digulla Mar 18 '15 at 10:25

3 Answers3

0

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.

ardavis
  • 9,149
  • 10
  • 50
  • 108
0

NFS doesn't know by itself how to compare users from different hosts. So when you mount an NFS share, you get the user IDs from the server but the local NFS client doesn't know which local user they map to. After all, User 1000 could be Anton on the server and Ben locally.

To fix the issue, you have many options. The most simple one is to make sure that the same users are available on both computers and you can configure idmapd to let NFS know.

Related:

Community
  • 1
  • 1
Aaron Digulla
  • 297,790
  • 101
  • 558
  • 777
0

Note and update since 2015:

GitLab 13.11 (April 2021) does mention:

NFS for Git repository storage deprecated

With the general availability of Gitaly Cluster (introduced in GitLab 13.0, May 2020), we are deprecating support for NFS for Git repositories in GitLab 14.0.

We want to help you avoid purchasing expensive NFS appliances you won’t need, so invite customers currently using NFS for Git repositories to begin planning their migration.

We are pleased to provide documentation on Migrating to Gitaly Cluster.

To see our overall status, please review our Gitaly Cluster roadmap.

VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283