Skip to content

Commit

Permalink
Rename cluster.initial_master_nodes to cluster.initial_cluster_manage…
Browse files Browse the repository at this point in the history
…r_nodes

Signed-off-by: Tianli Feng <ftianli@amazon.com>
  • Loading branch information
Tianli Feng committed Mar 14, 2022
1 parent 4ea1231 commit 11646a4
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class ClusterFormationTasks {
}
boolean supportsInitialMasterNodes = hasBwcNodes == false || config.bwcVersion.onOrAfter("7.0.0")
if (esConfig['discovery.type'] == null && config.getAutoSetInitialMasterNodes() && supportsInitialMasterNodes) {
esConfig['cluster.initial_master_nodes'] = nodes.stream().map({ n ->
esConfig['cluster.initial_cluster_manager_nodes'] = nodes.stream().map({ n ->
if (n.config.settings['node.name'] == null) {
return "node-" + n.nodeNum
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ private void commonNodeConfig(OpenSearchNode node, String nodeNames, OpenSearchN
.collect(Collectors.toList())
.forEach(node.defaultConfig::remove);
if (nodeNames != null && node.settings.getOrDefault("discovery.type", "anything").equals("single-node") == false) {
node.defaultConfig.put("cluster.initial_master_nodes", "[" + nodeNames + "]");
node.defaultConfig.put("cluster.initial_cluster_manager_nodes", "[" + nodeNames + "]");
}
node.defaultConfig.put("discovery.seed_providers", "file");
node.defaultConfig.put("discovery.seed_hosts", "[]");
Expand Down
4 changes: 2 additions & 2 deletions distribution/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
image: opensearch:test
environment:
- node.name=opensearch-1
- cluster.initial_master_nodes=opensearch-1,opensearch-2
- cluster.initial_cluster_manager_nodes=opensearch-1,opensearch-2
- discovery.seed_hosts=opensearch-2:9300
- cluster.name=opensearch
- bootstrap.memory_lock=true
Expand All @@ -29,7 +29,7 @@ services:
image: opensearch:test
environment:
- node.name=opensearch-2
- cluster.initial_master_nodes=opensearch-1,opensearch-2
- cluster.initial_cluster_manager_nodes_nodes=opensearch-1,opensearch-2
- discovery.seed_hosts=opensearch-1:9300
- cluster.name=opensearch
- bootstrap.memory_lock=true
Expand Down
2 changes: 1 addition & 1 deletion distribution/src/config/opensearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ${path.logs}
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#cluster.initial_cluster_manager_nodes: ["node-1", "node-2"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
Expand Down
4 changes: 2 additions & 2 deletions qa/remote-clusters/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
image: opensearch:test
environment:
- node.name=opensearch-1
- cluster.initial_master_nodes=opensearch-1
- cluster.initial_cluster_manager_nodes=opensearch-1
- cluster.name=opensearch-1
- bootstrap.memory_lock=true
- network.publish_host=127.0.0.1
Expand Down Expand Up @@ -39,7 +39,7 @@ services:
image: opensearch:test
environment:
- node.name=opensearch-2
- cluster.initial_master_nodes=opensearch-2
- cluster.initial_cluster_manager_nodes=opensearch-2
- cluster.name=opensearch-2
- bootstrap.memory_lock=true
- network.publish_host=127.0.0.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ public void testDiscoveryConfiguredCheck() throws NodeValidationException {
hasToString(
containsString(
"the default discovery settings are unsuitable for production use; at least one "
+ "of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured"
+ "of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_cluster_manager_nodes] must be configured"
)
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public void testDescriptionBeforeBootstrapping() {
).getDescription(),
is(
"master not discovered yet, this node has not previously joined a bootstrapped cluster, and "
+ "[cluster.initial_master_nodes] is empty on this node: have discovered []; "
+ "[cluster.initial_cluster_manager_nodes] is empty on this node: have discovered []; "
+ "discovery will continue using [] from hosts providers and ["
+ localNode
+ "] from last-known cluster state; node term 1, last-accepted version 7 in term 4"
Expand All @@ -349,7 +349,7 @@ public void testDescriptionBeforeBootstrapping() {
).getDescription(),
is(
"master not discovered yet, this node has not previously joined a bootstrapped cluster, and "
+ "[cluster.initial_master_nodes] is empty on this node: have discovered []; "
+ "[cluster.initial_cluster_manager_nodes] is empty on this node: have discovered []; "
+ "discovery will continue using ["
+ otherAddress
+ "] from hosts providers and ["
Expand All @@ -371,7 +371,7 @@ public void testDescriptionBeforeBootstrapping() {
).getDescription(),
is(
"master not discovered yet, this node has not previously joined a bootstrapped cluster, and "
+ "[cluster.initial_master_nodes] is empty on this node: have discovered ["
+ "[cluster.initial_cluster_manager_nodes] is empty on this node: have discovered ["
+ otherNode
+ "]; "
+ "discovery will continue using [] from hosts providers and ["
Expand Down

0 comments on commit 11646a4

Please sign in to comment.