简体   繁体   English

Rails AppSync将“登台”数据库与“生产”同步

[英]Rails App- Sync “staging” db with “production”

I have a rails CMS app that manages content for a production web server (not a rails app). 我有一个Rails CMS应用程序,用于管理生产Web服务器的内容(而不是Rails应用程序)。 They are on two boxes. 它们在两个盒子上。

分离

The database in staging needs to copy data (database is very small,<1MB) to the production database. 暂存中的数据库需要将数据(数据库很小,<1MB)复制到生产数据库中。 This needs to be done manually, not thru replication. 这需要手动完成,而不是通过复制完成。 To make it more difficult the production server is only accessible thru SSH, access for other services is not allowed (typical secure environment). 为了使只能通过SSH访问生产服务器更加困难,不允许访问其他服务(典型的安全环境)。

I've tried writing some rake/Capistrano tasks to do a mysql dump on the staging server and import it into the production server, although this would lock the production database, making requests fail. 我尝试编写一些rake / Capistrano任务,以便在登台服务器上进行mysql转储并将其导入生产服务器,尽管这样做会锁定生产数据库,使请求失败。 The production server cannot be brought down during the syncs. 同步期间无法关闭生产服务器。

What are my options? 我有什么选择?

我发现gem table_syncer是我需要的一切,希望这对其他人有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM