1 Reply Latest reply on Sep 27, 2009 11:45 PM by augustsimonelli

    jboss init script messes up jboss messaging failover?

    augustsimonelli

      Hi all,

      I'm having trouble with jboss messaging (JBoss AS 5.1 all profile) and a graceful failover.

      Given this:

      Client sending messages to HA-JNDI port on a two-node cluster. When I kill -9 one of the nodes the client fails over perfectly, no messages are lost.

      I'm using the jboss_init_redhat.sh script to handle startup and shutdown which calls stop with:

      JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"java -classpath $JBOSSCP org.jboss.Shutdown -u myuser -p mypass --shutdown -s 127.0.0.1:2099"}

      (i have hooked the jndi port into the jmx-consoles JAAS stuff AND changed it to 2099 as another app is running on the host).

      Whenever i do a

      service jboss5 stop

      calling the above command the developer reports the client does not failover but rather gets an exception:

      12:37:39,681 DEBUG org.jboss.remoting.transport.socket.SocketClientInvoker - SocketClientInvoker[136f5b6e, bisocket://10.66.4.10:4457]
      
      org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [bisocket://10.66.4.10:4457/?JBM_clientMaxPoolSize=200&clientLeasePeriod=10000&clientSocketClass=org.jboss.jms.client.remoting.ClientSocketWrapper&connectionWait=10&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&numberOfCallRetries=1&pingFrequency=214748364&pingWindowFactor=10&socket.check_connection=false&stopLeaseOnFailure=true&timeout=0&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat&validatorPingPeriod=10000&validatorPingTimeout=5000]
      
       at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:776)
      
       at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:426)
      
       at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:165)
      
       at org.jboss.remoting.ConnectionValidator.doCheckConnectionWithoutLease(ConnectionValidator.java:683)
      
       at org.jboss.remoting.ConnectionValidator.run(ConnectionValidator.java:339)
      
       at java.util.TimerThread.mainLoop(Timer.java:512)
      
       at java.util.TimerThread.run(Timer.java:462)
      
      Caused by: java.net.ConnectException: Connection refused
      
       at java.net.PlainSocketImpl.socketConnect(Native Method)
      
       at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
      
       at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
      
       at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
      
       at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
      
       at java.net.Socket.connect(Socket.java:519)
      
       at org.jboss.remoting.transport.socket.SocketClientInvoker.connect(SocketClientInvoker.java:289)
      
       at org.jboss.remoting.transport.socket.SocketClientInvoker.createSocket(SocketClientInvoker.java:206)
      
       at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.createSocket(BisocketClientInvoker.java:433)
      
       at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.getConnection(MicroSocketClientInvoker.java:1089)
      
       at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:762)
      
       ... 6 more



      We lose the messages. However, when the sending is done the client comes back and uses the new node.

      Failover appears to work fine as I can see it in the logs.

      I DO have FailoverOnNodeLeave set to true.

      So, what's the difference between a kill (or the ctrl-c'ing of run.sh, which is a trapped kill) and the org.jboss.Shutdown method?

      Can i adjust something on the server? or can the client change? i believe the developers are using spring.

      Thanks for any thoughts ...

      August