简体   繁体   English

Wildfly 11负载平衡2个服务器节点

[英]Wildfly 11 load balancing 2 server nodes

I need to be able to redirect to one of 2 server nodes by hitting the load balancer. 我需要能够通过点击负载平衡器来重定向到2个服务器节点之一。 The load balancer does not need to load balance but failover in case one of the server nodes fail. 负载平衡器不需要负载平衡,但可以在其中一个服务器节点发生故障时进行故障转移。

I have both server nodes able to connect to the load balancer. 我有两个服务器节点都能够连接到负载均衡器。 For the life of me, I cannot find a solution on how to proceed. 对于我的一生,我找不到如何进行的解决方案。 I am using wildfly 11 on windows server. 我在Windows服务器上使用wildfly 11。

this is the output when loading the load balancer (with the servers running as well) - 这是加载负载平衡器时的输出(服务器也正在运行)-

12:09:24,592 INFO  [io.undertow] (default task-1) UT005053: Registering node Primary, connection: ajp://10.2.133.229:8009/?#
 12:09:24,623 INFO  [io.undertow] (default task-2) UT005045: Registering context /, for node Primary
12:09:24,623 INFO  [io.undertow] (default task-2) UT005045: Registering context /wildfly-services, for node Primary
12:09:30,638 INFO  [io.undertow] (default task-2) UT005053: Registering node Secondary, connection: ajp://10.2.133.230:8009/?#
12:09:30,654 INFO  [io.undertow] (default task-2) UT005045: Registering context /, for node Secondary
12:09:30,670 INFO  [io.undertow] (default task-2) UT005045: Registering context /wildfly-services, for node Secondary

My setup is as follows: 我的设置如下:

Load-balancer has an Ip of 10.2.133.228
Server1 has an Ip of 10.2.133.229
Server2 has an Ip of 10.2.133.230

Both "Servers" have the same deployed application on both of them. 两个“服务器”在两个服务器上都具有相同的已部署应用程序。

I would like to input the load-balancer Ip address and hit one of 2 available servers. 我想输入负载均衡器IP地址并点击2个可用服务器之一。 If one of the 2 servers fail I would like it to failover automatically to the other server. 如果2台服务器之一发生故障,我希望它自动故障转移到另一台服务器。

If you don't need to balance, you can use a reverse proxy, one good option could be Cherokee. 如果不需要平衡,可以使用反向代理,切诺基是一个不错的选择。

http://cherokee-project.com/doc/modules_handlers_proxy.html http://cherokee-project.com/doc/modules_handlers_proxy.html

It is easy to configure. 易于配置。 You can set up a lot of servers to answer every request and when one of these servers fail, the new requests will be sent to another server. 您可以设置很多服务器来回答每个请求,并且其中一个服务器发生故障时,新请求将发送到另一台服务器。

You can install your certificate SSL in the reverse proxy too. 您也可以在反向代理中安装证书SSL。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM