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
b0e73cd2
Commit
b0e73cd2
authored
Jun 17, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix disaster recovery instructions
parent
436c26c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
13 deletions
+32
-13
doc/gitlab-geo/disaster-recovery.md
doc/gitlab-geo/disaster-recovery.md
+32
-13
No files found.
doc/gitlab-geo/disaster-recovery.md
View file @
b0e73cd2
# GitLab Geo Disaster Recovery
# GitLab Geo Disaster Recovery
> **Note:**
> **Note:**
This is not officially supported yet, please don't use as your only
This is not officially supported yet, please don't use as your only
Disaster Recovery strategy as you may loose data.
Disaster Recovery strategy as you may loose data.
GitLab Geo replicates your database and your Git repositories. We will
GitLab Geo replicates your database and your Git repositories. We will
support and replicate more data in the future, that will enable you to
support and replicate more data in the future, that will enable you to
fail-over with minimal effort, in a disaster situation.
fail-over with minimal effort, in a disaster situation.
See
[
current limitations
](
README.md#current-limitations
)
See
[
current limitations
](
README.md#current-limitations
)
for more information.
for more information.
...
@@ -19,19 +19,38 @@ but you can do it manually if you have `root` access to the machine.
...
@@ -19,19 +19,38 @@ but you can do it manually if you have `root` access to the machine.
You must make the changes in the exact specific order:
You must make the changes in the exact specific order:
1.
Take down your primary node (or make sure it will not go up during this
1.
Take down your primary node (or make sure it will not go up during this
process or you may loose data)
process or you may loose data)
2.
Wait for any database replication to finish
2.
Wait for any database replication to finish
3.
Promote the Postgres in your secondary node as primary
3.
Promote the Postgres in your secondary node as primary
4.
Log-in to your secondary node with a user with
`sudo`
permission
4.
Log-in to your secondary node with a user with
`sudo`
permission
5.
Open the interactive rails console:
`sudo gitlab-rails console`
and execute:
5.
Open the interactive rails console:
`sudo gitlab-rails console`
and execute:
1.
`Gitlab::Geo.primary_node.oauth_application.destroy!`
1.
List your primary node and note down it's id:
2.
`Gitlab::Geo.primary_node.system_hook.destroy!`
```
ruby
3.
`Gitlab::Geo.primary_node.update(primary: false)`
Gitlab
::
Geo
.
primary_node
4.
List your secondary nodes and note down the id of the one you want to
```
promote:
`Gitlab::Geo.secondary_nodes`
2.
Turn your primary into a secondary:
5.
To promote a node with id
`2`
execute:
```
ruby
`GeoNode.find(2).update!(primary: true)`
Gitlab
::
Geo
.
primary_node
.
update
(
primary:
false
)
6.
To exit the interactive console, type:
`exit`
```
6.
Rsync everything in
`/var/opt/gitlab/gitlab-rails/uploads`
and
3.
List your secondary nodes and note down the id of the one you want to
promote:
```
ruby
Gitlab
::
Geo
.
secondary_nodes
```
4.
To promote a node with id
`2`
execute:
```
ruby
GeoNode
.
find
(
2
).
update!
(
primary:
true
)
```
5.
Now you have to cleanup your new promoted node by running:
```
ruby
Gitlab
::
Geo
.
primary_node
.
oauth_application
.
destroy!
Gitlab
::
Geo
.
primary_node
.
system_hook
.
destroy!
```
6.
And refresh your old primary node to behave correctly as secondary (assuming id is
`1`
)
```
ruby
GeoNode
.
find
(
1
).
save!
```
7.
To exit the interactive console, type:
`exit`
6.
Rsync everything in
`/var/opt/gitlab/gitlab-rails/uploads`
and
`/var/opt/gitlab/gitlab-rails/shared`
from your old node to the new one.
`/var/opt/gitlab/gitlab-rails/shared`
from your old node to the new one.
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