0

これは、build.xml で定義されている再起動ターゲット コードです。


ターゲット名="再起動"

propertycopy name="remote.host" from="deploy.${target.env}.host.${remote.id}"

propertycopy name="remote.port" from="deploy.${target.env}.port.${remote.id}"

sshexec trust="true"
     host="${remote.host}"
     port="${remote.port}"
     username="${scm.user}"
     keyfile="${scm.user.key}"
     command="sudo /usr/local/bin/bounce_jboss"

目標


サーバー情報は build.properties で定義されます。

上記のコードは正常に動作していますが、サーバー 1 を停止してから開始し、その後別のサーバーを停止して開始するため、再起動プロセスが非常に遅くなります。

45 秒の時間枠で両方のサーバーを並行して再起動する方法はありますか。

4

2 に答える 2

1

Have you investigated the Ant Parallel task? You should be able to parallelise the rebooting fairly simply using this.

e.g.

<parallel>
    <!-- first server reboot -->
    <ssh ...>
    <!-- second server reboot -->
    <ssh ...>
</parallel>
于 2009-12-16T21:23:58.737 に答える
0

並列タスクが機能します。もう一つの例:

<target name="restart" ... >
    <parallel>
        <!-- first server reboot call -->
        <!-- second server reboot call -->
    </parallel>
</target>

コマンドラインから:

>ant restart

「ant restart」を 2 回実行しないでください。一度だけ呼び出すと、サーバーは一度だけ再起動する必要があります。

于 2009-12-16T22:57:36.823 に答える