Comments (5)
👋 Thanks for opening this issue!
Get help or engage by:
/help
: to print help messages./assignme
: to assign this issue to you.
from openraft.
You have initialized the cluster twice with different config, which result in a brain split state.
To incrementally setup a cluster, just call Raft::initialize({0:BasicNode})
on node-0.
Then call Raft::add_learner({1:BasicNode})
on node-0 to add node-1 to the cluster.
Then call Raft::change_membership(...)
to make node-1 a voter.
Or setup a cluster in oneshot: call Raft:initialize({0:BasicNode, 1:BasicNode...})
on node-0;
Refer to:
https://docs.rs/openraft/latest/openraft/docs/faq/index.html#how-to-initialize-a-cluster
from openraft.
@drmingdrmer First off, thank you for being so responsive :)
Also, I saw your conversation on Discord with diptanuc - that helped quite a bit.
However, my only point of confusion is that if I want to start two nodesindependently of one another - seed_node (node 0) and node 1, how do I start them? The independently is important to me here
I can start node 0 using initialize
but then how do I start node 1 in a way that does not cause brain split and allow node 1 to communicate with node 0 to allow itself to be registered as part of the cluster?
All the examples I've seen just use add_learner
on the seed node to add a new node assuming that the seed node already knows what nodes it wants to add. But what do I do if I want nodes to be able to start independently of the seed node and then send a message to the seed node to allow themselves to be discovered?
from openraft.
First of all, IMHO, two independent nodes just means brain split. They are equivalent concept, because these two nodes can propose different logs and there is no consensus between them.
Because they have different data, you can not add node-1 with non-empty data(i.e., node-1 has already proposed logs and applied) to the seed node node-0 without losing node-1's data.
If what you want is to let seed node-0 to discover another empty node to join into the cluster, it is not about Raft.
There should be registry service let node-1 to register itself and so that seed node-0 will discover such candidate nodes.
from openraft.
Closing this issue.
@redixhumayun
If you have any further question, please feel free to reopen it:)
from openraft.
Related Issues (20)
- Feature: Monoio Runtime HOT 3
- Add sync primitives to `AsyncRuntime` trait HOT 1
- Add `AsyncRuntime::oneshot` HOT 2
- Propose stream-based Replication of Log Entries HOT 2
- Release 0.9 HOT 2
- Refactor: Move `client_resp_channels` from `LeaderData` to new `tx_...`-field in `RaftCore` HOT 2
- Linearizable read with `ReadIndex` HOT 1
- about single node HOT 6
- Cluster Bootstrap and Node Initialization Sequence HOT 4
- Tracking issue for examples update HOT 1
- Update example `raft-kv-memstore` to use `storage-v2` HOT 2
- Update example `raft-kv-rocksstore` to use `storage-v2` HOT 1
- Move examples into the workspace HOT 1
- Install Snapshot v1 api HOT 3
- Observe state changes in a Raft node HOT 6
- Split metrics into data metrics and server metrics HOT 5
- About automatic remove HOT 3
- Backing up the WAL HOT 6
- Raft Core Panicking HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openraft.