Hi Tsz-Wo,

Thanks very much for your reply, that's exactlly what I'm looking for!


Riguz




------------------ ???????? ------------------
??????:                                                                         
                                               "user"                           
                                                         
<[email protected]&gt;;
????????:&nbsp;2022??3??1??(??????) ????10:50
??????:&nbsp;"user"<[email protected]&gt;;

????:&nbsp;Re: How to check whether raft cluster is ready?



Hi Raiguz,

Thanks for your questions.


&gt; check the status of the raft cluster, ie. has the leader election already 
completed? ...


We may use the&nbsp;GroupManagementApi.info(group) to get the group information 
from any of the&nbsp;servers.&nbsp; The API will return the information for 
each peer at the viewpoint of that server.&nbsp; Note that, due to the 
distributed nature of a raft cluster, the viewpoints from different servers 
could possibly be different.


&gt; apply additional operation when the status of raft cluster changed, ...


This is an EventApi in StateMachine such that&nbsp;each state machine in any of 
the servers can get notification of leader&nbsp;change; see 
StateMachine.EventApi.notifyLeaderChanged(..).


Hope&nbsp;this helps.
Tsz-Wo




On Tue, Mar 1, 2022 at 9:50 AM Riguz Lee <[email protected]&gt; wrote:

Hi there,


I'm using ratis together with springboot, what I'm trying to implement is:


* check the status of the raft cluster, ie. has the leader election already 
completed? This could be useful for checking the status of the server, more 
specificlly, in k8s liveness probe
* apply additional operation when the status of raft cluster changed, for 
example, subscribe to a message queue when current node become the leader


I couldn't found features like that, do someone has similar scenarios?


Thanks,


Riguz Lee

Reply via email to