Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
import static org.elasticsearch.cluster.node.DiscoveryNode.Role.DATA;
import static org.elasticsearch.cluster.node.DiscoveryNode.Role.INGEST;
import static org.elasticsearch.cluster.node.DiscoveryNode.Role.MASTER;
import static org.elasticsearch.discovery.DiscoveryModule.DISCOVERY_HOSTS_PROVIDER_SETTING;
import static org.elasticsearch.discovery.zen.ElectMasterService.DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING;
import static org.elasticsearch.test.discovery.TestZenDiscovery.USE_ZEN2;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFileExists;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFileNotExists;
import static org.hamcrest.Matchers.equalTo;
Expand Down Expand Up @@ -272,7 +272,8 @@ public Settings nodeSettings(int nodeOrdinal) {
NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING.getKey(),
2 + (masterNodes ? InternalTestCluster.DEFAULT_HIGH_NUM_MASTER_NODES : 0) + maxNumDataNodes + numClientNodes)
.put(NetworkModule.TRANSPORT_TYPE_KEY, getTestTransportType())
.put(USE_ZEN2.getKey(), false) // full cluster restarts not yet supported
.putList(DISCOVERY_HOSTS_PROVIDER_SETTING.getKey(), "file")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also set .putList(SettingsBasedHostsProvider.DISCOVERY_ZEN_PING_UNICAST_HOSTS_SETTING.getKey()) // empty list disables a port scan for other nodes?

.putList(SettingsBasedHostsProvider.DISCOVERY_ZEN_PING_UNICAST_HOSTS_SETTING.getKey())
.build();
}

Expand Down Expand Up @@ -384,7 +385,8 @@ public Settings nodeSettings(int nodeOrdinal) {
// speedup join timeout as setting initial state timeout to 0 makes split
// elections more likely
.put(ZenDiscovery.JOIN_TIMEOUT_SETTING.getKey(), "3s")
.put(USE_ZEN2.getKey(), false) // full cluster restarts not yet supported
.putList(DISCOVERY_HOSTS_PROVIDER_SETTING.getKey(), "file")
.putList(SettingsBasedHostsProvider.DISCOVERY_ZEN_PING_UNICAST_HOSTS_SETTING.getKey())
.build();
}

Expand All @@ -408,10 +410,12 @@ public Settings transportClientSettings() {
roles.add(role);
}

final long masterCount = roles.stream().filter(role -> role == MASTER).count();
final Settings minMasterNodes = Settings.builder()
.put(DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING.getKey(),
roles.stream().filter(role -> role == MASTER).count() / 2 + 1
).build();
.put(DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING.getKey(), masterCount / 2 + 1)
.put(INITIAL_MASTER_NODE_COUNT_SETTING.getKey(), masterCount)
.build();

try {
Map<DiscoveryNode.Role, Set<String>> pathsPerRole = new HashMap<>();
for (int i = 0; i < numNodes; i++) {
Expand Down Expand Up @@ -467,7 +471,8 @@ public Settings nodeSettings(int nodeOrdinal) {
return Settings.builder()
.put(NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING.getKey(), 2)
.put(NetworkModule.TRANSPORT_TYPE_KEY, getTestTransportType())
.put(USE_ZEN2.getKey(), false) // full cluster restarts not yet supported
.putList(DISCOVERY_HOSTS_PROVIDER_SETTING.getKey(), "file")
.putList(SettingsBasedHostsProvider.DISCOVERY_ZEN_PING_UNICAST_HOSTS_SETTING.getKey())
.build();
}

Expand Down