0

Currently using aws as my db hosting. Instead of using RDS I am using instances to include mariaDB and distribute few instances over different region for replication.

Everything works fine but because using instances, aws does not back up automatically so now I am creating a crontab job to run an aws cli to create image automatically. I am still in testing phase but then I found out, each time when I run the script and aws does create an image of the instance BUT the catch is, mariaDB would stop completely and would not start up automatically.

I actually got it fixed but wonder if people know about this and if there is a way to prevent this.

I have googled then tried running galera_new_cluster on the 1st node which then showed error about file named grastate.dat that I can change the bootstrap value from 0 to 1.

I did that, then run the galera_new_cluster again which then worked perfectly to start up mariadb, then I have to go to other dbs and start them manually.

At first, I thought this would be then fixed but guess not. I tried running the aws cli to create image of the instance again. The dbs all went down again. the bootstrap value is back to 0 that I have to set it to 1 and run all those commands again and to other server too.

I thought of writing a script to do it step by step each time after creating an image but it would be kinda a hassle.

Does anyone know about this situation or a way to fix it permanently?

Thanks in advance for any ideas.

Dora
  • 341
  • 1
  • 5
  • 15
  • When you say "creating an image," I assume you mean an AMI, `aws ec2 create-image`. That will reboot your instance, by default. Perhaps the first question is, does your setup properly survive a reboot? – Michael - sqlbot Jan 04 '18 at 00:29
  • @Michael-sqlbot yes, I meant `aws ec2 create-image` if I reboot the instance myself. It boot up itself though, or there's a settings I should check to make sure? – Dora Jan 04 '18 at 00:33
  • It shouldn't be different whether it's rebooted by AMI creation or a console reboot. I believe they both emulate control-alt-delete being pressed, but I'd have to verify. – Michael - sqlbot Jan 04 '18 at 00:39
  • @Michael-sqlbot but by reboot, I rebooted inside the terminal though. I SSH in and manually `sudo reboot` which of course kicks me out then waited a bit, I ssh in again checked the mysql status, it is running – Dora Jan 04 '18 at 01:35

0 Answers0