简体   繁体   English

如何保持wordpress的两个MySQL MySQL数据库,AWS lightail同步?

[英]How to keep two MySQL databases of wordpress , AWS lightsail in sync?

I have got my client who wants following : 我有我的客户想要以下内容:

  1. 2 servers 2台服务器
  2. load balancer 负载均衡器
  3. daily backup (30 days ) 每日备份(30天)
  4. database synchronisation 数据库同步

Suppose I apply 2 lightsail instances and one network load balancer for hosting two identical wordpress commerce sites. 假设我应用了2个lightail实例和一个网络负载平衡器来托管两个相同的wordpress商业站点。

How to ensure the databases, images, and plugin of wordpress are in sync? 如何确保Wordpress的数据库,图像和插件同步? It is because the order created by one user at one site, shall be recorded at the another database. 这是因为一个用户在一个站点上创建的订单应记录在另一个数据库中。

This is not a great use case for Lightsail (I'm the developer advocate for Lightsail, so you can trust me when I say that). 对于Lightsail来说,这不是一个很好的用例(我是Lightsail的开发者拥护者,所以当我这么说时,您可以信任我)。

You need to understand how WordPress work with regards to storing various data. 您需要了解WordPress在存储各种数据方面的工作方式。 There is a bunch of stuff stored in MySQL but there is also a bunch of stuff stored on the file system (including plugins, uploaded media, etc). MySQL中存储了一堆东西,但文件系统上还存储了一堆东西(包括插件,上传的媒体等)。

So you could fire up to lightsail instances, point them at a single lightsail database (or self-hosted MySQL) but that doesn't solve the issue with keeping the local filesystem in sync across the various instances. 因此,您可以启动lightail实例,将它们指向单个lightail数据库(或自托管的MySQL),但这不能解决在各个实例之间保持本地文件系统同步的问题。 Yo

What you would really want with AWS is something like cloud front (for caching) in front of a load balancer. AWS真正想要的是负载平衡器之前的云前端(用于缓存)。 The LB fronts multiple EC2 instances that run WP. LB面向运行WP的多个EC2实例。 They are connected to an RDS instance running MYSQL as well as using a shared EFS* volume to host the file system.** 它们连接到运行MYSQL的RDS实例,并使用共享的EFS *卷托管文件系统。**

You can't do this on Lightsail because there is no good way to use EFS with Lightsail (even with VPC peering). 您无法在Lightsail上执行此操作,因为没有很好的方法将EFS与Lightsail一起使用(甚至与VPC对等)。

*Some will argue that EFS/NFS is not fast enough for WordPress, but I've seen with the right caching etc it be pretty effective. *有些人会认为EFS / NFS对于WordPress而言不够快,但是我已经看到了正确的缓存等,它非常有效。

**This one approach another is to use S3 to store common media, but I don't think that handles the issue w/ plugins - so maybe you want a combination of s3 for media and EFS for plug ins **另一种方法是使用S3存储常见的媒体,但我认为这无法解决带有插件的问题-因此,也许您希望将s3用于媒体,将EFS与用于插件的组合

It would be simpler and essentially as reliable to host a third database server and point both WP installs there. 托管第三个数据库服务器并将两个WP安装都指向该服务器将更简单,并且从根本上讲是可靠的。 In this case you would also be well served to set S3 offload and store uploads there. 在这种情况下,还可以很好地设置S3卸载并将存储的内容存储在那里。

TBH the db isn't your problem, keeping uploads, plugins and themes in sync is the more complicated issue TBH数据库不是您的问题,使上传,插件和主题保持同步是更复杂的问题

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

相关问题 如何保持两个 MySQL 数据库同步? - How to keep two MySQL databases in sync? 如何使两个开发数据库与Doctrine保持同步? - How to keep two development databases in sync with Doctrine? PHP,MySQL:有关如何“同步”两个数据库的问题 - PHP, MySQL: question on how to “sync” two databases 如何使用Dropbox在2台计算机上使mysql数据库保持同步? - How do I keep mysql databases in sync on 2 computers with Dropbox? 如何保持多个mysql数据库中的行同步? 最好是带有学说 - How to keep row in multiple mysql databases in sync? Preferably with doctrine 如何从 AWS 中的 2 个数据库同步 - How to sync from 2 databases in AWS 如何连续将两个MySQL数据库同步/合并到第三个数据库中 - How to continuously sync/merge two MySQL databases into a third one AWS Lightail Ubuntu 18.04服务器上的Docker mysql 5.7继续重启 - Docker mysql 5.7 on AWS lightsail ubuntu 18.04 server keep restarting 如何在两个远程数据库之间同步MySQL数据库(无MySQL数据库复制技术) - How to sync a MySQL databases between two remote databases (without MySQL database replication technique ) AWS Lightsail Wordpress 托管 MySQL 找不到数据库 mysqldump 命令 - AWS Lightsail Wordpress Managed MySQL Database mysqldump command not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM