Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
cb57907c
Commit
cb57907c
authored
Oct 18, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document Geo setup steps better and make order of actions clearer
parent
ea493608
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
30 deletions
+91
-30
doc/gitlab-geo/README.md
doc/gitlab-geo/README.md
+19
-7
doc/gitlab-geo/configuration.md
doc/gitlab-geo/configuration.md
+71
-22
doc/gitlab-geo/database.md
doc/gitlab-geo/database.md
+1
-1
No files found.
doc/gitlab-geo/README.md
View file @
cb57907c
...
@@ -20,8 +20,6 @@ locations as a read-only fully operational version.
...
@@ -20,8 +20,6 @@ locations as a read-only fully operational version.
-
[
How long does it take to have a commit replicated to a secondary node?
](
#how-long-does-it-take-to-have-a-commit-replicated-to-a-secondary-node
)
-
[
How long does it take to have a commit replicated to a secondary node?
](
#how-long-does-it-take-to-have-a-commit-replicated-to-a-secondary-node
)
-
[
What happens if the SSH server runs at a different port?
](
#what-happens-if-the-ssh-server-runs-at-a-different-port
)
-
[
What happens if the SSH server runs at a different port?
](
#what-happens-if-the-ssh-server-runs-at-a-different-port
)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Overview
## Overview
If you have two or more teams geographically spread out, but your GitLab
If you have two or more teams geographically spread out, but your GitLab
...
@@ -51,17 +49,31 @@ instance, than a normal setup.
...
@@ -51,17 +49,31 @@ instance, than a normal setup.
There are a couple of things you need to do in order to have one or more GitLab
There are a couple of things you need to do in order to have one or more GitLab
Geo instances. Follow the steps below in the order that they appear:
Geo instances. Follow the steps below in the order that they appear:
1.
Install GitLab Enterprise Edition on the server that will serve as the
1.
Install GitLab Enterprise Edition
package
on the server that will serve as the
secondary Geo node
secondary Geo node
-
Don't configure GitLab as a normal install
-
Authentication will be handled by the primary node
-
You will need to setup replication before continuing (next step)
-
Than you will be guided on how to configure this setup (please follow the correct order)
1.
[
Setup a database replication
](
database.md
)
in
`primary <-> secondary (read-only)`
topology
1.
[
Setup a database replication
](
database.md
)
in
`primary <-> secondary (read-only)`
topology
1.
[
Configure GitLab
](
configuration.md
)
and set the primary and secondary nodes
1.
[
Configure GitLab
](
configuration.md
)
and set the primary and secondary nodes
After you set up the database replication and configure the GitLab Geo nodes,
After you set up the database replication and configure the GitLab Geo nodes,
there are a few things to consider:
there are a few things to consider:
1.
When you create a new project in the primary node, the Git repository will
1.
When you create a new project in the primary node, the Git repository will
appear in the secondary only _after_ the first
`git push`
appear in the secondary only _after_ the first
`git push`
1.
To fetch from the secondary node, a separate remote URL must be set in your
1.
You need an extra configuration step to be able to fetch code from
`secondary`
and push to
`primary`
Git repository locally
-
Clone your repository as you would normally do, from the
`secondary`
node
-
Change the
`push`
URL following this example:
```bash
git remote set-url --push origin git@primary.gitlab.example.com:user/repo.git
```
> **Important**: The initialization of a new Geo secondary node requires data
to be copied from the primary, as there is no backfill feature bundled with it.
See more details in the
[
Configure GitLab
](
configuration.md
)
step.
## Current limitations
## Current limitations
...
@@ -78,8 +90,8 @@ There are limitations to what we replicate (see Current limitations).
...
@@ -78,8 +90,8 @@ There are limitations to what we replicate (see Current limitations).
In an extreme data-loss situation you can make a secondary Geo into your
In an extreme data-loss situation you can make a secondary Geo into your
primary, but this is not officially supported yet.
primary, but this is not officially supported yet.
If you still want to proceed, see our step-by-step instructions on how to
If you still want to proceed, see our step-by-step instructions on how to
manually
[
promote a secondary node
](
disaster-recovery.md
)
into primary.
manually
[
promote a secondary node
](
disaster-recovery.md
)
into primary.
### What data is replicated to a secondary node?
### What data is replicated to a secondary node?
...
...
doc/gitlab-geo/configuration.md
View file @
cb57907c
# GitLab Geo configuration
# GitLab Geo configuration
By now, you should have an
[
idea of GitLab Geo
](
README.md
)
and already set up
Before starting with configuration instructions, make sure you followed the
the
[
database replication
](
./database.md
)
. There are a few more steps needed to
[
Setup Instructions
](
README.md#setup-instructions
)
first.
complete the process.
By now, you should have an
[
idea of GitLab Geo
](
README.md
)
, have already
installed the Omnibus package in the new machine and already set up
the
[
database replication
](
./database.md
)
.
Next steps will be setting up credentials so Geo can fetch repositories,
replicate some required configurations, start GitLab server in the
`secondary`
node's machine and configure every node in the primary's Admin screen.
After GitLab's instance is online and defined in
`Geo Nodes`
admin screen,
new data will start to be automatically replicated but you still need to copy
old data from the
`primary machine`
(more instructions below).
---
---
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**
*generated with [DocToc](https://github.com/thlorenz/doctoc)*
**Table of Contents**
-
[
Create SSH key pairs for Geo nodes
](
#create-ssh-key-pairs-for-geo-nodes
)
-
[
Create SSH key pairs for Geo nodes
](
#create-ssh-key-pairs-for-geo-nodes
)
-
[
Primary Node GitLab setup
](
#primary-node-gitlab-setup
)
-
[
Primary Node GitLab setup
](
#primary-node-gitlab-setup
)
-
[
Secondary Node GitLab setup
](
#secondary-node-gitlab-setup
)
-
[
Secondary Node GitLab setup
](
#secondary-node-gitlab-setup
)
-
[
Database Encrypt
ation Key
](
#database-encrypta
tion-key
)
-
[
Database Encrypt
ion Key
](
#database-encryp
tion-key
)
-
[
Authorized keys regeneration
](
#authorized-keys-regeneration
)
-
[
Enable the secondary GitLab instance
](
#enable-the-secondary-gitlab-instance
)
-
[
Repositories data replication
](
#repositories-data-replication
)
-
[
Repositories data replication
](
#repositories-data-replication
)
-
[
Authorized keys regeneration
](
#authorized-keys-regeneration
)
-
[
Ready to use
](
#ready-to-use
)
-
[
Troubleshooting
](
#troubleshooting
)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
...
@@ -70,8 +84,9 @@ instance. If you haven't done that already, read [database replication](./databa
...
@@ -70,8 +84,9 @@ instance. If you haven't done that already, read [database replication](./databa
Go to the server that you chose to be your primary, and visit
Go to the server that you chose to be your primary, and visit
**Admin Area > Geo Nodes**
(
`/admin/geo_nodes`
) in order to add the Geo nodes.
**Admin Area > Geo Nodes**
(
`/admin/geo_nodes`
) in order to add the Geo nodes.
Although we are looking at the primary Geo node setup,
**
this is where you also
Although we are looking at the primary Geo node setup,
**
this is where you also
add any secondary servers as well
**
.
add any secondary servers as well
**
In the following table you can see what all these settings mean:
In the following table you can see what all these settings mean:
...
@@ -83,17 +98,19 @@ In the following table you can see what all these settings mean:
...
@@ -83,17 +98,19 @@ In the following table you can see what all these settings mean:
First, add your primary node by providing its full URL and the public SSH key
First, add your primary node by providing its full URL and the public SSH key
you created previously. Make sure to check the box 'This is a primary node'
you created previously. Make sure to check the box 'This is a primary node'
when adding it.
Continue with all secondaries.
when adding it.


Don't setup it for the
`secondary`
node yet, follow setup instructions below first.
---
---
## Secondary Node GitLab setup
## Secondary Node GitLab setup
>**Note:**
>**Note:**
The Geo nodes admin area (
**Admin Area > Geo Nodes**
) is not used when setting
The Geo nodes admin area (
**Admin Area > Geo Nodes**
) is not used when setting
up the secondary servers. This is handled
by the primary server setup
.
up the secondary servers. This is handled
at the primary server
.
To install a secondary node, you must follow the normal GitLab Enterprise
To install a secondary node, you must follow the normal GitLab Enterprise
Edition installation, with some extra requirements:
Edition installation, with some extra requirements:
...
@@ -101,6 +118,11 @@ Edition installation, with some extra requirements:
...
@@ -101,6 +118,11 @@ Edition installation, with some extra requirements:
-
You should point your database connection to a
[
replicated instance
](
./database.md
)
.
-
You should point your database connection to a
[
replicated instance
](
./database.md
)
.
-
Your secondary node should be allowed to communicate via HTTP/HTTPS and
-
Your secondary node should be allowed to communicate via HTTP/HTTPS and
SSH with your primary node (make sure your firewall is not blocking that).
SSH with your primary node (make sure your firewall is not blocking that).
-
Don't make any extra step you would do for a normal new installation
-
Don't setup any custom authentication (this will be handled by the
`primary`
node)
You need to make sure you restored the database backup (that is part of setting up replication)
and that the
`primary`
node PostgreSQL instance is ready to replicate data.
### Database Encryption Key
### Database Encryption Key
...
@@ -113,22 +135,19 @@ For Omnibus installations it is stored at `/etc/gitlab/gitlab-secrets.json`.
...
@@ -113,22 +135,19 @@ For Omnibus installations it is stored at `/etc/gitlab/gitlab-secrets.json`.
For Source installations it is stored at
`/home/git/gitlab/config/secrets.yml`
.
For Source installations it is stored at
`/home/git/gitlab/config/secrets.yml`
.
### Enable the secondary GitLab instance
### Authorized keys regeneration
Your new GitLab secondary node can be safely started from here.
The final step will be to regenerate the keys for
`.ssh/authorized_keys`
using
the following command (HTTPS clone will still work without this extra step).
On the secondary node where the database is
[
already replicated
](
./database.md
)
,
run the following:
```
You need to go back to the Primary Node Gitlab setup instructions and add the Secondary node
# For Omnibus installations
as you did with the primary. After you hit the
**Add Node**
button, Primary node will start to notify
gitlab-rake gitlab:shell:setup
changes to the Secondary. Make sure
`secondary`
instance is running and accessible.
# For source installations
The two most obvious issues replication can have here is:
sudo -u git -H bundle exec rake gitlab:shell:setup RAILS_ENV=production
-
Database replication not working well
```
-
Instance to instance notification not working, can be some of the following:
-
You are using a custom certificate or custom CA (see
[
Troubleshooting
](
#troubleshooting
)
)
-
Instance is firewalled (please check your firewall rules)
### Repositories data replication
### Repositories data replication
...
@@ -156,6 +175,36 @@ While active repositories will be eventually replicated, if you don't rsync
...
@@ -156,6 +175,36 @@ 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
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.
repository, as Geo doensn't run any routime to look for missing repositories.
### Authorized keys regeneration
The final step will be to regenerate the keys for
`.ssh/authorized_keys`
using
the following command (HTTPS clone will still work without this extra step).
On the secondary node where the database is
[
already replicated
](
./database.md
)
,
run the following:
```
# For Omnibus installations
gitlab-rake gitlab:shell:setup
# For source installations
sudo -u git -H bundle exec rake gitlab:shell:setup RAILS_ENV=production
```
This will enable
`git`
operations to authorize against your existing users.
New users and SSH keys updated after this step will be replicated automatically.
### Ready to use
Your instance should be ready to use. You can visit the Admin screen in the
secondary node to check if it's correctly identified as a Secondary Geo node and
if Geo is enabled.
If your installation isn't working properly, check Troubleshooting below.
---
## Troubleshooting
## Troubleshooting
Setting up Geo requires careful attention to details and sometimes it's easy to
Setting up Geo requires careful attention to details and sometimes it's easy to
...
...
doc/gitlab-geo/database.md
View file @
cb57907c
...
@@ -14,7 +14,7 @@ and `secondary` as either `slave` or `standby` server (read-only).
...
@@ -14,7 +14,7 @@ and `secondary` as either `slave` or `standby` server (read-only).
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**
*generated with [DocToc](https://github.com/thlorenz/doctoc)*
**Table of Contents**
-
[
PostgreSQL replication
](
#postgresql-replication
)
-
[
PostgreSQL replication
](
#postgresql-replication
)
-
[
PostgreSQL - Configure the primary server
](
#postgresql-configure-the-primary-server
)
-
[
PostgreSQL - Configure the primary server
](
#postgresql-configure-the-primary-server
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment