mirror of
https://github.com/Graylog2/graylog2-server.git
synced 2026-03-13 09:32:21 +08:00
make cluster initial nodes in datanode configurable (#16146)
* make cluster initial nodes in datanode configurable * added changelog * removed forgotten debug logging * returned opensearch_network_host config for containerized datanode tests
This commit is contained in:
@@ -16,7 +16,9 @@
|
||||
*/
|
||||
package org.graylog.datanode.integration;
|
||||
|
||||
import com.github.rholder.retry.Attempt;
|
||||
import com.github.rholder.retry.RetryException;
|
||||
import com.github.rholder.retry.RetryListener;
|
||||
import com.github.rholder.retry.Retryer;
|
||||
import com.github.rholder.retry.RetryerBuilder;
|
||||
import com.github.rholder.retry.StopStrategies;
|
||||
@@ -46,13 +48,19 @@ public class DatanodeClusterIT {
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
primaryNode = new DatanodeContainerizedBackend().start();
|
||||
primaryNode = new DatanodeContainerizedBackend("nodeA", datanodeContainer -> datanodeContainer
|
||||
.withEnv("GRAYLOG_DATANODE_CLUSTER_INITIAL_MANAGER_NODES", "nodeA")
|
||||
.withEnv("GRAYLOG_DATANODE_OPENSEARCH_DISCOVERY_SEED_HOSTS", "nodeA:9300")
|
||||
).start();
|
||||
|
||||
secondaryNode = new DatanodeContainerizedBackend(
|
||||
primaryNode.getNetwork(),
|
||||
primaryNode.getMongodbContainer(),
|
||||
"node2",
|
||||
new DatanodeDockerHooksAdapter()
|
||||
"nodeB",
|
||||
datanodeContainer ->
|
||||
datanodeContainer
|
||||
.withEnv("GRAYLOG_DATANODE_CLUSTER_INITIAL_MANAGER_NODES", "nodeA")
|
||||
.withEnv("GRAYLOG_DATANODE_OPENSEARCH_DISCOVERY_SEED_HOSTS", "nodeA:9300")
|
||||
);
|
||||
secondaryNode.start();
|
||||
}
|
||||
|
||||
@@ -44,12 +44,15 @@ public class DatanodeContainerizedBackend {
|
||||
this(new DatanodeDockerHooksAdapter());
|
||||
}
|
||||
|
||||
|
||||
public DatanodeContainerizedBackend(DatanodeDockerHooks hooks) {
|
||||
this("node1", hooks);
|
||||
}
|
||||
|
||||
public DatanodeContainerizedBackend(final String nodeName, DatanodeDockerHooks hooks) {
|
||||
this.network = Network.newNetwork();
|
||||
this.mongodbContainer = createMongodbContainer();
|
||||
this.datanodeContainer = createDatanodeContainer(
|
||||
"node1",
|
||||
nodeName,
|
||||
hooks, createDockerImageFile(getOpensearchVersion()),
|
||||
getDatanodeVersion());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user