Using NFS for Gitlab repository storage

Hello team,

We have the following architecture for gitlab in production.

2 gitlab servers
1 postgres server
1 redis server
NFS mounted shared between two gitlab servers.
/var/opt/gitlab/

Currently we are testing the upgrade using test environment.

Current version is 15.4.6.
We have seen the deprecations that NFS is deprecated and need to migrate to gitaly.

I have already upgraded from 15.4.6 to 15.11.13 in test environment and everything seems working.Still using NFS only.
For storing gitlab repositories using the default location only.

/Var/opt/gitlab

Can we continue with the NFS itself or should we migrate to gitaly.

Could someone please suggest. If we continue with the next upgrade will it break anything.

Thanks

Hello team.

Could someone please check this. It will really helpful.

Thanks!

NFS is no longer supported, you have to migrate to Gitaly. The official Gitlab documentation should explain how to do that.

Hello @iwalker
Thanks for the reply.
Can you please clarify whether it will break the gitlab or gitlab stops support for this.

Also we have only 500 users. Could you please provide the documentation link. I am not able to get proper document.

Thanks!

The Gitaly stuff you can find here: Gitaly and Gitaly Cluster | GitLab

As for migration, I didn’t find anything quickly with Google, but you may wish to google and search yourself as you may find something. There were a few issues open relating to documentation and NFS migration, but nothing concrete.

I personally don’t use NFS, so I don’t know what will happen. I would say it would probably break it. Your better bet would be:

  1. Stop Gitlab
  2. Unmount nfs, and mount it elsewhere on your system, eg: /mnt/nfs
  3. Make sure /var/opt/gitlab or wherever your NFS was mounted has enough disk space.
  4. Copy the data from NFS to the server where it should be without a mounted NFS partition. Eg: cp -a /mnt/nfs* /var/opt/gitlab or wherever you had NFS mounted before.
  5. Reconfigure and restart Gitlab to make sure it’s working without NFS.

You will obviously need to make sure your server has enough disk space for you to stop using NFS. After that, and once it’s working without NFS, you can then think about upgrading, and the migration to Gitaly will happen automatically.

You cannot do the upgrade while NFS is still in use on your system. Make sure you have a backup before you do anything.

Hello @iwalker

But we are using two gitlab servers(For high availability) with NFS as a shared storage. Gitlab data is present in /var/opt/gitlab/git-data.

If we unmount the NFS and store repositories in a local storage on both servers. It will
cause inconsistency right. Because users will use any one of the gitlab servers due to load balancer.

Thanks!

Most likely then you will have to revert to a single node temporarily, and then re-create your second node later. I don’t see any other way.

Alternatively, you will have to google and try to find a way to do it yourself if you do not wish to remove the second node from the cluster and add it again after Gitaly is configured.

Good luck.