diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-19 03:09:48 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-19 03:09:48 +0000 |
commit | 7c4ef7b9fd144c51102f9b7530053a5a7efc5ef8 (patch) | |
tree | f38df0cea7ec0679107c6909f0ea641654319280 /doc | |
parent | 77d15aff0eaa7dd8a8ce988436a502c5ab6bb55b (diff) | |
download | gitlab-ce-7c4ef7b9fd144c51102f9b7530053a5a7efc5ef8.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc')
-rw-r--r-- | doc/administration/high_availability/database.md | 33 | ||||
-rw-r--r-- | doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md | 69 |
2 files changed, 29 insertions, 73 deletions
diff --git a/doc/administration/high_availability/database.md b/doc/administration/high_availability/database.md index bb07fdbbb6e..e3cd8766654 100644 --- a/doc/administration/high_availability/database.md +++ b/doc/administration/high_availability/database.md @@ -872,8 +872,9 @@ standby nodes. If a node fails, it can be removed from the cluster, or added back as a standby after it has been restored to service. -- If you want to remove the node from the cluster, on any other node in the - cluster, run: +##### Remove a standby from the cluster + + From any other node in the cluster, run: ```shell gitlab-ctl repmgr standby unregister --node=X @@ -893,13 +894,15 @@ after it has been restored to service. 959789412 ``` - Then you will use this id to unregister the node: + Then you will use this ID to unregister the node: ```shell gitlab-ctl repmgr standby unregister --node=959789412 ``` + +##### Add a node as a standby server -- To add the node as a standby server: + From the stnadby node, run: ```shell gitlab-ctl repmgr standby follow NEW_MASTER @@ -912,6 +915,28 @@ after it has been restored to service. this will cause a split, and the old master will need to be resynced from scratch by performing a `gitlab-ctl repmgr standby setup NEW_MASTER`. +##### Add a failed master back into the cluster as a standby node + + Once `repmgrd` and PostgreSQL are runnning, the node will need to follow the new + as a standby node. + + ``` + gitlab-ctl repmgr standby follow NEW_MASTER + ``` + + Once the node is following the new master as a standby, the node needs to be + [unregistered from the cluster on the new master node](#remove-a-standby-from-the-cluster). + + Once the old master node has been unregistered from the cluster, it will need + to be setup as a new standby: + + ``` + gitlab-ctl repmgr standby setup NEW_MASTER + ``` + + Failure to unregister and readd the old master node can lead to subsequent failovers + not working. + #### Alternate configurations ##### Database authorization diff --git a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md index 2bb2e13511c..e90f6f36cc6 100644 --- a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md +++ b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md @@ -160,18 +160,6 @@ GIT_CURL_VERBOSE=1 GIT_TRACE=1 git clone <repository> ## Projects -### Find projects - -```ruby -# A single project -project = Project.find_by_full_path('PROJECT_PATH') - -# All projects in a particular namespace. Can be a username, a group -# ('gitlab-org'), or even include subgroups ('gitlab-org/distribution') -namespace = Namespace.find_by_full_path('NAMESPACE_PATH') -projects = namespace.all_projects -``` - ### Clear a project's cache ```ruby @@ -407,35 +395,6 @@ end ## Users -### Finding users - -```ruby -# By username -user = User.find_by(username: '') - -# By primary email -user = User.find_by(email: '') - -# By any email (primary or secondary) -user = User.find_by_any_email('') - -# Admins -User.admins -admin = User.admins.first -``` - -### Block - -```ruby -User.find_by_username().block! -``` - -### Unblock - -```ruby -User.find_by_username().active -``` - ### Skip reconfirmation ```ruby @@ -476,13 +435,6 @@ User.find(123).personal_access_tokens.create( ) ``` -### Disable 2FA on a user - -```ruby -user = User.find_by_username('username') -user.disable_two_factor! -``` - ### Active users & Historical users ```ruby @@ -546,20 +498,6 @@ group = Group.find_by_full_path 'group' user.max_member_access_for_group group.id ``` -### Change user password - -```ruby -password = "your password" -user = User.find_by_username('your username') -password_attributes = { - password: password, - password_confirmation: password, - password_automatically_set: false -} - -result = Users::UpdateService.new(user, password_attributes.merge(user: user)).execute -``` - ## Groups ### Count unique users in a group and sub-groups @@ -706,13 +644,6 @@ conflicting_permanent_redirects.destroy_all ## Merge Requests -### Find Merge Request - -```ruby -m = project.merge_requests.find_by(iid: <IID>) -m = MergeRequest.find_by_title('NEEDS UNIQUE TITLE!!!') -``` - ### Close a merge request properly (if merged but still marked as open) ```ruby |