0

I'm trying to implement a Raft software in java but i'm having problems on how should I start the servers in the cluster. How am I supposed to start them all without a connection to a client? I'm stuck at the socket.accept() of the first one, since it keeps waiting for a connection but I have no idea of how I should address the problem. Shortly, is how can I start several servers, connect them all with each other and then wait for the client connection? Any help is appreciated! Thanks

Peter Martins
  • 25
  • 1
  • 6

1 Answers1

0

Each machine has list of Addresses of remaining machines. For example lets say there are 3 machines in raft cluster then

Machine1 knows IP Address of Machine2 and Machine3. Similarly Machine2 knows IP Address of Machine1 and Machine3, Machine3 knows IP Address of Machine1 and Machine2

Each machine should try to create connections with all other machines. After this you can start leader election process in raft.

WebServer
  • 1,316
  • 8
  • 12