We have web service deployed with JBOSS EAP 6.0/7.1.2 Final. What if we want all the REST calls from one IP directly route to the same JBOSS node?
I have configured mod_cluster successfully discovered two nodes, with sticky session set to true.
However, from two node's access log, we still see apache server dispatch services in round robin way. Below is the setting from standalone.xml:
<subsystem xmlns="urn:jboss:domain:modcluster:1.1">
<mod-cluster-config advertise-socket="modcluster" connector="ajp">
<simple-load-provider factor="1"/>
</mod-cluster-config>
</subsystem>
My question is: how to let apache mod_cluster forward REST requests according to requester's source IP?
Below is the dump:
balancer: [1] Name: mycluster Sticky: 1 [JSESSIONID]/[jsessionid] remove: 0 force: 0 Timeout: 0 maxAttempts: 1
node: [1:1],Balancer: mycluster,JVMRoute: 6c4eb258-4bd9-3f9f-82e0-33eec8005ce6,LBGroup: [],Host: server1.xxx.com,Port: 8009,Type: ajp,flushpackets: 0,flushwait: 10,ping: 10,smax: 26,ttl: 60,timeout: 0
node: [2:2],Balancer: mycluster,JVMRoute: f13844c3-cc18-3559-940e-730eac5f013d,LBGroup: [],Host: server2.xxx.com,Port: 8009,Type: ajp,flushpackets: 0,flushwait: 10,ping: 10,smax: 26,ttl: 60,timeout: 0
host: 1 [default-host] vhost: 1 node: 1
host: 2 [localhost] vhost: 1 node: 1
host: 3 [example.com] vhost: 1 node: 1
host: 4 [default-host] vhost: 1 node: 2
host: 5 [localhost] vhost: 1 node: 2
host: 6 [example.com] vhost: 1 node: 2
context: 1 [/web] vhost: 1 node: 1 status: 1
context: 3 [/app] vhost: 1 node: 1 status: 1
context: 4 [/jamon] vhost: 1 node: 1 status: 1
context: 5 [/web] vhost: 1 node: 2 status: 1
context: 7 [/app] vhost: 1 node: 2 status: 1
context: 8 [/jamon] vhost: 1 node: 2 status:
How many requester's source IP do you have?