@@ -411,23 +411,26 @@ public void stop() {
411411 * @param raft RAFT port.
412412 */
413413 private void bindNodes (int gossip , int data , int raft ) {
414- var publicPort = leader .getExposedPorts ().get (0 ); // see WeaviateContainer Testcontainer.
414+ var publicPort = leader .getExposedPorts ().get (0 );
415415 var clusterSize = String .valueOf (nodes .size ());
416416
417417 nodes .forEach (node -> node
418418 .withEnv ("CLUSTER_GOSSIP_BIND_PORT" , String .valueOf (gossip ))
419419 .withEnv ("CLUSTER_DATA_BIND_PORT" , String .valueOf (data ))
420- .withEnv ("RAFT_PORT" , String .valueOf (raft ))
421- .withEnv ("RAFT_BOOTSTRAP_EXPECT" , clusterSize ));
420+ .withEnv ("RAFT_PORT" , String .valueOf (raft )));
422421
422+ // Leader bootstraps the cluster
423+ leader .withEnv ("RAFT_BOOTSTRAP_EXPECT" , clusterSize );
424+
425+ // Followers join the existing cluster
423426 followers .forEach (node -> node
424427 .withEnv ("CLUSTER_JOIN" , leader .containerName + ":" + gossip )
425428 .withEnv ("RAFT_JOIN" , leader .containerName )
426429 .waitingFor (
427430 Wait .forHttp ("/v1/.well-known/ready" )
428431 .forPort (publicPort )
429432 .forStatusCode (200 )
430- .withStartupTimeout (Duration .ofSeconds (10 ))));
433+ .withStartupTimeout (Duration .ofSeconds (60 ))));
431434 }
432435 }
433436}
0 commit comments