[ADDED] Clustering: ability to add/remove nodes at runtime #1090
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If option
allow_add_remove_node
instreaming{cluster{}}
blockis enabled (or command line
--cluster_allow_add_remove_node
)then the leader will listen to
_STAN.raft.<cluster id>.node.remove
(and
...node.add
) to which an user can send a simple NATS requestwith the value being the name of the node to add/remove.
If successful, the leader will return
+OK
, if not-ERR
withthe error string explaining why it failed.
Note that removing a non-existent node will still return
+OK
.If the leader receives a request to remove itself, it will work
but the process will then exit. It can be added back by sending
the request to the
..node.add
subject.Note that this updates the RAFT configuration in the RAFT log but
does NOT change the configuration file. The admin will be responsible
to change the configuration on file so that when nodes are restarted
they reflect the new configuration (list of peers).
Signed-off-by: Ivan Kozlovic ivan@synadia.com