cancel
Showing results for 
Search instead for 
Did you mean: 

mysql-cluster + mysqldump

 
Piotr Kirklewski
Super Advisor

mysql-cluster + mysqldump

Hi there

My task is to perform backup on mysql-cluster from managemenet node using mysqldump.

START BACKUP; is working fine but we need to be sure thet we have sql file as well as it's more convinient etc.

I was trying to use this script:

#!/bin/sh

MAILTO=xxx@xxx.com

ndb_mgm -e "ENTER SINGLE USER MODE 4"; sleep 10;

mysqldump -u xxx -p --password=xxx --lock-tables xxx_production > backup-xxx_production.sql;

ndb_mgm -e "EXIT SINGLE USER MODE";

ndb_mgm –e "START BACKUP WAIT COMPLETED"


But it gives me an empty file.

Does enybody know why?

Best Regards

Peter
Jesus is the King
1 REPLY
Piotr Kirklewski
Super Advisor

Re: mysql-cluster + mysqldump

Sorted !

You have to ganerate keys to make the script login to the servers without password.

Best Regards

Peter


#!/bin/sh

MAILTO=me@mydomain.com

ndb_mgm -e "ENTER SINGLE USER MODE 4"; sleep 10;

ssh -p 22 user@server 'mysqldump -u root -p --password=xxx --lock-tables dbname_production > /home/username/backup/backup-dbname_production.sql'

ndb_mgm -e "EXIT SINGLE USER MODE";

ndb_mgm -e "ENTER SINGLE USER MODE 5"; sleep 10;

ssh -p 22 user@server1 'mysqldump -u root -p --password=xxx --lock-tables dbnaem_production > /home/username/backup/backup-dbname_production.sql'

ndb_mgm -e "EXIT SINGLE USER MODE";

ndb_mgm -e "START BACKUP WAIT COMPLETED"
Jesus is the King