2 Replies Latest reply on Aug 16, 2012 6:40 AM by lkuettner

    Need multiple connections for remote standalone client to clustered server

    lkuettner Newbie

      Hi there,

       

      I'd like to setup multiple initial connections (EJB receivers) for a remote standalone client to a clustered server. I expected to achieve this easily with the following configuration in jboss-ejb-client.properties:

       

      remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
      
      remote.connections=default,other
      
      remote.connection.default.host=192.168.0.1
      remote.connection.default.port=4447
      remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
      
      remote.connection.other.host=192.168.0.2
      remote.connection.other.port=4447
      remote.connection.other.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
      

       

      This works fine for a non-clustered multiple-server setup but not if the servers are clustered like this:

      ./standalone.sh -c standalone-ha.xml -Djboss.node.name=Server1 -b=192.168.0.1 -bmanagement=192.168.0.1
      ./standalone.sh -c standalone-ha.xml -Djboss.node.name=Server2 -b=192.168.0.2 -bmanagement=192.168.0.2
      

       

      The application hangs while attempting to lookup an EJB.

       

      The log up to this point is as follows:

      15.08.2012 20:45:15 org.jboss.ejb.client.EJBClient <clinit>
      INFO: JBoss EJB Client version 1.0.10.Final
      15.08.2012 20:45:17 org.xnio.Xnio <clinit>
      INFO: XNIO Version 3.0.3.GA
      15.08.2012 20:45:17 org.xnio.nio.NioXnio <clinit>
      INFO: XNIO NIO Implementation Version 3.0.3.GA
      15.08.2012 20:45:17 org.jboss.remoting3.EndpointImpl <clinit>
      INFO: JBoss Remoting version 3.2.7.GA
      15.08.2012 20:45:18 org.jboss.ejb.client.remoting.VersionReceiver handleMessage
      INFO: EJBCLIENT000017: Received server version 1 and marshalling strategies [river]
      15.08.2012 20:45:18 org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
      INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@4824de7d, receiver=Remoting connection EJB receiver [connection=Remoting connection <31f9338f>,channel=jboss.ejb,nodename=Server1]} on channel Channel ID c98a47cb (outbound) of Remoting connection 348dcd5d to /192.168.0.1:4447
      

       

      I get the same behaviour with both the latest nightly AS 7 build as well as the current EAP 6.

       

      Any idea what could be wrong with my configuration - or is this a bug?

        • 1. Re: Need multiple connections for remote standalone client to clustered server
          Ondra Chaloupka Apprentice

          I think that it's an issue. Jira on similar behaviour is here:  https://issues.jboss.org/browse/JBPAPP-9349

          I added the link of this thread to the jira.

          • 2. Re: Need multiple connections for remote standalone client to clustered server
            lkuettner Newbie

            Hi Ondřej, I agree with your analysis. However, the description you gave in Jira seems quite complicated and unneccessarily so.

             

            Perhaps I should add that I can reproduce the problem on a single host (localhost) with the following configuration in jboss-ejb-client.properties:

             

            remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false

            remote.connections=default,other

            remote.connection.default.host=localhost

            remote.connection.default.port=4447

            remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

            remote.connection.other.host=localhost

            remote.connection.other.port=4547

            remote.connection.other.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

             

            Starting my two server nodes like this:

            ./standalone.sh -c=standalone-ha.xml -Djboss.node.name=Server1

            ./standalone.sh -c standalone-ha.xml -Djboss.node.name=Server2 -Djboss.socket.binding.port-offset=100

             

            Everything works fine most of the time but sometimes the client gets stuck not on the initial lookup (as erroneously described above) but on the first EJB method invocation.

            Even in my initial setup with the two servers bound to their own respective virtual network interface, sometimes the behaviour is alright but at other times the client just hangs and must be killed from the outside.

             

            I've composed a small Swing app with which the behaviour can be easily examined:

            https://github.com/lkuettner/jbosscc-as7-examples/tree/master/cluster-client-example

             

            Just build everything, start two AS 7 instances like described above (the second with a port offset of 100) and deploy cluster-example-server.jar on each of them. Now run the client and press the "invoke" button. If you see an SLSB node name, start the client over again - until it gets stuck eventually.

             

            Maybe some JBoss developer can have a look into this - Jaikiran?