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
1cb33679
Commit
1cb33679
authored
Aug 13, 2020
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove FDW mentionfrom Geo database replication docs
parent
937ee14c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
55 deletions
+4
-55
doc/administration/geo/replication/database.md
doc/administration/geo/replication/database.md
+4
-55
No files found.
doc/administration/geo/replication/database.md
View file @
1cb33679
...
...
@@ -37,8 +37,7 @@ recover. See below for more details.
The following guide assumes that:
-
You are using Omnibus and therefore you are using PostgreSQL 11 or later
which includes the
[
`pg_basebackup` tool
](
https://www.postgresql.org/docs/11/app-pgbasebackup.html
)
and improved
[
Foreign Data Wrapper
](
https://www.postgresql.org/docs/11/postgres-fdw.html
)
support.
which includes the
[
`pg_basebackup` tool
](
https://www.postgresql.org/docs/11/app-pgbasebackup.html
)
.
-
You have a
**primary**
node already set up (the GitLab server you are
replicating from), running Omnibus' PostgreSQL (or equivalent version), and
you have a new
**secondary**
server set up with the same versions of the OS,
...
...
@@ -346,10 +345,10 @@ There is an [issue where support is being discussed](https://gitlab.com/gitlab-o
Ensure that the contents of
`~gitlab-psql/data/server.crt`
on the
**primary**
node
match the contents of
`~gitlab-psql/.postgresql/root.crt`
on the
**secondary**
node.
1.
Configure PostgreSQL
to enable FDW support
:
1.
Configure PostgreSQL:
This step is similar to how we configured the
**primary**
instance.
We need to enable this,
to enable FDW support,
even if using a single node.
We need to enable this, even if using a single node.
Edit
`/etc/gitlab/gitlab.rb`
and add the following, replacing the IP
addresses with addresses appropriate to your network configuration:
...
...
@@ -375,11 +374,6 @@ There is an [issue where support is being discussed](https://gitlab.com/gitlab-o
postgresql
[
'sql_user_password'
]
=
'<md5_hash_of_your_password>'
gitlab_rails
[
'db_password'
]
=
'<your_password_here>'
##
## Enable FDW support for the Geo Tracking Database (improves performance)
##
geo_secondary
[
'db_fdw'
]
=
true
```
For
external
PostgreSQL
instances
,
see
[
additional
instructions
](
external_database
.
md
)
.
If
you
bring
a
former
**
primary
**
node
back
online
to
serve
as
a
**
secondary
**
node
,
then
you
also
need
to
remove
`roles ['geo_primary_role']`
or
`geo_primary_role['enable'] = true`
.
...
...
@@ -390,15 +384,12 @@ There is an [issue where support is being discussed](https://gitlab.com/gitlab-o
gitlab-ctl reconfigure
```
1.
Restart PostgreSQL for the IP change to take effect
and reconfigure again
:
1. Restart PostgreSQL for the IP change to take effect:
```
shell
gitlab-ctl restart postgresql
gitlab-ctl reconfigure
```
This last reconfigure will provision the FDW configuration and enable it.
### Step 3. Initiate the replication process
Below we provide a script that connects the database on the **secondary** node to
...
...
@@ -473,48 +464,6 @@ high-availability configuration with a cluster of nodes supporting a Geo
**primary** node and another cluster of nodes supporting a Geo **secondary** node. For more
information, see [High Availability with Omnibus GitLab](../../postgresql/replication_and_failover.md).
For a Geo
**secondary**
node to work properly with PgBouncer in front of the database,
it will need a separate read-only user to make
[
PostgreSQL FDW queries
](
https://www.postgresql.org/docs/11/postgres-fdw.html
)
work:
1.
On the
**primary**
Geo database, enter the PostgreSQL on the console as an
admin user. If you are using an Omnibus-managed database, log onto the
**primary**
node that is running the PostgreSQL database (the default Omnibus database name is
`gitlabhq_production`
):
```
shell
sudo
\
-u
gitlab-psql /opt/gitlab/embedded/bin/psql
\
-h
/var/opt/gitlab/postgresql gitlabhq_production
```
1.
Then create the read-only user:
```
sql
-- NOTE: Use the password defined earlier
CREATE
USER
gitlab_geo_fdw
WITH
password
'mypassword'
;
GRANT
CONNECT
ON
DATABASE
gitlabhq_production
to
gitlab_geo_fdw
;
GRANT
USAGE
ON
SCHEMA
public
TO
gitlab_geo_fdw
;
GRANT
SELECT
ON
ALL
TABLES
IN
SCHEMA
public
TO
gitlab_geo_fdw
;
GRANT
SELECT
ON
ALL
SEQUENCES
IN
SCHEMA
public
TO
gitlab_geo_fdw
;
-- Tables created by "gitlab" should be made read-only for "gitlab_geo_fdw"
-- automatically.
ALTER
DEFAULT
PRIVILEGES
FOR
USER
gitlab
IN
SCHEMA
public
GRANT
SELECT
ON
TABLES
TO
gitlab_geo_fdw
;
ALTER
DEFAULT
PRIVILEGES
FOR
USER
gitlab
IN
SCHEMA
public
GRANT
SELECT
ON
SEQUENCES
TO
gitlab_geo_fdw
;
```
1.
On the
**secondary**
nodes, change
`/etc/gitlab/gitlab.rb`
:
```
ruby
geo_postgresql
[
'fdw_external_user'
]
=
'gitlab_geo_fdw'
```
1.
Save the file and reconfigure GitLab for the changes to be applied:
```
shell
gitlab-ctl reconfigure
```
## Troubleshooting
Read the [troubleshooting document](troubleshooting.md).
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