-
1. Re: Jboss 7.2 Clustering Forward ejb request to other member nodes
sketcha Aug 9, 2013 12:35 AM (in response to sketcha)Hi All, Any help on this.
In Jboss AS 4 we had options like making us of HaPartiotion API to execute the request on a remote node. In case of EJB invocation this could have been achieved by setting the Loadbalency policy to @clustered annotation to a single writer where target would be chosen depending on the load. how to achive the same in jboss 7?
-
2. Re: Jboss 7.2 Clustering Forward ejb request to other member nodes
rhusar Aug 12, 2013 7:55 AM (in response to sketcha)Not sure what you need the forward for. You could easily implement invocation scheme like this: Client -> ServiceA on cluster A -> ServiceB on cluster B where a client invokes an EJB that forwards the call = invokes a method on a different EJB running in a different cluster.
If you mean forward for the sake of loadbalancing I don't find that a good approach. Implement a ClusterNodeSelector (http://docs.jboss.org/ejbclient/1.0.5.Final/org/jboss/ejb/client/ClusterNodeSelector.html) to select the best node for the invocation of the @Clustered bean.
-
3. Re: Jboss 7.2 Clustering Forward ejb request to other member nodes
sketcha Aug 12, 2013 8:18 AM (in response to rhusar)Hi,
Thanks for the answer. there are set operation which need to be executed centrally from one place( mostly database write operation to maintain consistency). i already tried the approach mentioned. Invoking ejb present on one server from another. However as i understand this needs outbound connection configuration to be present in the standalone-ha.xml or so. which has an implication that ip address and remoting ports of all the participating nodes to be available before hand. and there will be no provision to dynamically add the cluster nodes and also this would requre a static user name and we loose the flexiblity of the authentication mechanism configured. In jboss 4 this was done by HaPartion classes callMethodOnCluster() and other method. Also the the interceptor level there was a provision to choose the target from the cluste node list. Is there any such approach for achiving the same?
-
4. Re: Jboss 7.2 Clustering Forward ejb request to other member nodes
jaikiran Aug 12, 2013 8:34 AM (in response to sketcha)k koushik wrote:
However as i understand this needs outbound connection configuration to be present in the standalone-ha.xml or so. which has an implication that ip address and remoting ports of all the participating nodes to be available before hand.
No, you don't need the IP address or host names of the cluster nodes. The ClusterNodeSelector which Rado mentioned will be passed the node names of the cluster nodes which belong to the cluster. You can then choose one among them.
-
5. Re: Jboss 7.2 Clustering Forward ejb request to other member nodes
sketcha Aug 12, 2013 8:43 AM (in response to jaikiran)Hi Jaikiran,
I understand that if i go by the way of clusterNodeselector, the client could decide to which node the request should be setnt to and in my case this will serve the purpose partially. The reason being the ejb's are also accessed via a wrapped webservice layer. and this webservice is open for access i.e the user could develop their own web service client. so shifitng the node selection intelleigence to client side doesn't completely help. BTW i mentioned the requirement of Ipaddress/ports of cluster nodes in case if the requestes need to be formwarded to other node after landing on one node by means of server-server ejb lookup. i think the accessing ejb's from remote server instance needs the outbound connection needs to be configured. Please let me know if this is not the case
-
6. Re: Jboss 7.2 Clustering Forward ejb request to other member nodes
wdfink Aug 12, 2013 1:47 PM (in response to sketcha)I did not understand the requirement why you need "forwarding". If you have a node visible in the selector this node is available to handle the EJB access and there is no need to forward it.
Could you describe a bit more of what you want to achieve, maybe we talk about different things
-
7. Re: Jboss 7.2 Clustering Forward ejb request to other member nodes
rhusar Aug 12, 2013 4:52 PM (in response to sketcha)The reason being the ejb's are also accessed via a wrapped webservice layer.
Could you expose the webservice via load-balancer? e.g. mod_cluster can do all the dynamic work
i think the accessing ejb's from remote server instance needs the outbound connection needs to be configured
Yes thats correct, as seen here https://docs.jboss.org/author/display/AS72/EJB+invocations+from+a+remote+server+instance
IIUC these can be dynamically added so its just deployment management thing
Could you describe a bit more of what you want to achieve, maybe we talk about different things
-
8. Re: Jboss 7.2 Clustering Forward ejb request to other member nodes
sketcha Aug 13, 2013 5:58 AM (in response to rhusar)HI Rado, Wolf thanks for the responses.
Here is what i am looking for.
My application could be deployed either as a single node or cluster (2/3/4 nodes). In case of single node there is no issue.
In case of the Cluster configuration a set of operation needs to be always performed by only one node( the node which my application treats as master).
How ever the client(either via ejb lookup or webservice) could point to any of the nodes in the cluster setup.but these set of operations should be routed to the node which my application treats as master
in the earlier versions we had achieved this by making use of HAPartitionImpl.callRemoteMethod() and Clusternode selection at interceptor level (@cluster annotation and using custom loadbalencing policy)
-
9. Re: Jboss 7.2 Clustering Forward ejb request to other member nodes
rhusar Aug 13, 2013 6:57 AM (in response to sketcha)1 of 1 people found this helpfulYou need to use SingletonService to achieve true HA singleton behavior.
-
10. Re: Jboss 7.2 Clustering Forward ejb request to other member nodes
sketcha Aug 14, 2013 5:15 AM (in response to rhusar)Thanks Rado For the Hint.
I went through and also i looked in to HA singleton quickstart at https://github.com/jboss-jdf/jboss-as-quickstart/tree/master/cluster-ha-singleton.
however when we try to access the service by using service controller i see only method available is getvalue.
can youe please throw some lights on how i could use this in my situation
-
11. Re: Jboss 7.2 Clustering Forward ejb request to other member nodes
sketcha Aug 19, 2013 6:08 AM (in response to sketcha)Hi,
I just tried to change the behavior of the service of thequickstart
https://github.com/jboss-jdf/jboss-as-quickstart/tree/master/cluster-ha-singleton.
The following changes have been made. I defined a custom interface(HaTimer) which just has two methods and then i made the the service class to implement this interface and registered is as serivice of type (HaTimer).
With this modification when i deployed the jar on a cluster setup and i started the client pointing to the node where service is not active.
with this i could see that the call to get value is going in a inifinet loop. Could anyone please help in resolving this issue.
I have attached the changes and log from both nodes.
-
dep2server.log.zip 196.0 KB
-
server.log.zip 154.7 KB
-
cluster-ha-singleton.rar.zip 45.6 KB
-
-
12. Re: Jboss 7.2 Clustering Forward ejb request to other member nodes
rhusar Aug 19, 2013 7:59 AM (in response to sketcha)I suppose the EJB timers is not what you were after exactly. SingletonService guarantees that the wrapped service is running only once in one cluster.
Maybe this https://github.com/rhusar/jboss-as-quickstart/commit/68d96ab956ab88c5a950a543c4a8fc341384a702 could be helpful, the service does a SFSB lookup and the returns a proxy to the SFSB that is either invoked locally or remotely.
-
13. Re: Jboss 7.2 Clustering Forward ejb request to other member nodes
sketcha Aug 19, 2013 8:33 AM (in response to rhusar)Yes i am more interested about accessing the ejbs. However instead of returning the proxy to the caller i am trying to complete the whole operation with in service and return the response back to caller. the reason being if i return the proxy to the remote caller, for the further method invocation on the proxy we would require to have the Outbound ejb connections to be configured which mandates the availability of Ip address of all the participating nodes statically. In my case the cluster nodes are added dynamically. and for that reason i am trying to decorate the service with other interfaces where few methods are defined and depending on the information passed to these methods corresponding operation would be performed locally