|
|
|
|
|
by mtrimpe
4619 days ago
|
|
I'm still looking for a very simple system that would let me do a live redeploy with a blocking database schema migration in between. For that I (think I)'d need a system that will: * start off with X nodes live in the load balancer * trigger redeploys on half (or so) of them * when half of the nodes have been redeployed, block and perform the database migration and trigger redeploys for the remaining server * after the migration completed switch over the load balancer to the now updated half of servers Is this something that you could orchestrate with Serf? Or am I looking in the wrong direction here. |
|
1) Send a "pre-deploy" event. Handler scripts use random number generator to decide which group they are in ("flip a coin" basically)
2) Half the nodes should transition to the "left" state, do the deploy and rejoin the cluster.
3) Once this is done, trigger the migration.
4) Flip the LB to the nodes that did the Join/Leave (you can potentially distinguish them using different role names, or by tracking who left and joined)
5) Run the "post-deploy". The other half of the nodes should now deploy
6) Update the LB to include everybody as the nodes leave/join
This is of course a rough sketch, it is certainly possible if tricky to build something like this.