1.2.3. JBoss configuration

1.2.3. JBoss configuration

The cluster-service.xml file in the all/deploy directory includes the following MBean to enable HA-JNDI services.

<mbean code="org.jboss.ha.jndi.HANamingService"            
       name="jboss:service=HAJNDI">       
    <depends>jboss:service=DefaultPartition</depends>    
</mbean>
            

You can see that this MBean depends on the DefaultPartition MBean defined above it (discussed in an earlier section in this chapter). In other configurations, you can put that element in the jboss-services.xml file or any other JBoss configuration files in the /deploy directory to enable HA-JNDI services. The available attributes for this MBean are listed below.

The full default configuration of the HANamingService MBean is as follows.

<mbean code="org.jboss.ha.jndi.HANamingService" 
      name="jboss:service=HAJNDI"> 
    <depends>
        jboss:service=${jboss.partition.name:DefaultPartition}
    </depends> 
    <! -- Name of the partition to which the service is linked --> 
    <attribute name="PartitionName">
        ${jboss.partition.name:DefaultPartition}
    </attribute> 
    <! -- Bind address of bootstrap and HA-JNDI RMI endpoints --> 
    <attribute name="BindAddress">${jboss.bind.address}</attribute> 
    <! -- Port on which the HA-JNDI stub is made available --> 
    <attribute name="Port">1100</attribute> 
    <! -- RmiPort to be used by the HA-JNDI service once bound. 
        0 is for auto. --> 
    <attribute name="RmiPort">1101</attribute> 
    <! -- Accept backlog of the bootstrap socket --> 
    <attribute name="Backlog">50</attribute> 
    <! -- The thread pool service used to control the bootstrap and 
      auto discovery lookups --> 
    <depends optional-attribute-name="LookupPool" 
        proxy-type="attribute">jboss.system:service=ThreadPool</depends>

    <! -- A flag to disable the auto discovery via multicast --> 
    <attribute name="DiscoveryDisabled">false</attribute> 
    <! -- Set the auto-discovery bootstrap multicast bind address. --> 
    <attribute name="AutoDiscoveryBindAddress">
        ${jboss.bind.address}
    </attribute> 
    
    <! -- Multicast Address and group port used for auto-discovery --> 
    <attribute name="AutoDiscoveryAddress">
        ${jboss.partition.udpGroup:230.0.0.4}
    </attribute> 
    <attribute name="AutoDiscoveryGroup">1102</attribute> 
    <! -- The TTL (time-to-live) for autodiscovery IP multicast packets --> 
    <attribute name="AutoDiscoveryTTL">16</attribute>

    <! -- Client socket factory to be used for client-server 
           RMI invocations during JNDI queries 
    <attribute name="ClientSocketFactory">custom</attribute> 
    --> 
    <! -- Server socket factory to be used for client-server 
           RMI invocations during JNDI queries 
    <attribute name="ServerSocketFactory">custom</attribute> 
    --> 
</mbean>            
            

It is possible to start several HA-JNDI services that use different clusters. This can be used, for example, if a node is part of many clusters. In this case, make sure that you set a different port or IP address for both services. For instance, if you wanted to hook up HA-JNDI to the example cluster you set up and change the binding port, the Mbean descriptor would look as follows.

<mbean code="org.jboss.ha.jndi.HANamingService"    
       name="jboss:service=HAJNDI">    
    <depends>jboss:service=MySpecialPartition</depends>    
    <attribute name="PartitionName">MySpecialPartition</attribute>    
    <attribute name="Port">56789</attribute>  
</mbean>