6 Replies Latest reply: Oct 30, 2011 4:14 PM by Penumbra Shadow RSS

Clustering HornetQ in AS7

Jim Crossley Newbie

How do I do it?

  • 1. Re: Clustering HornetQ in AS7
    Jim Crossley Newbie

    It doesn't seem to be enough to add <clustered>true</clustered> to the messaging subsystem inside standalone.xml.  Using the hornetq-configuration.xml from AS6 as a guide, apparently I need to define some discovery-groups and cluster-connections to achieve the message load-balancing behavior, but the MessagingSubsystemParser barfs on those elements.

     

    What am I missing?

  • 2. Re: Clustering HornetQ in AS7
    Clebert Suconic Master

    You will need to add the cluster-connection, yes...

     

    take a look at our hornetq standalone distribution, under hornetq-2.2.5.Final/config/stand-alone/clustered for how to add it.

     

     

    If it doesn't work we will need to figure out what's going on.

     

     

    Andy Taylor should be able to give us some insight here also.

  • 3. Re: Clustering HornetQ in AS7
    Vinicius Carvalho Apprentice

    Hi guys, I'm facing the same issue here. I read the example from stand-alone, and add the following lines to my standalone-preview-ha.xml on JBoss 7:

     

        <broadcast-groups>

              <broadcast-group name="bg-group1">

                 <group-address>231.7.7.7</group-address>

                 <group-port>9876</group-port>

                 <broadcast-period>5000</broadcast-period>

                 <connector-ref>netty</connector-ref>

              </broadcast-group>

       </broadcast-groups>

     

     

       <discovery-groups>

              <discovery-group name="dg-group1">

                 <group-address>231.7.7.7</group-address>

                 <group-port>9876</group-port>

                 <refresh-timeout>10000</refresh-timeout>

              </discovery-group>

       </discovery-groups>

           <cluster-connections>


              <cluster-connection name="my-cluster">

                 <address>jms</address>

                 <connector-ref>netty</connector-ref>
              <discovery-group-ref discovery-group-name="dg-group1"/>

              </cluster-connection>
       </cluster-connections>

     

    But I get an exception by Jboss XML parser:

     

    12:42:20,278 ERROR [stderr] Exception in thread "Controller Boot Thread" java.lang.RuntimeException: org.jboss.as.controller.persistence.ConfigurationPersistenceException: Failed to parse configuration

    12:42:20,279 ERROR [stderr]           at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:89)

    12:42:20,280 ERROR [stderr]           at java.lang.Thread.run(Thread.java:619)

    12:42:20,280 ERROR [stderr] Caused by: org.jboss.as.controller.persistence.ConfigurationPersistenceException: Failed to parse configuration

    12:42:20,280 ERROR [stderr]           at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:115)

    12:42:20,280 ERROR [stderr]           at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:104)

    12:42:20,281 ERROR [stderr]           at org.jboss.as.server.ServerService.boot(ServerService.java:193)

    12:42:20,281 ERROR [stderr]           at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:83)

    12:42:20,281 ERROR [stderr]           ... 1 more

    12:42:20,281 ERROR [stderr] Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[306,7]

    12:42:20,281 ERROR [stderr] Message: Unexpected element '{urn:jboss:domain:messaging:1.0}broadcast-groups' encountered

     

    Which is kinda acward since I've checked the schema at $JBOSS_HOME\docs\schema\jboss-messaging.xsd and

     

              <xs:element maxOccurs="1" minOccurs="0" name="broadcast-groups">

                  <xs:complexType>

                      <xs:sequence>

                          <xs:element maxOccurs="unbounded" minOccurs="0" name="broadcast-group" type="broadcast-groupType" />

                      </xs:sequence>

                  </xs:complexType>

              </xs:element>

     

    Any ideas on how to get this running?

     

    Regards

  • 4. Re: Clustering HornetQ in AS7
    Penumbra Shadow Newbie

    This is how I clustered using standalone mode - two instances of JBoss AS 7 running on the same host

    http://bitly.com/o2cZ0i

  • 5. Re: Clustering HornetQ in AS7
    Clebert Suconic Master

    @Vinicius: Can you add the whole file here. I'm not sure what you're missing.

     

     

    Use advanced editor-> attach file.

  • 6. Re: Clustering HornetQ in AS7
    Penumbra Shadow Newbie

    With some help from the TorqueBox lead, Bob McWhirter, HornetQ is clustering in domain mode with the following:

    http://bitly.com/vynpjQ