[wildfly-dev] 2 instance cluster in master/slave

Arun Gupta arun.gupta at gmail.com
Fri May 30 13:54:38 EDT 2014


>
> A couple other options that would be fun to play with:
>
> 1. Using Undertow’s reverse proxy like this (assuming you named the nodes pi1, pi2, and thus they have a pi1, pi2 jvmroute, which defaults to the host name if you didn’t set it):
>
>  <reverse-proxy name="reverse-proxy" connections-per-thread=“20">
>       <host name=“http://p1.example:8080" instance-id=“pi1”/>
>       <host name=“http://p2.example:8080" instance-id=“pi2"/>
>  </reverse-proxy>

Where will I add this fragment ?

>
> 2. You could also use undertow 1.1 standalone which has a mod_cluster impl (coming to WildFly soon)
>
> https://github.com/undertow-io/undertow/blob/master/examples/src/main/java/io/undertow/examples/reverseproxy/ModClusterProxyServer.java
>
> (requires alteration for your topology)
OK, let me try the simpler route first.

I'm having issues building mod_cluster on ARM and following up on that
separately. Seems like I may have to use mod_proxy for now since this
is baked into Apache2 for ARM.

>> The session ids are indeed different. Just pushed out the latest blog
>> in this series at:
>>
>> http://blog.arungupta.me/2014/05/wildfly-managed-domain-raspberrypi-techtip27/
>>
>> The session id are shown towards the end in screen snapshots, and are
>> indeed different.
>
> So the problem is you need to either have a shared cookie domain, or use an LB, since the cookie domain has to match the URL for the browser to send the same cookie. You can do this in either the global config (standalone.xml under servlet-container), or you can add a setting to your web.xml like this:
>
> <session-config>
>    <cookie-domain>.example</cookie-domain>
> </session-config>

Can this element be added to domain.xml as well for the managed domain mode ?

>
> Then you want to add host entries to hosts:
>
> pi1.example 10.x.x.x
> pi2.example 10.x.x.x

These entries would be made in each individual /etc/hosts ?

Arun

>
>
> After you do that you should be able to stick pi1.example and pi2.example in the browser.
>
> --
> Jason T. Greene
> WildFly Lead / JBoss EAP Platform Architect
> JBoss, a division of Red Hat
>



-- 
http://blog.arungupta.me
http://twitter.com/arungupta



More information about the wildfly-dev mailing list