[英]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,通常使用
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作为主要冗余机制:
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.