简体   繁体   English

如何在Windows Server上进行故障转移

[英]how to do failover on windows server

We have 2 pc's with Windows Server 2008 R2. 我们有2台Windows Server 2008 R2。 Both pc's have glassfish installed with a web application. 两台PC均安装了带网络应用程序的glassfish。 The first pc (PDC) has the ip 192.168.1.7, the second pc (BDC) has the ip 192.168.1.8 and the users log in to the application using the ip 192.168.1.7. 第一台PC(PDC)的IP为192.168.1.7,第二台PC(BDC)的IP为192.168.1.8,用户使用ip 192.168.1.7登录到应用程序。

What we want to do is if the pc user can't access the application using the ip 192.168.1.7, then use the 192.168.1.8 without the user having to do anything. 我们要做的是,如果PC用户无法使用ip 192.168.1.7访问该应用程序,则使用192.168.1.8,而无需用户执行任何操作。

We found out that you can do it with glassfish, but it use apache as an intermediary. 我们发现您可以用玻璃鱼来做,但是它使用apache作为中介。 If the pc that has apache fails then can't do failover or use the application. 如果具有apache的PC发生故障,则无法进行故障转移或使用该应用程序。 Also we have seen that we can use EasyDNS to do it using domain name, but the network has no internet access so we discarded it too. 另外,我们已经看到我们可以使用EasyDNS来使用域名来实现它,但是网络无法访问Internet,因此我们也将其丢弃。

Is there any way to do failover without depending on internet or a program in a central pc? 有什么方法可以进行故障转移而无需依赖Internet或中央PC中的程序?

One needs a way of recieving requests on one shared ip address and have them distributed over several nodes (load balancing/High-Availability failover). 人们需要一种在一个共享ip地址上接收请求并将请求分布在多个节点上的方法(负载平衡/高可用性故障转移)。

Optionally one can layer intermediary functionality between the LB/HA and the backend services, such as offloading static content, certain types of request filtering and so on. 可选地,可以在LB / HA与后端服务之间分层中介功能,例如,卸载静态内容,某些类型的请求筛选等。

For just the LB/HA one commonly uses either 仅对于LB / HA,通常使用

  • a software add-on for the already present platform, in your case Windows. 适用于现有平台(在您的情况下为Windows)的软件附件。 Windows has the built-in NLB function which is made to distribute load and provide failover for multiple identical backend servers. Windows具有内置的NLB功能,可用于分配负载并为多个相同的后端服务器提供故障转移。 The NLB is installed either directly on each backend server, or if layered features are required through separated Apache, IIS or other frontend service, directly on the frontend nodes. NLB直接安装在每个后端服务器上,或者如果需要通过单独的Apache,IIS或其他前端服务直接要求在前端节点上提供分层功能。
  • a dedicated redundant software load balancer such as HAproxy fronting the application servers. 专用冗余软件负载平衡器(例如HAproxy)位于应用程序服务器前面。
  • a dedicated redundant hardware load balancer fronting the application servers. 专用冗余硬件负载平衡器位于应用程序服务器前面。

It is not clear in your question what problem you intend to solve with Apache beyond redundancy, which it usually doesn't solve as it tends to be a single point of failure in itself. 您的问题尚不清楚,除冗余之外,您打算用Apache解决什么问题,因为冗余本身本身就是一个单点故障,所以通常不会解决。 IIS has the same dilemma where the ARR add-on is frequently used to reverse-proxy to backend servers but is a single point of failure in itself. IIS具有相同的困境,经常使用ARR附加组件将代理反向代理到后端服务器,但是它本身就是一个单点故障。 Just as Windows has NLB to provide the redundancy link for several identically configured servers (such as Java servers, IIS with ARR nodes, Apache nodes), Apache on Linux has mechanisms such as described here . 正如Windows具有NLB为多个相同配置的服务器(例如Java服务器,具有ARR节点的IIS,Apache节点)提供冗余链接一样,Linux上的Apache具有如此处所述的机制。

However, these are not as feature rich and efficient as using dedicated and specialized load balancers to front the backend servers and optional IIS/Apache/other frontend webnodes. 但是,这些功能不像使用专用负载均衡器和专用负载均衡器来前端服务器和可选IIS / Apache /其他前端Webnode那样功能丰富和高效。 Additionally they tend to create their own problem domains which limit the feature sets and create additional depencency complexes. 另外,他们倾向于创建自己的问题域,从而限制功能集并创建其他依赖复杂性。 In short, they tend to overconsume maintenance/development time unless the setup is very simple. 简而言之,除非安装非常简单,否则它们往往会过度消耗维护/开发时间。

Clustered services sharing the same disk, such as suggested in a comment, are commonly not used in web redundancy scenarios as they solve other design problems better (such as high availability file or print services). 共享同一磁盘的群集服务(如注释中建议的)通常不用于Web冗余方案,因为它们可以更好地解决其他设计问题(例如高可用性文件或打印服务)。 One reason to use web redundancy technologies as discussed in this answer is the ease with which one maintenance recycles nodes, another is the scalability factor, and so on. 如本答案所述,使用Web冗余技术的一个原因是维护易于回收节点,另一个是可伸缩性因素,依此类推。 The only drawback vs. clustering solutions is that they do not keep track of user state. 与群集解决方案相比,唯一的缺点是它们无法跟踪用户状态。 However, as clustering solutions are commonly specialized towards specific implementations to keep user session awareness, whilst web delivery solutions have a wide range of session awareness distribution such an argument is moot most of the time. 但是,由于群集解决方案通常专门针对特定的实现以保持用户会话意识,而Web交付解决方案具有广泛的会话意识分布,因此这种论点在大多数情况下都是无聊的。

Using peripheral services such as DNS for failover tends to be regarded with well founded suspicion as these with few exceptions (such as mx-pointers) are not designed with such a scenario in mind. 人们将使用DNS之类的外围服务进行故障转移的做法容易引起人们的怀疑,因为这些例外情况(例如mx指针)几乎没有在设计时考虑到这种情况。 Specialized variants which are, may still suffer from the extensive caching built into the DNS subsystems commonly in use and which form weak links in such a setup. 专用变体可能仍会受到普遍使用的DNS子系统内置的大量缓存的影响,并且在这种设置中形成弱链接。

DNS as primary redundancy mechanism may still be considered if: 在以下情况下,仍可以考虑将DNS作为主要冗余机制:

  • a (very) long failover delay is acceptable, or if: (非常长的)故障转移延迟是可以接受的,或者如果:
  • one is in complete control over the entire distributed DNS infrastructure from client to server (can guarantee switchover delay through short TTLs), or if: 一种是完全控制从客户端到服务器的整个分布式DNS基础结构(可以通过短TTL保证切换延迟),或者满足以下条件:
  • one can programmatically ensure that the client/server code can leverage DNS for rapid failover. 可以以编程方式确保客户端/服务器代码可以利用DNS进行快速故障转移。

The alternative to providing the LB/HA logic server-side is to build it into the client. 提供LB / HA逻辑服务器端的替代方法是将其构建到客户端中。

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

相关问题 如何完成Windows共享故障转移系统? - How to accomplish a Windows share failover system? 在 azure vm 上配置 MSMQ 集群故障转移(windows server 2016) - configure MSMQ cluster failover on an azure vm (windows server 2016) 如何在Windows故障转移群集管理器2012中启用“持久模式”? - How to enable “persistent mode” in Windows failover cluster manager 2012? Powershell命令更新Windows Server故障转移群集中的群集IP资源的名称 - Powershell command to update name of a Cluster IP Resource in Windows Server Failover Clustering Windows 故障转移集群 API 仍然有效吗? - Windows Failover Cluster API still Valid? 如何使用Puppet Agent在Windows服务器上运行Puppet清单? - How do I run a Puppet Manifest on a Windows server with Puppet Agent? 如何连接到XtraBackup的Windows mysql服务器 - how do I connect to a windows mysql server for XtraBackup 如何检测Windows Server 2003上的数据包丢失? - How do you detect packet-loss on Windows Server 2003? 如何在 Windows Server 2019 中实现垂直 Pod 自动缩放? - How do I implement Vertical Pod Autoscaling in Windows Server 2019? 重启后如何检测Windows服务器是否可用? - How do I detect if a Windows server is available after a reboot?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM