all/deploy ディレクトリの中の cluster-service.xml ファイルは HA-JNDI サービスを有効にするために以下の MBean を含んでいます。
<mbean code="org.jboss.ha.jndi.HANamingService"
name="jboss:service=HAJNDI">
<depends>jboss:service=DefaultPartition</depends>
</mbean>
この MBean は、上記で定義された (この章のはじめの方のセクションで取り上げられた) DefaultPartition MBean に依存しているのを見ることができます。他の設定において、 HA-JNDI サービスを有効にするために、その要素を jboss-services.xml ファイルか、別の JBoss 設定ファイルを /deploy ディレクトリにおくことができます。この MBean のために利用可能な属性を以下に示します。
PartitionName は、 HA-JNDI サービスの別のノードが通信するために、クラスタの名前を指定するオプションの属性です。デフォルト値は、 DefaultPartition です。
BindAddress 属性は、 HA-JNDI サーバーがクライアントリクエストをリッスンするアドレスを指定するオプションの属性です。マルチホームコンピュータでのみ役立ちます。
Port 属性は、 HA-JNDI サーバーがクライアントリクエストをリッスンする TCP/IP ポートを指定するオプションの属性です。デフォルト値は 1100 です。
Backlog は、 JNP クライアントを待っているTCPサーバーソケットで使用するバックログ値を指定するためのオプションの属性です。デフォルト値は 50 です。
RmiPort は、ダウンロードされたスタブと通信するのに、サーバーはどのポートを使用すべきかを決定します。この属性はオプションです。もし、これが欠落していると、サーバーは自動的に RMI ポートを割り当てます。
AutoDiscoveryAddress は、 JNDI オートディスカバリのためにリッスンするマルチキャストアドレスを指定するオプションの属性です。デフォルト値は 230.0.0.4 です。
AutoDiscoveryGroup は、 JNDI オートディスカバリのためにリッスンするマルチキャストグループを指定するオプションの属性です。デフォルト値は 1102 です。
LookupPool は、ブートストラップとオートディスカバリルックアップをコントロールするために使用されるスレッドプールサービスを特定します。
DiscoveryDisabled は、オートディスカバリのマルチキャストリスナの設定を無効にする論理型フラグです。
AutoDiscoveryBindAddress は、オートディスカバリのブートストラップマルチキャストバインドアドレスを設定します。もしこの属性が特定されずに BindAddress が特定されている場合は、BindAddress が使用されます。
AutoDiscoveryTTL は、オートディスカバリの IP マルチキャストパケットのための TTL (time-to-live) を指定します。
HANamingService MBean の全てのデフォルト設定は、以下の通りです。
<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>
別のクラスタで使用するいくつかの HA-JNDI サービスを起動することが可能です。これはもしノードが沢山のクラスタの一部である場合に使用することができます。この場合、両方のサービスで別のポートや IP アドレスを設定していることを確認してください。例えば、設定済みでバインディングポートが変更されたクラスタに HA-JNDI を接続したい場合、 Mbean デスクリプタは以下のように見えます。
<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>