# Script to monitor and bootstrap a cluster

**URL:** <https://forums.percona.com/t/script-to-monitor-and-bootstrap-a-cluster/5626>\
**Category:** Percona XtraDB Cluster 5.x\
**Created:** [May 22, 2017, 6:01am UTC](https://forums.percona.com/t/script-to-monitor-and-bootstrap-a-cluster/5626 "2017-05-22T06:01:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edward\_Hibbert](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/edward_hibbert/32/993_2.png) [@Edward\_Hibbert](https://forums.percona.com/u/Edward_Hibbert)\
**Post date:** [May 22, 2017, 6:01am UTC](https://forums.percona.com/t/script-to-monitor-and-bootstrap-a-cluster/5626/1 "2017-05-22T06:01:52Z")

</div>

At the moment when I need to bootstrap a cluster, what I need to do is:  
[LIST]  
[_]Make sure everything is down (including my monit)  
[_]Check the grastrate.dat to find which one has the maximum sequence number  
[_]Set the safe\_to\_bootstrap flag  
[_]/etc/init.d/mysql bootstrap-pxc  
[_]Wait for that to come up.  
[_]If it was successful, start the other nodes one at a time, waiting for the SST to complete on each  
[/LIST] Has anyone done any automation of this kind of thing?
