2 Replies Latest reply on Sep 25, 2013 2:09 PM by jbertram

    Core client fails to reconnect to backup/live when listening to 0.0.0.0

    brenuart

      I started two standalone HornetQ 2.3.8.Final instances configured as a live/backup pair with replication. I want them to listen on all interfaces so their Netty connector (and acceptors) are configured with the following parameters:

      <param key="host" value="0.0.0.0"/>
      <param key="port" value="5445" />
      

       

      The failover between the two is working: backup detects the live, synchronises and takes over when the live is gone.

      Unfortunately, core clients connected to the live - like a core bridge for instance - fail to reconnect to the backup after the live is dead. Strange enough it tries to connect to itself... In fact, it probably tries to connect to 0.0.0.0 which resolves to itself ;-) Here is what we can see in the logs:

       

      19:35:10,748 DEBUG [org.hornetq.core.client] Trying to connect at the main server using connector :TransportConfiguration(name=netty-connector, factory=org-hornetq-core-remoting-impl-netty-NettyConnectorFactory) ?port=5445&host=0-0-0-0
      19:35:10,749 DEBUG [org.hornetq.core.client] Remote destination: /0.0.0.0:5445
      19:35:10,750 ERROR [org.hornetq.core.client] HQ214016: Failed to create netty connection: java.net.UnknownHostException: macbolo.local: macbolo.local: nodename nor servname provided, or not known
        at java.net.InetAddress.getLocalHost(InetAddress.java:1466) [rt.jar:1.7.0_25]
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:198) [rt.jar:1.7.0_25]
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) [rt.jar:1.7.0_25]
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) [rt.jar:1.7.0_25]
        at java.net.Socket.connect(Socket.java:579) [rt.jar:1.7.0_25]
      

       

      So my questions:

      - listening to 0.0.0.0 doesn't seem to be a good idea at all. Shouldn't HornetQ simply refuse to start in this case?

      - how should I configure my live and backup servers if I want them to listen to both host interfaces ?

       

      Thanks for your help,

       

      /Bertrand