Commit ea493608 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Updated rsync instructions to preserve repository ownership

I've moded the instruction to a different place to reflect the timming
it should be executed and prevent issues where the user/group doesn't
exist yet.
parent 20564894
......@@ -10,38 +10,15 @@ complete the process.
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
- [Repositories data replication](#repositories-data-replication)
- [Create SSH key pairs for Geo nodes](#create-ssh-key-pairs-for-geo-nodes)
- [Primary Node GitLab setup](#primary-node-gitlab-setup)
- [Secondary Node GitLab setup](#secondary-node-gitlab-setup)
- [Database Encryptation Key](#database-encryptation-key)
- [Authorized keys regeneration](#authorized-keys-regeneration)
- [Repositories data replication](#repositories-data-replication)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Repositories data replication
Getting a new secondary Geo node up and running, will also require the
repositories directory to be synced from the primary node. You can use `rsync`
for that. From the secondary node run:
```bash
# For Omnibus installations
rsync -avrP root@1.2.3.4:/var/opt/gitlab/git-data/repositories/ /var/opt/gitlab/git-data/repositories/
gitlab-ctl reconfigure # to fix directory permissions
# For installations from source
rsync -avrP root@1.2.3.4:/home/git/repositories/ /home/git/repositories/
chown -R git:git /home/git/repositories
chmod ug+rwX,o-rwx /home/git/repositories
```
where `1.2.3.4` is the IP of the primary node.
If this step is not followed, the secondary node will eventually clone and
fetch every missing repository as they are updated with new commits on the
primary node, so syncing the repositories beforehand will buy you some time.
## Create SSH key pairs for Geo nodes
When adding a Geo node you must provide an SSH public key of the user that your
......@@ -153,6 +130,32 @@ gitlab-rake gitlab:shell:setup
sudo -u git -H bundle exec rake gitlab:shell:setup RAILS_ENV=production
```
### Repositories data replication
Getting a new secondary Geo node up and running, will also require the
repositories directory to be synced from the primary node. You can use `rsync`
for that. From the secondary node run:
```bash
# For Omnibus installations
rsync -guavrP root@1.2.3.4:/var/opt/gitlab/git-data/repositories/ /var/opt/gitlab/git-data/repositories/
gitlab-ctl reconfigure # to fix directory permissions
# For installations from source
rsync -guavrP root@1.2.3.4:/home/git/repositories/ /home/git/repositories/
chmod ug+rwX,o-rwx /home/git/repositories
```
where `1.2.3.4` is the IP of the primary node.
If this step is not followed, the secondary node will eventually clone and
fetch every missing repository as they are updated with new commits on the
primary node, so syncing the repositories beforehand will buy you some time.
While active repositories will be eventually replicated, if you don't rsync
the files, it will not have in the secondary node any archived/inactive
repository, as Geo doensn't run any routime to look for missing repositories.
## Troubleshooting
Setting up Geo requires careful attention to details and sometimes it's easy to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment