从两台 Amazon EC2 服务器运行 1 个 MediaWiki 站点
我刚刚使用 Turnkey 的 MediaWiki 包在 Amazon EC2 上创建了一个 MediaWiki 网站(请参阅 http://www.turnkeylinux.org/mediawiki ),为了性能和弹性,我想从两个不同的 EC2 位置(美国和欧盟)运行相同的 MediaWiki 内容。
这可能吗?也许使用 EBS 卷? (请参阅 http://www.turnkeylinux.org/docs/ec2/launch有关如何设置 EBS 卷的详细信息)
I just created an MediaWiki website at Amazon EC2 using Turnkey's MediaWiki package (see http://www.turnkeylinux.org/mediawiki) and for performance and resilience I would like to run the same MediaWiki content from two different EC2 locations (US and EU).
Is that possible? Maybe using and EBS volume? (see http://www.turnkeylinux.org/docs/ec2/launch for details on how to setup EBS volumes)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,这里真正的问题是你需要:
a)两个 MediaWiki 安装指向同一个 mySQL 或 Postgres 数据库,或者:
b)两个 MediaWiki + mySQL/Postgres 安装将数据从主服务器复制到从服务器,但是 MW从服务器必须指向 mySQL 主服务器进行写入。
您可以使用普通的 MediaWiki 来完成这些操作,但我不确定 Turnkey 软件包以方便的名义从您那里删除了哪些选项。看起来它会自动为您在每个实例上启动一个 mySQL。如果您可以破解配置,您也许可以将 system2 上的 MediaWiki 指向 system1 上的 mySQL(端口 12332,使用 SSL)。
EBS 在这里并不能真正帮助您,因为一个 EBS 无法同时安装在两个实例上。
很多都是你的目标......选项a)对于远程应用程序服务器来说会很慢,所以如果你想从欧洲MW中获得更好的性能,那将无法实现(也许如果你很好地调整了缓存) ...),并且它对冗余没有帮助(如果数据库宕机,一切都会宕机)。但这可能就像编辑 LocalSettings.php 并更改 $wgDBserver 一样简单(您需要弹性 IP 两个服务器,这样您就不会总是失去对它们的跟踪)。
选项 b) 更复杂,写入速度仍然很慢,但可以获得更好的读取性能和可用性。
Well, the real problem here is that you need either:
a) Two MediaWiki installs pointing back at the same mySQL or Postgres database, or:
b) Two MediaWiki + mySQL/Postgres installs replicating data from a master to a slave, but the MW slave would have to point back at the mySQL master for writes.
You can do these with normal MediaWiki but I'm not sure what options the Turnkey package removes from you in the name of convenience. It looks like it automatically spins up a mySQL on each instance for you. If you can hack the configs you might be able to point MediaWiki on system2 back at the mySQL on system1 (port 12332, using SSL).
EBS doesn't really help you here since one EBS can't be mounted off two instances simultaneously.
A lot of it is what your goal is... Option a) will be slow for the remote app server, so if you want better performance out of your European MW that won't get you it (perhaps if you tune the caching well...), and it doesn't help for redundancy (if the db's down, everything's down). But it might be as simple as editing your LocalSettings.php and changing $wgDBserver (you'll want to elastic IP both servers so that you're not always losing track of them).
Option b) is more complicated and still slow for writes but would get better read performance and availability.