Configure JBoss

Configure JBoss for use in an Codar clustered environment:

  1. Open the <codar_home>/jboss-as/standalone/configuration/standalone-full-ha.xml (for Linux) or <codar_home>\jboss-as\standalone\configuration\standalone-full-ha.xml (for Windows) file in a text editor.

  2. Locate the <server xmlns="urn:jboss:domain:2.2"> property and configure a unique name for the node. For example, locate <server xmlns="urn:jboss:domain:2.2" name="CHANGE_ME!!"> and set the name to [Codar_Node_Name].

  3. Update the JGroups subsystem default stack from udp to tcp:

    <subsystem xmlns="urn:jboss:domain:jgroups:2.0" default-stack="udp">

    For example,

    <subsystem xmlns="urn:jboss:domain:jgroups:2.0" default-stack="tcp">
  4. Locate the TCP stack and replace <protocol type="MPING" socket-binding="jgroups-mping"/> with:

    <protocol type="TCPPING">
       <property name="initial_hosts">[LIST_OF_INITIAL_HOSTS]</property>
          <property name="num_initial_members">[NUMBER_OF_INITIAL_HOSTS]</property>
          <property name="port_range">1</property>
          <property name="timeout">2000</property>
    </protocol>

    where

    • [LIST_OF_INITIAL_HOSTS] is a comma-separated list of nodes (IP address and port) that define the cluster. It is recommended that all known nodes in the controller cluster are listed. Other nodes that are not listed may join the cluster and you can remove a node from the list at any time. However, at least one initial host (a node in the list of initial hosts) must be running in order for other nodes (that are not included in this list) to join the cluster. The more the initial hosts listed means that there is a greater chance an initial host is running so that an unlisted node may join the cluster (if no initial hosts are running, no unlisted nodes may join the cluster). Once the cluster is running, if you update the list of initial hosts, you must restart all nodes in the cluster. The following are examples of a list of three initial hosts: [codar_node1_ip_address][7600],[codar_node2_ip_address][7600],[codar_node3_ip_address][7600] or 111.222.333.444[7600],111.222.333.445[7600],111.222.333.446[7600]

    • [NUMBER_OF_INITIAL_HOSTS] is the number of initial hosts specified in the cluster.

    For example:

    <protocol type="TCPPING">
       <property name="initial_hosts">111.222.333.444[7600],111.222.333.445[7600],
    111.222.333.446[7600]
    </property>
          <property name="num_initial_members">3</property>
          <property name="port_range">1</property>
          <property name="timeout">2000</property>
    </protocol>

    A TCP-based channel may be less efficient than its UDP counterpart as the size of the cluster increases beyond four to six nodes.

  5. In the TCP stack, replace:

    <protocol type="pbcast.NAKACK2"/>

    with

    <protocol type="pbcast.NAKACK2">
       <property name="use_mcast_xmit">false</property>
       <property name="use_mcast_xmit_req">false</property>
    </protocol>

  6. Update the messaging subsystem password. Change

    <cluster-password>${jboss.messaging.cluster.password:CHANGE ME!!}</cluster-password>

    to

    <cluster-password>password</cluster-password>

  7. Locate the transactions subsystem and configure the node identifier for the <core-environment> property (set the node identifier to the unique node name you configured in step 2. Locate

    <subsystem xmlns="urn:jboss:domain:transactions:2.0">
       <core-environment>

    and add set the node identifier to <codar_node_name>. For example:

    <subsystem xmlns="urn:jboss:domain:transactions:2.0">
       <core-environment node-identifier="codar_node1">

  8. Add the node's IP address to the public interface. Locate <interface name="public"> and add the IP address of the Codar node.For example:

    <interface name="public">
       <inet-address value="${jboss.bind.address:<codar_node_ip_address>}"/>
    </interface>