10.3. 既存サーバーの高可用性設定を変更する
既存の JBoss EAP の高可用性設定を変更する場合は、jgroups サブシステムに以下の変更を加える必要があります。
手順
管理 CLI を起動し、サーバーを埋め込み、選択した設定ファイルにオフライン変更を行います。以下に例を示します。
$ EAP_HOME/bin/jboss-cli.sh [disconnected /] embed-server --server-config=standalone-ha.xmlデフォルトでは、JGroups は UDP スタックを使用します。別のスタックを使用していた場合は、UDP スタックの使用に戻ります。
[standalone@embedded /] /subsystem=jgroups/channel=ee:write-attribute(name=stack,value=udp)以下のバッチコマンドを実行して既存の UDP スタックを削除し、Microsoft Azure 用に設定された新しい UDP スタックを挿入します。
重要次のコマンドで使用される
storage_access_keyのエンコードは Base64 である必要があります。batch /subsystem=jgroups/stack=udp:remove /subsystem=jgroups/stack=udp:add() /subsystem=jgroups/stack=udp/transport=UDP:add(socket-binding=jgroups-udp,properties={ip_mcast=false}) /subsystem=jgroups/stack=udp/protocol=azure.AZURE_PING:add(properties={storage_account_name="${jboss.jgroups.azure_ping.storage_account_name}", storage_access_key="${jboss.jgroups.azure_ping.storage_access_key}", container="${jboss.jgroups.azure_ping.container}"}) /subsystem=jgroups/stack=udp/protocol=MERGE3:add /subsystem=jgroups/stack=udp/protocol=FD_SOCK2:add(socket-binding=jgroups-udp-fd) /subsystem=jgroups/stack=udp/protocol=FD_ALL3:add /subsystem=jgroups/stack=udp/protocol=VERIFY_SUSPECT2:add /subsystem=jgroups/stack=udp/protocol=pbcast.NAKACK2:add(properties={use_mcast_xmit=false,use_mcast_xmit_req=false}) /subsystem=jgroups/stack=udp/protocol=UNICAST3:add /subsystem=jgroups/stack=udp/protocol=pbcast.STABLE:add /subsystem=jgroups/stack=udp/protocol=pbcast.GMS:add /subsystem=jgroups/stack=udp/protocol=UFC:add /subsystem=jgroups/stack=udp/protocol=MFC:add /subsystem=jgroups/stack=udp/protocol=FRAG4:add run-batch注記設定ファイルで Microsoft Azure ストレージアカウントおよび blob コンテナーの値を保存する場合は、上記の設定のシステムプロパティーの参照を Azure 環境の値に置き換えます。以下のコマンドは、JBoss EAP を起動する例で、システムプロパティーを使用します。
設定ファイルのスタック XML は以下のようになります。
<stack name="udp"> <transport type="UDP" socket-binding="jgroups-udp"/> <protocol type="RED"/> <protocol type="azure.AZURE_PING"> <property name="storage_account_name">${jboss.jgroups.azure_ping.storage_account_name}</property> <property name="storage_access_key">${jboss.jgroups.azure_ping.storage_access_key}</property> <property name="container">${jboss.jgroups.azure_ping.container}</property> </protocol> <protocol type="MERGE3"/> <socket-protocol type="FD_SOCK2" socket-binding="jgroups-udp-fd"/> <protocol type="FD_ALL3"/> <protocol type="VERIFY_SUSPECT2"/> <protocol type="pbcast.NAKACK2"/> <protocol type="UNICAST3"/> <protocol type="pbcast.STABLE"/> <protocol type="pbcast.GMS"/> <protocol type="UFC"/> <protocol type="MFC"/> <protocol type="FRAG4"/> </stack>埋め込みサーバーを停止し、管理 CLI を終了します。
[standalone@embedded /] stop-embedded-server [disconnected /] exit