How to configure same context applications to use different machines with ModCluster and Wildfly10

北城余情 提交于 2019-12-03 22:45:53
Thiago Chagas

I've found the solution for my problem using only one Wildfly's profile.

For this, I have used two balancers and used ProxyPass to use the specific balancer.


Wildfly: At the Domain Controller's Console admin url, go to:

Configuration: Profiles Profile: URL-HA Subsystem: ModCluster

On the Advertising tab, change the Balancer value:

${projectcluster.modcluster.balancer:mybalancer}

Add System Properties to both the server-groups

Runtime -> Server Groups -> URLA -> View

On the System Properties tab, add:

Key 'projectcluster.modcluster.balancer' value 'first'

Key 'jboss.modcluster.multicast.address' value '224.0.2.108'

Runtime -> Server Groups -> URLB -> View

On the System Properties tab, add:

Key 'projectcluster.modcluster.balancer' value 'second'

Key 'jboss.modcluster.multicast.address' value '224.0.2.108'

After this, restart your server-groups URLA and URLB


Apache Using the example Apache conf on the question:

...  
...

  ManagerBalancerName mybalancer
  ServerAdvertise on
  EnableMCPMReceive On
  # Defined on Wildfly
  AdvertiseGroup 224.0.2.108:23364

  <Location /mod_cluster-manager>
    SetHandler mod_cluster-manager
    Order deny,allow
    Allow from all
  </Location>
</VirtualHost>

Listen 10.90.0.13:8001

<VirtualHost 10.90.0.13:8001>
  ProxyPass        / balancer://first stickysession=JSESSIONID|jsessionid nofailover=On
  ProxyPassReverse / balancer://first
</VirtualHost>

Listen 10.90.0.13:8002

<VirtualHost 10.90.0.13:8002>
  ProxyPass        / balancer://second stickysession=JSESSIONID|jsessionid nofailover=On
  ProxyPassReverse / balancer://second
</VirtualHost>

All the request on 10.90.0.13:8001/system1 will be sent to first balancer and on the 10.90.0.13:8002/system1 will be sent to second balancer

And that is it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!