Commit a58c009f authored by Michael Kozono's avatar Michael Kozono

Add Geo node name field in form

parent 2b5d1fab
...@@ -12,7 +12,8 @@ All Geo nodes have the following settings: ...@@ -12,7 +12,8 @@ All Geo nodes have the following settings:
| Setting | Description | | Setting | Description |
| --------| ----------- | | --------| ----------- |
| Primary | This marks a Geo Node as **primary** node. There can be only one **primary** node; make sure that you first add the **primary** node and then all the others. | | Primary | This marks a Geo Node as **primary** node. There can be only one **primary** node; make sure that you first add the **primary** node and then all the others. |
| URL | The instance's full URL, in the same way it is configured in `/etc/gitlab/gitlab.rb` (Omnibus GitLab installations) or `gitlab.yml` (source based installations). | | Name | The unique identifier for the Geo node. Must match the setting `gitlab_rails[geo_node_name]` in `/etc/gitlab/gitlab.rb`. The setting defaults to `external_url` with a trailing slash. |
| URL | The instance's user-facing URL. |
The node you're reading from is indicated with a green `Current node` label, and The node you're reading from is indicated with a green `Current node` label, and
the **primary** node is given a blue `Primary` label. Remember that you can only make the **primary** node is given a blue `Primary` label. Remember that you can only make
...@@ -55,3 +56,15 @@ which is used by users. Internal URL does not need to be a private address. ...@@ -55,3 +56,15 @@ which is used by users. Internal URL does not need to be a private address.
Internal URL defaults to External URL, but you can customize it under Internal URL defaults to External URL, but you can customize it under
**Admin area > Geo Nodes**. **Admin area > Geo Nodes**.
## Multiple secondary nodes behind a load balancer
In GitLab 11.11, **secondary** nodes can use identical external URLs as long as
a unique `name` is set for each Geo node. The `gitlab.rb` setting
`gitlab_rails[geo_node_name]` must:
- Be set for each GitLab instance that runs `unicorn`, `sidekiq`, or `geo_logcursor`.
- Match a Geo node name.
The load balancer must use sticky sessions in order to avoid authentication
failures and cross site request errors.
...@@ -47,6 +47,7 @@ class Admin::Geo::NodesController < Admin::Geo::ApplicationController ...@@ -47,6 +47,7 @@ class Admin::Geo::NodesController < Admin::Geo::ApplicationController
def geo_node_params def geo_node_params
params.require(:geo_node).permit( params.require(:geo_node).permit(
:name,
:url, :url,
:internal_url, :internal_url,
:primary, :primary,
......
= form_errors(geo_node) = form_errors(geo_node)
.form-row.form-group .form-row.form-group
.form-group.col-sm-6
= form.label :name, _('Name'), class: 'font-weight-bold'
= form.text_field :name, class: 'form-control'
.form-text.text-muted= _('The unique identifier for the Geo node. Must match `geo_node_name` if it is set in gitlab.rb, otherwise it must match `external_url`')
.form-group.col-sm-6 .form-group.col-sm-6
= form.label :url, s_('Geo|URL'), class: 'font-weight-bold' = form.label :url, s_('Geo|URL'), class: 'font-weight-bold'
= form.text_field :url, class: 'form-control' = form.text_field :url, class: 'form-control'
.form-text.text-muted= _('The user-facing URL of the Geo node.')
.form-group.col-sm-6.js-internal-url{ class: ('hidden' unless geo_node.primary?) } .form-group.col-sm-6.js-internal-url{ class: ('hidden' unless geo_node.primary?) }
= form.label :internal_url, s_('Geo|Internal URL'), class: 'font-weight-bold' = form.label :internal_url, s_('Geo|Internal URL'), class: 'font-weight-bold'
......
...@@ -77,6 +77,7 @@ describe 'admin Geo Nodes', :js, :geo do ...@@ -77,6 +77,7 @@ describe 'admin Geo Nodes', :js, :geo do
it 'creates a new Geo Node' do it 'creates a new Geo Node' do
check 'This is a primary node' check 'This is a primary node'
fill_in 'geo_node_name', with: 'a node name'
fill_in 'geo_node_url', with: 'https://test.gitlab.com' fill_in 'geo_node_url', with: 'https://test.gitlab.com'
click_button 'Add Node' click_button 'Add Node'
......
...@@ -11907,6 +11907,9 @@ msgstr "" ...@@ -11907,6 +11907,9 @@ msgstr ""
msgid "The time taken by each data entry gathered by that stage." msgid "The time taken by each data entry gathered by that stage."
msgstr "" msgstr ""
msgid "The unique identifier for the Geo node. Must match `geo_node_name` if it is set in gitlab.rb, otherwise it must match `external_url`"
msgstr ""
msgid "The update action will time out after %{number_of_minutes} minutes. For big repositories, use a clone/push combination." msgid "The update action will time out after %{number_of_minutes} minutes. For big repositories, use a clone/push combination."
msgstr "" msgstr ""
...@@ -11928,6 +11931,9 @@ msgstr "" ...@@ -11928,6 +11931,9 @@ msgstr ""
msgid "The user map is a mapping of the FogBugz users that participated on your projects to the way their email address and usernames will be imported into GitLab. You can change this by populating the table below." msgid "The user map is a mapping of the FogBugz users that participated on your projects to the way their email address and usernames will be imported into GitLab. You can change this by populating the table below."
msgstr "" msgstr ""
msgid "The user-facing URL of the Geo node."
msgstr ""
msgid "The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6." msgid "The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6."
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment