Load Balancing Cluster not working with Apache HTTP Server 2.4.6 and JBoss EAP 7

情到浓时终转凉″ 提交于 2019-11-27 05:22:12

Basically you have two options - either create a cluster using JBoss own domain mode or extend you standalone configuration to contain required elements for session replication and sso.

In domain mode, most of the configurations are already present in EAP7 - just extend domain-full-ha profile.

Required changes include enabling distributable flag in your web app web.xml - simply add <distributable/> to your web.xml. Next add single sign on flag to your undertow system:

  <host name="default-host" alias="localhost">                                                           
     <location name="/" handler="welcome-content"/>                                                     
     <filter-ref name="server-header"/>                                                                 
     <filter-ref name="x-powered-by-header"/>                                                           
     <single-sign-on/>    <!-- FIXME:  enable SSO here -->                                                                              
   </host>   

And enable cache container required for clustered SSO to work - this requires Infinishpan subsystem, which you might now have, if you only extended standalone-ha profile. If you do not see Infinispan subsystem, have a look at standalone-full of standalone-full-ha profiles. If you do not have it already, add web cache:

 /subsystem=infinispan/cache-container=web/distributed-cache=concurrent:add
 /subsystem=infinispan/cache-container=web/distributed-cache=concurrent/store=file:add 

Again, if you use full-ha profile of either standalone or domain mode, you will probably have these already.

Also you do not mention, if you use JBoss security domain for authorization or not. In case you use some custom auth mechanism, make sure you set the session cookie or tokens correctly - for correct domain and context etc.

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