lolraft
lolraft copied to clipboard
HELP: how to run example with multi-nodes
Hi, I am interested in this project and try to run the example. Can you give me some introduction on how to run the example with multi-raft nodes.
@KunPengRen integration-tests runs the kvs example to test the library. I think you can learn from this. In integration-tests, the test nodes are started on localhost but giving them normal IP addresses is also allowed. Actually, our team uses this library to deploy Raft applications in k8s cluster and normal virtual machines.
It is a little hard for me to understand the integration-tests. From my understand, first, I run a raft node and keep this node ip+prot then, I use the API method api::AddServerReq and the first node id to run other nodes, but the management of the membership part is hard for me to understand. If you can provide a playground example that would be very appreciated. I am going to use this library in my project, it is not complex, just using raft for a persistent kv-store
@KunPengRen
From my understand, first, I run a raft node and keep this node ip+prot then, I use the API method api::AddServerReq and the first node id to run other nodes, but the management of the membership part is hard for me to understand.
Did you read this document? The section "Cluster Management" explains it.
https://akiradeveloper.github.io/lol/
You needs to know some participant of the cluster to join a node. But how can the first node to join a cluster when there is no existing cluster? For the initial cluster, I use cluster bootstrapping.
This is an example of forming a cluster of 4 nodes (A,B,C,D)
- Commit AddServer(A) to A
- Commit AddServer(B) to A
- Commit AddServer(C) to A or B
- Commit AddServer(D) to A or B or C