13.2.13. TCP を使用するよう JGroups サブシステムを設定

mod_cluster サブシステムは、クラスターでのノードの脱退、参加、およびフェイルオーバーを管理および追跡するために JGroups サブシステムに依存します。デフォルトでは、JGroups サブシステムはマルチキャスト UDP を使用して通信します。以下の手順を実行して JGroups サブシステムがユニキャスト TCP を代わりに使用するよう設定します。
mod_cluster サブシステムが TCP も使用するよう設定するには、「TCP を使用するよう mod_cluster サブシステムを設定」を参照してください。
  1. Management CLI を実行します。

    EAP_HOME/bin/jboss-cli.sh コマンド (Linux) または EAP_HOME\bin\jboss-cli.bat コマンド (Microsoft Windows Server の場合) を使用して管理 CLI を起動します。connect と入力して localhost 上のドメインコントローラーに接続するか、connect IP_ADDRESS と入力してリモートサーバー上のドメインコントローラーに接続します。
  2. お使いの環境に合わせて以下のスクリプトを変更します。

    以下のスクリプトをテキストエディターにコピーします。管理対象ドメインで異なるプロファイルを使用する場合は、プロファイル名を変更します。スタンドアロンサーバーを使用する場合は、コマンドの /profile=full-ha 部分を削除します。以下のように、コマンドの最下部にリストされたプロパティーを変更します。これらの各プロパティーはオプションです。
    initial_hosts
    既知と見なされたホストのカンマ区切りのリストであり、初期メンバーシップを検索するために使用できます。
    port_range
    必要な場合は、ポート範囲を割り当てることができます。2 のポート範囲を割り当て、初期ポートが 7600 である場合は、TCPPING がポート 7600 〜 7601 の各ホストに通信しようとします。このプロパティーはオプションです。
    timeout
    クラスターメンバーのオプションタイムアウト値 (ミリ秒単位)
    num_initial_members
    クラスターが完了したと見なされるまでのノード数。このプロパティーはオプションです。
    /profile=full-ha/subsystem=jgroups/stack=tcpping:add(transport={"type" => "TCP", "socket-binding" => "jgroups-tcp"})
    /profile=full-ha/subsystem=jgroups/stack=tcpping/:add-protocol(type=FD_SOCK,socket-binding=jgroups-tcp-fd)
    /profile=full-ha/subsystem=jgroups/stack=tcpping/:add-protocol(type=pbcast.FLUSH)
    /profile=full-ha/subsystem=jgroups/stack=tcpping/:add-protocol(type=FD)
    /profile=full-ha/subsystem=jgroups/stack=tcpping/:add-protocol(type=VERIFY_SUSPECT)
    /profile=full-ha/subsystem=jgroups/stack=tcpping/:add-protocol(type=BARRIER)
    /profile=full-ha/subsystem=jgroups/stack=tcpping/:add-protocol(type=FRAG2)
    /profile=full-ha/subsystem=jgroups/stack=tcpping/:add-protocol(type=MERGE2)
    /profile=full-ha/subsystem=jgroups/stack=tcpping/:add-protocol(type=pbcast.GMS)
    /profile=full-ha/subsystem=jgroups/stack=tcpping/:add-protocol(type=pbcast.STATE_TRANSFER)
    /profile=full-ha/subsystem=jgroups/stack=tcpping/:add-protocol(type=UNICAST2)
    /profile=full-ha/subsystem=jgroups/stack=tcpping/:add-protocol(type=TCPPING)
    /profile=full-ha/subsystem=jgroups/stack=tcpping/:add-protocol(type=UFC)
    /profile=full-ha/subsystem=jgroups/stack=tcpping/:add-protocol(type=MFC)
    /profile=full-ha/subsystem=jgroups/stack=tcpping/:add-protocol(type=pbcast.NAKACK)
    /profile=full-ha/subsystem=jgroups/stack=tcpping/:add-protocol(type=pbcast.STABLE)
    /profile=full-ha/subsystem=jgroups:write-attribute(name=default-stack,value=tcpping)
    /profile=full-ha/subsystem=jgroups/stack=tcpping/protocol=TCPPING/property=initial_hosts/:add(value="HostA[7600],HostB[7600]")
    /profile=full-ha/subsystem=jgroups/stack=tcpping/protocol=TCPPING/property=port_range/:add(value=0)
    /profile=full-ha/subsystem=jgroups/stack=tcpping/protocol=TCPPING/property=timeout/:add(value=3000)
    /profile=full-ha/subsystem=jgroups/stack=tcpping/protocol=TCPPING/property=num_initial_members/:add(value=3)
    
  3. スクリプトをバッチモードで実行します。

    警告

    バッチファイルを実行する前に、プロファイルを実行しているサーバーをシャットダウンする必要があります。
    管理 CLI プロンプトで、batch と入力し、Enter キーを押します。プロンプトはハッシュ (#) 記号を含むよう変更され、バッチモードであることが示されます。これにより、一連のコマンドを入力できるようになります。これらのいずれかが失敗した場合は、操作全体がロールバックされます。
    以前の手順の変更されたスクリプトを貼り付け、最後に新しい行を追加します。run-batch と入力してバッチを実行します。すべてのコマンドが実行されたら、メッセージ「The batch executed successfully」が表示されます。
結果

TCPPING スタックが JGroups サブシステムで利用できるようになります。JGroups サブシステムは、すべてのネットワーク通信に TCP を使用します。mod_cluster サブシステムが TCP も使用するよう設定するには、「TCP を使用するよう mod_cluster サブシステムを設定」を参照してください。