Cluster re-set/start with old state

75 views
Skip to first unread message

Robert Erneborg

unread,
May 16, 2016, 5:19:36 AM5/16/16
to raft-dev
Hi,

What I would like to do is restarting the cluster from scratch while keeping the old state. That is, I want the bootstrap server to have an non-empty initial state. Is this possible, and how would one go about achieving this?

Best Regards,
Robert Erneborg

Archie Cobbs

unread,
May 16, 2016, 10:40:36 AM5/16/16
to raft-dev
On Monday, May 16, 2016 at 4:19:36 AM UTC-5, Robert Erneborg wrote:
What I would like to do is restarting the cluster from scratch while keeping the old state. That is, I want the bootstrap server to have an non-empty initial state. Is this possible, and how would one go about achieving this?

I'd recommend you not muck with the core Raft workings.

Instead, add an import/export capability to your cluster:
  1. Prior to shutdown, export your total state machine state.
  2. Reset the cluster, wiping out all state
  3. Restart the cluster, now initially empty
  4. Import your state machine state saved from before
How exactly you perform the 'export' and 'import' depends on your implementation.

-Archie

philip...@yahoo.com

unread,
May 16, 2016, 11:33:10 AM5/16/16
to raft...@googlegroups.com
I agree with Archie -- backup your system and then rebuild your new cluster from that state.

>> How exactly you perform the 'export' and 'import' depends on your implementation.

But yes, what you actually need to do will depend on your actual system. For example, to do this with rqlite (https://github.com/rqlite/rqlite) one backs up the SQLite database, creates a brand new cluster, and then replays the database back into the new cluster. There is no real difference between restoring a cluster from scratch, and just performing normal operations on the cluster.

Philip


-----------------------------------------
http://www.philipotoole.com


On Monday, May 16, 2016 7:40 AM, Archie Cobbs <archie...@gmail.com> wrote:



On Monday, May 16, 2016 at 4:19:36 AM UTC-5, Robert Erneborg wrote:
What I would like to do is restarting the cluster from scratch while keeping the old state. That is, I want the bootstrap server to have an non-empty initial state. Is this possible, and how would one go about achieving this?
>

I'd recommend you not muck with the core Raft workings.

Instead, add an import/export capability to your cluster:

1. Prior to shutdown, export your total state machine state.
2. Reset the cluster, wiping out all state
3. Restart the cluster, now initially empty
4. Import your state machine state saved from beforeHow exactly you perform the 'export' and 'import' depends on your implementation.

-Archie



--
You received this message because you are subscribed to the Google Groups "raft-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raft-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Diego Ongaro

unread,
May 27, 2016, 8:34:40 PM5/27/16
to raft...@googlegroups.com
I'm a little late here but to satisfy my curiosity: Robert, can you say a little more about why you want to do this?

-Diego

Thông Phạm Văn

unread,
Dec 6, 2017, 6:00:34 AM12/6/17
to raft-dev
I have the same question, when I restart a node, what is state of my node, follower or candidate or leader?

And what I should do if my leader lost 3/5 connection to its members?

I'm sorry because of my English.

Vào 07:34:40 UTC+7 Thứ Bảy, ngày 28 tháng 5 năm 2016, Diego Ongaro đã viết:

Oren Eini (Ayende Rahien)

unread,
Dec 6, 2017, 6:05:24 AM12/6/17
to raft...@googlegroups.com
I start them as followers, and a leader that can't get majority votes will automatically become candidate after timeout perido

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


To unsubscribe from this group and stop receiving emails from it, send an email to raft-dev+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages