1 つの asadmin コマンド、create-converged-lb を使用すると、次のステップを実行できます。
ロードバランサ設定を作成します。
asadmin create-converged-lb-config コマンドを使用します。
ロードバランサが管理するクラスタまたはスタンドアロンサーバーインスタンスへの参照を追加します。
asadmin create-converged-lb-ref コマンドを使用します。
クラスタ配備の設定および定義の繰り返し処理を実行するときは、--autocommit を false に設定することをお勧めします。デフォルトで、このオプションは false に設定されています。これは主に中間融合ロードバランサファイルの生成を防止することが目的です。この設定がないと、domain.xml の変更のたびに中間ファイルが生成され、融合ロードバランサ自体の設定の表示に影響を及ぼします。クラスタ配備定義が展開の安定段階に達した時点で、--autocommit を true に設定します。
次の一連の asadmin コマンドでは、クラスタ、ノードエージェント、および自己負荷分散融合ロードバランサを設定します。
asadmin> create-cluster cluster1
Command create-cluster executed successfully.
asadmin>create-node-agent --user admin --passwordfile pass.txt
--host host1 nodeagent1
Command create-node-agent executed successfully.
asadmin>create-node-agent --user admin --passwordfile pass.txt
--host host1 nodeagent2
Command create-node-agent executed successfully.
asadmin>create-instance --user admin --passwordfile pass.txt --nodeagent nodeagent1
--cluster cluster1 cluster1_instance1
Command create-instance executed successfully.
asadmin> create-instance --user admin --passwordfile pass.txt
--nodeagent nodeagent2 --cluster cluster1 cluster1_instance2
Command create-instance executed successfully.
asadmin> create-converged-lb --user admin --passwordfile pass.txt
--configfile clb.xml --autocommit=true --lbenableallinstances=true
--target cluster1 clb-1
Command create-converged-lb executed successfully.
asadmin> start-node-agent nodeagent1
Command start-node-agent started successfully.
asadmin> start-node-agent nodeagent2
Command start-node-agent started successfully.
asadmin> start-cluster cluster1
cluster1_instance1 is running, does not require restart
cluster1_instance2 is running, does not require restart
Command start-cluster executed successfully.
|
ロードバランサを作成したときにクラスタがすでに起動している場合、ロードバランサを起動するには、クラスタを再起動する必要があります。
これらの asadmin コマンドの詳細については、『Sun GlassFish Communications Server 1.5 Reference Manual 』 を参照してください。