Author: ataylor
Date: 2011-01-28 04:22:51 -0500 (Fri, 28 Jan 2011)
New Revision: 10156
Modified:
branches/Branch_2_2_EAP/docs/eap-manual/en/clusters.xml
Log:
reformatted and added max hops comment
Modified: branches/Branch_2_2_EAP/docs/eap-manual/en/clusters.xml
===================================================================
--- branches/Branch_2_2_EAP/docs/eap-manual/en/clusters.xml 2011-01-28 03:43:14 UTC (rev
10155)
+++ branches/Branch_2_2_EAP/docs/eap-manual/en/clusters.xml 2011-01-28 09:22:51 UTC (rev
10156)
@@ -97,10 +97,10 @@
something like:
</para>
<programlisting>
-
<large-messages-directory>/media/shared/data/large-messages</large-messages-directory>
-
<bindings-directory>/media/shared/data/bindings</bindings-directory>
-
<journal-directory>/media/shared/data/journal</journal-directory>
-
<paging-directory>/media/shared/data/paging</paging-directory>
+
<large-messages-directory>/media/shared/data/large-messages</large-messages-directory>
+
<bindings-directory>/media/shared/data/bindings</bindings-directory>
+ <journal-directory>/media/shared/data/journal</journal-directory>
+ <paging-directory>/media/shared/data/paging</paging-directory>
</programlisting>
<para>
How these paths are configured will of course depend on your network
settings or file system.
@@ -121,7 +121,7 @@
file like so:
</para>
<programlisting>
- <failover-on-shutdown>false</failover-on-shutdown>
+ <failover-on-shutdown>false</failover-on-shutdown>
</programlisting>
<para>Don't worry if you have this set to false (which is the
default) but still want failover to occur,
simply
@@ -137,28 +137,28 @@
example:
</para>
<programlisting>
- <connection-factory name="NettyConnectionFactory">
- <xa>true</xa>
- <connectors>
- <connector-ref connector-name="netty"/>
- </connectors>
- <entries>
- <entry name="/ConnectionFactory"/>
- <entry name="/XAConnectionFactory"/>
- </entries>
+ <connection-factory name="NettyConnectionFactory">
+ <xa>true</xa>
+ <connectors>
+ <connector-ref connector-name="netty"/>
+ </connectors>
+ <entries>
+ <entry name="/ConnectionFactory"/>
+ <entry name="/XAConnectionFactory"/>
+ </entries>
- <ha>true</ha>
- <!-- Pause 1 second between connect attempts -->
- <retry-interval>1000</retry-interval>
+ <ha>true</ha>
+ <!-- Pause 1 second between connect attempts -->
+ <retry-interval>1000</retry-interval>
- <!-- Multiply subsequent reconnect pauses by this multiplier.
This can be used to
- implement an exponential back-off. For our purposes we just set to 1.0
so each reconnect
- pause is the same length -->
-
<retry-interval-multiplier>1.0</retry-interval-multiplier>
+ <!-- Multiply subsequent reconnect pauses by this multiplier. This can be
used to
+ implement an exponential back-off. For our purposes we just set to 1.0 so each
reconnect
+ pause is the same length -->
+ <retry-interval-multiplier>1.0</retry-interval-multiplier>
- <!-- Try reconnecting an unlimited number of times (-1 means
"unlimited") -->
- <reconnect-attempts>-1</reconnect-attempts>
- </connection-factory>
+ <!-- Try reconnecting an unlimited number of times (-1 means
"unlimited") -->
+ <reconnect-attempts>-1</reconnect-attempts>
+ </connection-factory>
</programlisting>
<para>We have added the following attributes to the connection
factory used by the client:</para>
@@ -216,44 +216,44 @@
directory but in reality it doesn't matter where this is put. This
will look like:
</para>
<programlisting>
- <?xml version="1.0" encoding="UTF-8"?>
+ <?xml version="1.0" encoding="UTF-8"?>
- <deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <deployment xmlns="urn:jboss:bean-deployer:2.0">
- <!-- The core configuration -->
- <bean name="BackupConfiguration"
class="org.hornetq.core.config.impl.FileConfiguration">
- <property
-
name="configurationUrl">${jboss.server.home.url}/deploy/hornetq-backup1/hornetq-configuration.xml</property>
- </bean>
+ <!-- The core configuration -->
+ <bean name="BackupConfiguration"
class="org.hornetq.core.config.impl.FileConfiguration">
+ <property
+
name="configurationUrl">${jboss.server.home.url}/deploy/hornetq-backup1/hornetq-configuration.xml</property>
+ </bean>
- <!-- The core server -->
- <bean name="BackupHornetQServer"
class="org.hornetq.core.server.impl.HornetQServerImpl">
- <constructor>
- <parameter>
- <inject bean="BackupConfiguration"/>
- </parameter>
- <parameter>
- <inject bean="MBeanServer"/>
- </parameter>
- <parameter>
- <inject bean="HornetQSecurityManager"/>
- </parameter>
- </constructor>
- <start ignored="true"/>
- <stop ignored="true"/>
- </bean>
+ <!-- The core server -->
+ <bean name="BackupHornetQServer"
class="org.hornetq.core.server.impl.HornetQServerImpl">
+ <constructor>
+ <parameter>
+ <inject bean="BackupConfiguration"/>
+ </parameter>
+ <parameter>
+ <inject bean="MBeanServer"/>
+ </parameter>
+ <parameter>
+ <inject bean="HornetQSecurityManager"/>
+ </parameter>
+ </constructor>
+ <start ignored="true"/>
+ <stop ignored="true"/>
+ </bean>
- <!-- The JMS server -->
- <bean name="BackupJMSServerManager"
class="org.hornetq.jms.server.impl.JMSServerManagerImpl">
- <constructor>
- <parameter>
- <inject bean="BackupHornetQServer"/>
- </parameter>
- </constructor>
- </bean>
+ <!-- The JMS server -->
+ <bean name="BackupJMSServerManager"
class="org.hornetq.jms.server.impl.JMSServerManagerImpl">
+ <constructor>
+ <parameter>
+ <inject bean="BackupHornetQServer"/>
+ </parameter>
+ </constructor>
+ </bean>
- </deployment>
+ </deployment>
</programlisting>
<para>
The first thing to notice is the BackupConfiguration bean. This is
configured to pick up the
@@ -284,101 +284,104 @@
and configure it like so:
</para>
<programlisting>
- <configuration xmlns="urn:hornetq"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:hornetq
/schema/hornetq-configuration.xsd">
+ <configuration xmlns="urn:hornetq"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
- <jmx-domain>org.hornetq.backup1</jmx-domain>
+ <jmx-domain>org.hornetq.backup1</jmx-domain>
- <clustered>true</clustered>
+ <clustered>true</clustered>
- <backup>true</backup>
+ <backup>true</backup>
- <shared-store>true</shared-store>
+ <shared-store>true</shared-store>
- <allow-failback>true</allow-failback>
+ <allow-failback>true</allow-failback>
-
<log-delegate-factory-class-name>org.hornetq.integration.logging.Log4jLogDelegateFactory</log-delegate-factory-class-name>
+
<log-delegate-factory-class-name>org.hornetq.integration.logging.Log4jLogDelegateFactory</log-delegate-factory-class-name>
-
<bindings-directory>/media/shared/data/hornetq-backup/bindings</bindings-directory>
+
<bindings-directory>/media/shared/data/hornetq-backup/bindings</bindings-directory>
-
<journal-directory>/media/shared/data/hornetq-backup/journal</journal-directory>
+
<journal-directory>/media/shared/data/hornetq-backup/journal</journal-directory>
- <journal-min-files>10</journal-min-files>
+ <journal-min-files>10</journal-min-files>
-
<large-messages-directory>/media/shared/data/hornetq-backup/largemessages</large-messages-directory>
+
<large-messages-directory>/media/shared/data/hornetq-backup/largemessages</large-messages-directory>
-
<paging-directory>/media/shared/data/hornetq-backup/paging</paging-directory>
+
<paging-directory>/media/shared/data/hornetq-backup/paging</paging-directory>
- <connectors>
- <connector name="netty-connector">
-
<factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
- <param key="host"
value="${jboss.bind.address:localhost}"/>
- <param key="port"
value="${hornetq.remoting.backup.netty.port:5446}"/>
- </connector>
+ <connectors>
+ <connector name="netty-connector">
+
<factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
+ <param key="host"
value="${jboss.bind.address:localhost}"/>
+ <param key="port"
value="${hornetq.remoting.backup.netty.port:5446}"/>
+ </connector>
- <connector name="in-vm">
-
<factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
- <param key="server-id"
value="${hornetq.server-id:0}"/>
- </connector>
+ <connector name="in-vm">
+
<factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
+ <param key="server-id"
value="${hornetq.server-id:0}"/>
+ </connector>
- </connectors>
+ </connectors>
- <acceptors>
- <acceptor name="netty">
-
<factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
- <param key="host"
value="${jboss.bind.address:localhost}"/>
- <param key="port"
value="${hornetq.remoting.backup.netty.port:5446}"/>
- </acceptor>
- </acceptors>
+ <acceptors>
+ <acceptor name="netty">
+
<factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
+ <param key="host"
value="${jboss.bind.address:localhost}"/>
+ <param key="port"
value="${hornetq.remoting.backup.netty.port:5446}"/>
+ </acceptor>
+ </acceptors>
- <broadcast-groups>
- <broadcast-group name="bg-group1">
- <group-address>231.7.7.7</group-address>
- <group-port>9876</group-port>
- <broadcast-period>1000</broadcast-period>
- <connector-ref>netty-connector</connector-ref>
- </broadcast-group>
- </broadcast-groups>
+ <broadcast-groups>
+ <broadcast-group name="bg-group1">
+ <group-address>231.7.7.7</group-address>
+ <group-port>9876</group-port>
+ <broadcast-period>1000</broadcast-period>
+ <connector-ref>netty-connector</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>60000</refresh-timeout>
- </discovery-group>
- </discovery-groups>
+ <discovery-groups>
+ <discovery-group name="dg-group1">
+ <group-address>231.7.7.7</group-address>
+ <group-port>9876</group-port>
+ <refresh-timeout>60000</refresh-timeout>
+ </discovery-group>
+ </discovery-groups>
- <cluster-connections>
- <cluster-connection name="my-cluster">
- <address>jms</address>
- <connector-ref>netty-connector</connector-ref>
- <discovery-group-ref
discovery-group-name="dg-group1"/>
- </cluster-connection>
- </cluster-connections>
+ <cluster-connections>
+ <cluster-connection name="my-cluster">
+ <address>jms</address>
+ <connector-ref>netty-connector</connector-ref>
+ <discovery-group-ref discovery-group-name="dg-group1"/>
+ <!--max hops defines how messages are redistributed, the default is 1
meaning only distribute to directly
+ connected nodes, to disable set to 0-->
+ <!--<max-hops>0</max-hops>-->
+ </cluster-connection>
+ </cluster-connections>
- <security-settings>
- <security-setting match="#">
- <permission type="createNonDurableQueue"
roles="guest"/>
- <permission type="deleteNonDurableQueue"
roles="guest"/>
- <permission type="consume"
roles="guest"/>
- <permission type="send" roles="guest"/>
- </security-setting>
- </security-settings>
+ <security-settings>
+ <security-setting match="#">
+ <permission type="createNonDurableQueue"
roles="guest"/>
+ <permission type="deleteNonDurableQueue"
roles="guest"/>
+ <permission type="consume" roles="guest"/>
+ <permission type="send" roles="guest"/>
+ </security-setting>
+ </security-settings>
- <address-settings>
- <!--default for catch all-->
- <address-setting match="#">
-
<dead-letter-address>jms.queue.DLQ</dead-letter-address>
-
<expiry-address>jms.queue.ExpiryQueue</expiry-address>
- <redelivery-delay>0</redelivery-delay>
- <max-size-bytes>10485760</max-size-bytes>
-
<message-counter-history-day-limit>10</message-counter-history-day-limit>
- <address-full-policy>BLOCK</address-full-policy>
- </address-setting>
- </address-settings>
+ <address-settings>
+ <!--default for catch all-->
+ <address-setting match="#">
+ <dead-letter-address>jms.queue.DLQ</dead-letter-address>
+ <expiry-address>jms.queue.ExpiryQueue</expiry-address>
+ <redelivery-delay>0</redelivery-delay>
+ <max-size-bytes>10485760</max-size-bytes>
+
<message-counter-history-day-limit>10</message-counter-history-day-limit>
+ <address-full-policy>BLOCK</address-full-policy>
+ </address-setting>
+ </address-settings>
- </configuration>
+ </configuration>
</programlisting>
<para>
@@ -430,6 +433,10 @@
The Broadcast groups, Discovery group and cluster configurations are as
per normal, details of these
can be found in the HornetQ user manual.
</para>
+ <note>
+ <para>notice the commented out
<literal>max-hops</literal> in the cluster connection, set this to 0 if
+ you want to disable server side load balancing.</para>
+ </note>
<para>
When the backup becomes it will be not be servicing any JEE components
on this eap instance. Instead any
existing messages will be redistributed around the cluster and new
messages forwarded to and from the backup
@@ -524,26 +531,26 @@
as in the last diagram. Then simply edit the
<literal>jms-ds.xml</literal> and change the following lines to
</para>
<programlisting>
- <config-property name="ConnectorClassName"
type="java.lang.String">org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</config-property>
- <config-property name="ConnectionParameters"
type="java.lang.String">host=127.0.0.1;port=5446</config-property>
+ <config-property name="ConnectorClassName"
type="java.lang.String">org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</config-property>
+ <config-property name="ConnectionParameters"
type="java.lang.String">host=127.0.0.1;port=5446</config-property>
</programlisting>
<para>
This will change the outbound JCA connector, to configure the inbound
connector for MDB's edit the
<literal>ra.xml</literal> config file and change the following
parameters.
</para>
<programlisting>
- <config-property>
- <description>The transport type</description>
-
<config-property-name>ConnectorClassName</config-property-name>
-
<config-property-type>java.lang.String</config-property-type>
-
<config-property-value>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</config-property-value>
- </config-property>
- <config-property>
- <description>The transport configuration. These values must be in the
form of key=val;key=val;</description>
-
<config-property-name>ConnectionParameters</config-property-name>
-
<config-property-type>java.lang.String</config-property-type>
-
<config-property-value>host=127.0.0.1;port=5446</config-property-value>
- </config-property>
+ <config-property>
+ <description>The transport type</description>
+
<config-property-name>ConnectorClassName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+
<config-property-value>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</config-property-value>
+ </config-property>
+ <config-property>
+ <description>The transport configuration. These values must be in the
form of key=val;key=val;</description>
+
<config-property-name>ConnectionParameters</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+
<config-property-value>host=127.0.0.1;port=5446</config-property-value>
+ </config-property>
</programlisting>
<para>
In both cases the host and port should match your live server. If you are
using Discovery then set the