-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Core: Default node.name to the hostname #33677
Merged
nik9000
merged 11 commits into
elastic:master
from
nik9000:node_name_defaults_to_host_name
Sep 19, 2018
Merged
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4dbcbef
Core: Default node.name to the hostname
nik9000 605ce74
Update docs
nik9000 5efba9e
Breaking changes doc
nik9000 d240e66
Clean up InternalSettingsPreparer
nik9000 ae00663
Remove extra ctor
nik9000 eb04e04
More cleanup
nik9000 31707dc
Fix test
nik9000 81a0594
Fixup logger tests
nik9000 d2257d1
erge branch 'master' into node_name_defaults_to_host_name
nik9000 1384762
Make compile again
nik9000 74618d5
Fixup asciidoc
nik9000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 5 additions & 14 deletions
19
docs/reference/setup/important-settings/node-name.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,13 @@ | ||
[[node.name]] | ||
=== `node.name` | ||
|
||
By default, Elasticsearch will use the first seven characters of the randomly | ||
generated UUID as the node id. Note that the node id is persisted and does | ||
not change when a node restarts and therefore the default node name will also | ||
not change. | ||
|
||
It is worth configuring a more meaningful name which will also have the | ||
advantage of persisting after restarting the node: | ||
Elasticsearch uses `node.name` as a human readable identifier for a | ||
particular instance of Elasticsearch so it is included in the response | ||
of many APIs. It defaults to the hostname that the machine has when | ||
Elasticsearch starts. If you'd prefer a different identifier then you | ||
should configure it in `elasticsearch.yml` like so: | ||
|
||
[source,yaml] | ||
-------------------------------------------------- | ||
node.name: prod-data-2 | ||
-------------------------------------------------- | ||
|
||
The `node.name` can also be set to the server's HOSTNAME as follows: | ||
|
||
[source,yaml] | ||
-------------------------------------------------- | ||
node.name: ${HOSTNAME} | ||
-------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,8 @@ | |
|
||
package org.elasticsearch.unconfigured_node_name; | ||
|
||
import org.elasticsearch.bootstrap.BootstrapInfo; | ||
import org.elasticsearch.common.logging.NodeNameInLogsIntegTestCase; | ||
import org.hamcrest.Matcher; | ||
|
||
import java.io.IOException; | ||
import java.io.BufferedReader; | ||
|
@@ -30,11 +30,16 @@ | |
import java.security.AccessController; | ||
import java.security.PrivilegedAction; | ||
|
||
import static org.hamcrest.Matchers.not; | ||
|
||
public class NodeNameInLogsIT extends NodeNameInLogsIntegTestCase { | ||
@Override | ||
protected BufferedReader openReader(Path logFile) throws IOException { | ||
assumeTrue("We log a line without the node name if we can't install the seccomp filters", | ||
BootstrapInfo.isSystemCallFilterInstalled()); | ||
protected Matcher<String> nodeNameMatcher() { | ||
return not(""); | ||
} | ||
|
||
@Override | ||
protected BufferedReader openReader(Path logFile) { | ||
return AccessController.doPrivileged((PrivilegedAction<BufferedReader>) () -> { | ||
try { | ||
return Files.newBufferedReader(logFile, StandardCharsets.UTF_8); | ||
|
@@ -43,11 +48,4 @@ protected BufferedReader openReader(Path logFile) throws IOException { | |
} | ||
}); | ||
} | ||
|
||
public void testDummy() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm glad to remove this! |
||
/* Dummy test case so that when we run this test on a platform that | ||
* does not support our syscall filters and we skip the test above | ||
* we don't fail the entire test run because we skipped all the tests. | ||
*/ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would word this a little less colloquially: