Thomas I.
12/11/2024, 3:25 PMtypesense-b
became sole "cluster" (remove the other two from the nodes file) and is the leader. After a couple of days the error is now finally solved, but the two other nodes are now out of sync, so i wanted to spin them up.
At first i wanted to start typesense-c
(with an empty nodes file)
-> i get an error Error while refreshing peer configuration: File containing nodes configuration is empty.
curl -H "X-TYPESENSE-API-KEY: xxx" "<http://typesense-c:8108/status>"
says not ready
When i add the node itself into the nodes-file of typesense-c
& the peer refresh was done -> typesense-c
also became a leader
Finally my question:
how can typesense-b
remain the leader? I have the fear that when i add both nodes to the nodes-files of both servers, that typesense-c
will be the leader and i have a data consistency problem (because there is no data at typesense-c
)
Do i need to keep these things in an exact sequence (start typesense-c without a nodes file, add typesense-c to the nodes-file of typesense-b,...)Jason Bosco
12/11/2024, 10:24 PMJason Bosco
12/11/2024, 10:25 PMThomas I.
12/12/2024, 6:18 AM(N-1)/2
, maybe thats the missing link -> so i could not activate typesense-c without having a short outage of typesense until both are finding each other?Jason Bosco
12/12/2024, 5:18 PMbut then typesense-b would be blocking because violating (N-1)/2Great observation! The nuance here is that, if you have a single node leader (where the nodes file only contains that single node's IP) and that node is healthy and serving traffic, you can add a 2nd node to the mix and have it sync data from the leader without any issues. We detect this state and let the 2nd sync data from the leader while the first node is still healthy. If we didn't have this, then there would be no way to add new nodes into a cluster when enabling a clustered environment for eg!
Thomas I.
12/12/2024, 5:29 PMJason Bosco
12/12/2024, 5:31 PMJason Bosco
12/12/2024, 5:32 PMThomas I.
12/12/2024, 5:34 PMJason Bosco
12/12/2024, 5:54 PMJason Bosco
12/12/2024, 5:55 PMJason Bosco
12/12/2024, 5:55 PMThomas I.
12/13/2024, 6:31 AMW20241213 07:24:18.176734 1702532 node.cpp:843] [default_group:192.168.0.1:8107:8108 ] Refusing concurrent configuration changing
E20241213 07:24:18.176801 1702583 raft_server.h:62] Peer refresh failed, error: Doing another configuration change
I20241213 07:24:23.172806 1702575 node.cpp:754] node default_group:192.168.0.1:8107:8108 waits peer 192.168.0.2:8107:8108 to catch up
and after 4-5 minutes it was fine and i got Peer refresh succeeded!
Thank you @Jason Bosco for your help!!