Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable bootstrap checks for single-node discovery #23598

Merged
merged 29 commits into from
Apr 4, 2017

Conversation

jasontedor
Copy link
Member

@jasontedor jasontedor commented Mar 15, 2017

While there are use-cases where a single-node is in production, there are also use-cases for starting a single-node that binds transport to an external interface where the node is not in production (for example, for testing the transport client against a node started in a Docker container). It's tricky to balance the desire to always enforce the bootstrap checks when a node might be in production with the need for the community to perform testing in situations that would trip the bootstrap checks. This commit enables some flexibility for these users. By setting the discovery type to "single-node", we disable the bootstrap checks independently of how transport is bound. While this sounds like a hole in the bootstrap checks, the bootstrap checks can already be avoided in the single-node use-case by binding only HTTP but not transport. For users that are genuinely in production on a single-node use-case with transport bound to an external use-case, they can set the system property "es.enable.bootstrap.checks" to force running the bootstrap checks. It would be a mistake for them not to do this.

Relates #23585, relates #23595

This commit adds a single node discovery type. With this discovery type,
a node will elect itself as master and never form a cluster with another
node.
While there are use-cases where a single-node is in production, there
are also use-cases for starting a single-node that binds transport to an
external interface where the node is not in production (for example, for
testing the transport client against a node started in a Docker
container). It's tricky to balance the desire to always enforce the
bootstrap checks when a node might be in production with the need for
the community to perform testing in situations that would trip the
bootstrap checks. This commit enables some flexibility for these
users. By setting the discovery type to "single-node", we disable the
bootstrap checks independently of how transport is bound. While this
sounds like a hole in the bootstrap checks, the bootstrap checks can
already be avoided in the single-node use-case by binding only HTTP but
not transport. For users that are genuinely in production on a
single-node use-case with transport bound to an external use-case, they
can set the system property "es.enable.bootstrap.checks" to force
running the bootstrap checks. It would be a mistake for them not to do
this.
@jasontedor jasontedor requested a review from bleskes March 15, 2017 21:13
@jasontedor
Copy link
Member Author

@bleskes Reviewing this can wait until #23595 is integrated at which point I will merge master into this PR to remove the vast majority of the changes. I wanted to get this PR up to provide the context for #23595.

* single-node-discovery:
  Log the discovery type
  Fix variable name
* single-node-discovery:
  Return empty discovery stats
  Avoid test race when starting initial join
  Revert inadvertent change
* single-node-discovery:
  Add test single nodes do not discover
We need to negate this condition as other discovery types follow the zen
logic too, only single-node needs to be excluded.
* single-node-discovery:
  Change discovery condition
* single-node-discovery:
  Wait for pinging to finish
* master:
  Clear the interrupt flag before joining
  Migrate to max line length of 100
  Docs: Corrected path to elasticsearch-plugin (elastic#23622)
  Docs: Add comma to reverse nested agg snippet
  Fix third-party audit task for Gradle 3.4 (elastic#23612)
  Adapter action future should restore interrupts
  Update scripting.asciidoc
  Unmark reindex as experimental
  CompletionSuggestionContext#toQuery() should also consider text if prefix/regex missing (elastic#23451)
  Docs: Specify that byte units use powers of 1024 (elastic#23574)
  Remove Settings.settingsBuilder (elastic#23575)
  Change params._source to params['_source'] in example.
  Fix example in documentation for Painless using _source. (elastic#21322)
  Remove extra line from license header
  Fix num docs to be positive in bucket deferring collector test
  Mapping: Fix NPE with scaled floats stats when field is not indexed (elastic#23528)
* single-node-discovery:
  Clear the interrupt flag before joining
  Migrate to max line length of 100
  Docs: Corrected path to elasticsearch-plugin (elastic#23622)
  Docs: Add comma to reverse nested agg snippet
  Fix third-party audit task for Gradle 3.4 (elastic#23612)
  Adapter action future should restore interrupts
  Update scripting.asciidoc
  Unmark reindex as experimental
  CompletionSuggestionContext#toQuery() should also consider text if prefix/regex missing (elastic#23451)
  Docs: Specify that byte units use powers of 1024 (elastic#23574)
  Remove Settings.settingsBuilder (elastic#23575)
  Change params._source to params['_source'] in example.
  Fix example in documentation for Painless using _source. (elastic#21322)
  Remove extra line from license header
  Fix num docs to be positive in bucket deferring collector test
  Mapping: Fix NPE with scaled floats stats when field is not indexed (elastic#23528)
* master:
  Eclipse: move print margin to 100 columns
  Add support for fragment_length in the unified highlighter (elastic#23431)
* single-node-discovery:
  Eclipse: move print margin to 100 columns
  Add support for fragment_length in the unified highlighter (elastic#23431)
* master: (146 commits)
  Introduce single-node discovery
  Await termination after shutting down executors
  Fix initialization issue in ElasticsearchException
  Fix bulk queue size in thread pool docs
  [DOCS] Remove line about eager loading global ordinals
  GceDiscoverTests - remove intitial_state_timeout
  SpecificMasterNodesIT shouldn't use autoMinMasterNodes
  testRestorePersistentSettings doesn't to mess with discovery settings
  testDifferentRolesMaintainPathOnRestart shouldn't use auto managing of min master nodes
  CONSOLEify the "using scripts" documentation
  Adds tests for cardinality and filter aggregations
  Add Backoff policy to azure repository
  Revert "Adds tests for cardinality and filter aggregations (elastic#23826)"
  Adds tests for cardinality and filter aggregations (elastic#23826)
  mute testDifferentRolesMaintainPathOnRestart
  Replace custom sort field with SortedSetSortField and SortedNumericSortField when possible (elastic#23827)
  Prevent nodes from joining if newer indices exist in the cluster (elastic#23843)
  Synchronized CollapseTopFieldDocs with lucenes relatives (elastic#23854)
  CONSOLEify analysis docs
  Adapted search_shards rest test to work with Perl
  ...
@jasontedor
Copy link
Member Author

@bleskes This is ready for you now.

@jasontedor jasontedor merged commit 51b5dbf into elastic:master Apr 4, 2017
jasontedor added a commit that referenced this pull request Apr 4, 2017
While there are use-cases where a single-node is in production, there
are also use-cases for starting a single-node that binds transport to an
external interface where the node is not in production (for example, for
testing the transport client against a node started in a Docker
container). It's tricky to balance the desire to always enforce the
bootstrap checks when a node might be in production with the need for
the community to perform testing in situations that would trip the
bootstrap checks. This commit enables some flexibility for these
users. By setting the discovery type to "single-node", we disable the
bootstrap checks independently of how transport is bound. While this
sounds like a hole in the bootstrap checks, the bootstrap checks can
already be avoided in the single-node use-case by binding only HTTP but
not transport. For users that are genuinely in production on a
single-node use-case with transport bound to an external use-case, they
can set the system property "es.enable.bootstrap.checks" to force
running the bootstrap checks. It would be a mistake for them not to do
this.

Relates #23598
@jasontedor
Copy link
Member Author

Thanks @bleskes.

@jasontedor jasontedor deleted the single-node-bootstrap-checks branch April 4, 2017 13:47
dliappis added a commit to dliappis/elasticsearch that referenced this pull request Aug 18, 2017
For the single node, dev example, the `discovery.type=single-node`[1] is
a perfect fit and makes the example shorter and more self explanatory.

[1] elastic#23595
[2] elastic#23598
dliappis added a commit that referenced this pull request Sep 15, 2017
For the single node, dev example, the `discovery.type=single-node`[1],[2] 
is a perfect fit and makes the example shorter and more self explanatory.

Also expose the transport port, to help with dev use-cases using the 
transport client.

[1] #23595
[2] #23598

Relates #26289
dliappis added a commit that referenced this pull request Sep 15, 2017
For the single node, dev example, the `discovery.type=single-node`[1],[2] 
is a perfect fit and makes the example shorter and more self explanatory.

Also expose the transport port, to help with dev use-cases using the 
transport client.

[1] #23595
[2] #23598

Relates #26289
dliappis added a commit that referenced this pull request Sep 15, 2017
For the single node, dev example, the `discovery.type=single-node`[1],[2] 
is a perfect fit and makes the example shorter and more self explanatory.

Also expose the transport port, to help with dev use-cases using the 
transport client.

[1] #23595
[2] #23598

Relates #26289
dliappis added a commit that referenced this pull request Sep 15, 2017
For the single node, dev example, the `discovery.type=single-node`[1],[2] 
is a perfect fit and makes the example shorter and more self explanatory.

Also expose the transport port, to help with dev use-cases using the 
transport client.

[1] #23595
[2] #23598

Relates #26289
dliappis added a commit that referenced this pull request Sep 15, 2017
For the single node, dev example, the `discovery.type=single-node`[1],[2] 
is a perfect fit and makes the example shorter and more self explanatory.

Also expose the transport port, to help with dev use-cases using the 
transport client.

[1] #23595
[2] #23598

Relates #26289
dliappis added a commit that referenced this pull request Sep 15, 2017
For the single node, dev example, the `discovery.type=single-node`[1],[2] 
is a perfect fit and makes the example shorter and more self explanatory.

Also expose the transport port, to help with dev use-cases using the 
transport client.

[1] #23595
[2] #23598

Relates #26289
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants