一个网站可以托管在两台服务器上吗?
我本来想更换我的托管公司,但后来我想到在两台服务器上托管我的一个网站,我知道这是可能的,但如何才能做到这一点?
我需要由 2 台服务器(2 家不同的托管公司)托管我的一个网站,
有什么办法可以轻松实现这一点吗?
I was looking to change my hosting company, but then I thought about hosting one of my sites on 2 servers, I know this Is possible but how can this be done?
I need one of my sites to be hosted from 2 servers (2 different hosting companies)
Any way for this to happen without much hassles?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您使用 ASP.NET 进行开发,它本身就支持所谓的 Web Farms,并且设置起来并不困难。但也有一些注意事项。本地计算机内存缓存功能显然不再起作用,任何会话状态都必须配置为由状态服务器管理,并且您放入会话中的所有值都必须是简单的标量值或至少是可序列化的。
If you're developing with ASP.NET, it natively supports so called Web Farms and it's not difficult to set up. There are some caveats though. Local machine in-memory cache functionality does not work anymore obviously, and any session state would have to be configured to be managed by a state server and all values you put in session would have to be simple scalar ones or at least serializable.
为简单起见,您最好将其托管在一个数据中心中。
如果问题是速度,请从优化现有代码开始。
既然你运行了 WordPress,请查看你运行的插件。将它们全部禁用并一一重新打开。看看性能有多大差异。使用缓存插件,例如 W3 Total Cache。
如果这还不够,请考虑更大的服务器。如果您使用共享主机,请摆脱它并转移到 VPS。 Slicehost 和 Linode 是不错的选择。
如果您不习惯运行自己的服务器,那么有人会为您运行它。 XenScale.com 就是其中之一。 (完整披露:我为他们工作)
如果您的流量无法垂直扩展(更大的硬件),您可以通过设置集群来水平扩展(更多服务器)。这是相当复杂的,不是假装的,但一个好的系统管理员可以为你做到这一点。
For simplicity you would be best off hosting it in one datacenter.
If the problem is speed, start with optimizing your existing code.
Since you running wordpress, look at the plugins your running. disable them all and turn them back on one by one. see how much of a difference the performance is. Use a caching plugin such as W3 Total Cache.
If that isn't enough consider a larger server. If your using shared hosting, get rid of that and move to a VPS. Slicehost and Linode are good options.
If you aren't comfortable running your own Server there are people out there who will run it for you. XenScale.com is one. (Full Discloser: I work for them)
If you traffic is such that you can't scale vertically (bigger hardware) you can scale horizontally (more servers) by setting up a cluster. This is pretty involved and not for the feint of heart but a good sysadmin can do this for you.
看起来您正在尝试对您的网站进行负载平衡。我建议您将其作为 DNS 解决方案来处理。您应该为这两个网站设置相同的主机名,并使用其他服务器或第三方提供 DNS。如果主网站出现故障,请更改您的 DNS 以将其发送到辅助网站。
Looks like you are trying to load balance your site. I would suggest that you handle it as a DNS solution. You should have the same hostname set up for both the websites, and have your DNS with another server or a third party. If the primary website goes down, then make a change to your DNS to send it to the secondary website.