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
68327a42
Commit
68327a42
authored
Jul 06, 2017
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added extra checks for secondary nodes
parent
031aab53
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
0 deletions
+50
-0
lib/system_check/geo/database_replication_check.rb
lib/system_check/geo/database_replication_check.rb
+24
-0
lib/system_check/geo/geo_database_configured_check.rb
lib/system_check/geo/geo_database_configured_check.rb
+24
-0
lib/tasks/gitlab/check.rake
lib/tasks/gitlab/check.rake
+2
-0
No files found.
lib/system_check/geo/database_replication_check.rb
0 → 100644
View file @
68327a42
module
SystemCheck
module
Geo
class
DatabaseReplicationCheck
<
SystemCheck
::
BaseCheck
set_name
'Using database streaming replication?'
set_skip_reason
'not a secondary node'
def
skip?
!
Gitlab
::
Geo
.
secondary?
end
def
check?
ActiveRecord
::
Base
.
connection
.
execute
(
'SELECT pg_is_in_recovery()'
).
first
.
fetch
(
'pg_is_in_recovery'
)
==
't'
end
def
show_error
try_fixing_it
(
'Follow Geo setup instructions to configure primary and secondary nodes for streaming replication'
)
for_more_information
(
'doc/gitlab-geo/database.md'
)
end
end
end
end
lib/system_check/geo/geo_database_configured_check.rb
0 → 100644
View file @
68327a42
module
SystemCheck
module
Geo
class
GeoDatabaseConfiguredCheck
<
SystemCheck
::
BaseCheck
set_name
'GitLab Geo secondary database is correctly configured'
set_skip_reason
'not a secondary node'
def
skip?
!
Gitlab
::
Geo
.
secondary?
end
def
check?
Gitlab
::
Geo
.
geo_database_configured?
end
def
show_error
try_fixing_it
(
'Check if you enabled the `geo_secondary_role` or `geo_postgresql` in the gitlab.rb config file.'
)
for_more_information
(
'doc/gitlab-geo/database.md'
)
end
end
end
end
lib/tasks/gitlab/check.rake
View file @
68327a42
...
...
@@ -549,6 +549,8 @@ namespace :gitlab do
checks
=
[
SystemCheck
::
Geo
::
LicenseCheck
,
SystemCheck
::
Geo
::
EnabledCheck
,
SystemCheck
::
Geo
::
GeoDatabaseConfiguredCheck
,
SystemCheck
::
Geo
::
DatabaseReplicationCheck
,
SystemCheck
::
Geo
::
HttpConnectionCheck
]
...
...
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