将庞大的数据库从Amazon RDS导出到本地mysql [英] Export huge database from amazon RDS to local mysql
问题描述
我在Amazon RDS上有一个mysql数据库(大约600GB的数据),我需要将其移回我们的本地专用服务器,但是我不知道从哪里开始. 每次尝试初始化sqldump时,它都会冻结,是否有办法将其移至S3?甚至在开始下载之前甚至将其拆分成较小的部分?
I have a mysql database on a Amazon RDS (About 600GB of data) I need to move it back home to our local dedicated servers, but I don't know where to start. Every time I try to init a sqldump it freezes, are there a way to move it on to S3? maybe even splitting it to smaller parts before starting the download?
您将如何迁移600GB的mysql数据库?
How would you go about migrating a 600GB mysql DB?
推荐答案
Did you tried to use innobackupex script? It allows to to run living database (hot backup) and tar|gzip final backup thus you can get a smaller file. Works only with file_per_table=1
如果您在移动数据库时遇到了停机,您还可以尝试优化表以回收一些空间(尤其是如果您进行了大量删除操作).
If you have downtime to move database you can also try to optimize tables to reclaim some space (especially if you did a lot of deletes).
您还可以考虑删除一些数据:日志,档案等,以后再移动它们.
Also you can think about get rid of some data: logs, archives etc and move them later.
这篇关于将庞大的数据库从Amazon RDS导出到本地mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!