-
1. Re: Fail to run AutomaticFailoverExample
clebert.suconic Nov 6, 2009 2:44 PM (in response to anthonylee)This is a place being heavily changed before next release.
I would wait the release, or if you really want to take a look, check out trunk, and build a release to look at how it is done now. We still have some docs to change before the release, but I think is pretty accurate now:
You can do:
svn co http://anonsvn.jboss.org/repos/hornetq/trunk/
cd trunk
./build.sh distro
and use the distribution generated under ./build. -
2. Re: Fail to run AutomaticFailoverExample
anthonylee Nov 6, 2009 2:44 PM (in response to anthonylee)My question is :
For HornetQ's current version, to get fail over functionality, does it matter how I shutdown the live server ? -
3. Re: Fail to run AutomaticFailoverExample
timfox Nov 7, 2009 3:09 AM (in response to anthonylee)What have you set the attribute FailoverOnServerShutdown too? (see user manual).
How did you manually "kill" the server? If you did CTRL-C that's not actually a kill, it will start an orderly shutdown of the server.
Default value of this attribute is false
public static final boolean DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN = false; -
4. Re: Fail to run AutomaticFailoverExample
anthonylee Nov 9, 2009 11:12 AM (in response to anthonylee)Hi,
Thanks for reply.
What have you set the attribute FailoverOnServerShutdown too? (see user manual).
----I didn't set this attribute.
The example fail to run only because I change the way to shutdown server.
How did you manually "kill" the server? If you did CTRL-C that's not actually a kill, it will start an orderly shutdown of the server.
---Yes, I used CTRL-C to shutdown the server in Ubuntu terminal.
1. Does it mean if the server is orderly shutdown failoverexample's client will fail to send connection request to backup server?
2. Would you tell me how to shutdown the server in other way? -
5. Re: Fail to run AutomaticFailoverExample
timfox Nov 9, 2009 11:33 AM (in response to anthonylee)This is explained in section 39.2 of the user manual:
http://hornetq.sourceforge.net/docs/hornetq-2.0.0.BETA5/user-manual/en/html/ha.html
Sometimes you want a client to failover onto a backup server even if the live server is just cleanly shutdown rather than having crashed or the connection failed. To configure this you can set the property FailoverOnServerShutdown to false either on the HornetQConnectionFactory if you're using JMS or in the hornetq-jms.xml file when you define the connection factory, or if using core by setting the property directly on the ClientSessionFactoryImpl instance after creation. The default value for this property is false, this means that by default HornetQ clients will not failover to a backup server if the live server is simply shutdown cleanly. -
6. Re: Fail to run AutomaticFailoverExample
timfox Nov 9, 2009 11:34 AM (in response to anthonylee)"Killing" the server means either killing the server process, e.g. killall -9 java on the server, or pulling the network plug for more than clientFailureCheckPeriod
-
7. Re: Fail to run AutomaticFailoverExample
anthonylee Nov 9, 2009 1:24 PM (in response to anthonylee)Yes, It works using kill -9 pid.
Thanks a lot, Tim. -
8. Re: Fail to run AutomaticFailoverExample
vpothnis Nov 16, 2009 2:55 PM (in response to anthonylee)Hello,
I am trying to run the automatic failover example provided with the distribution. I executed "ant" at the "automatic-failover" directory and I get the following error:[java] HornetQServer_0 err:[Thread-2 (group:HornetQ-server-threads3205962-2898048)] 11:50:52,257 INFO [org.hornetq.core.server.impl.HornetQServerImpl] Backup server is now operational [java] HornetQServer_1 err:[Main Thread] 11:50:52,304 INFO [org.hornetq.core.server.impl.HornetQServerImpl] HornetQ Server version 2.0.0.BETA5 (horne t-baby, 108) started [java] HornetQServer_1 out:STARTED:: [java] Nov 16, 2009 11:50:52 AM org.hornetq.common.example.HornetQExample getContext [java] INFO: using server1\client-jndi.properties for jndi [java] Sent message: This is text message 0 [java] Sent message: This is text message 1 [java] Sent message: This is text message 2 [java] Sent message: This is text message 3 [java] Sent message: This is text message 4 [java] Sent message: This is text message 5 [java] Sent message: This is text message 6 [java] Sent message: This is text message 7 [java] Sent message: This is text message 8 [java] Sent message: This is text message 9 [java] Killing server 1 [java] Nov 16, 2009 11:50:53 AM org.hornetq.core.logging.Logger warn [java] WARNING: Connection failure has been detected: Netty exception [code=0] [java] Nov 16, 2009 11:50:53 AM org.hornetq.core.logging.Logger warn [java] WARNING: Connection failure has been detected: Netty exception [code=0] [java] javax.jms.JMSException: Timed out waiting for response when sending packet 74 [java] at org.hornetq.core.remoting.impl.ChannelImpl.sendBlocking(ChannelImpl.java:304) [java] at org.hornetq.core.client.impl.ClientConsumerImpl.doCleanUp(ClientConsumerImpl.java:745) [java] at org.hornetq.core.client.impl.ClientConsumerImpl.close(ClientConsumerImpl.java:315) [java] at org.hornetq.jms.client.HornetQMessageConsumer.close(HornetQMessageConsumer.java:335) [java] at org.hornetq.jms.client.HornetQSession.close(HornetQSession.java:457) [java] at org.hornetq.jms.client.HornetQConnection.close(HornetQConnection.java:446) [java] at org.hornetq.jms.example.AutomaticFailoverExample.runExample(AutomaticFailoverExample.java:129) [java] at org.hornetq.common.example.HornetQExample.run(HornetQExample.java:73) [java] at org.hornetq.jms.example.AutomaticFailoverExample.main(AutomaticFailoverExample.java:36) [java] Caused by: HornetQException[errorCode=3 message=Timed out waiting for response when sending packet 74] [java] ... 9 more [java] [java] ##################### [java] ### FAILURE! ### [java] ##################### [java] Java Result: 1 BUILD FAILED C:\Tools\HornetQ-2.0.0.BETA5\examples\jms\automatic-failover\build.xml:23: The following error occurred while executing this line: C:\Tools\HornetQ-2.0.0.BETA5\examples\common\build.xml:142: Example org.hornetq.jms.example.AutomaticFailoverExample failed
Any inputs on this?
-Thanks
Vinay