2015-10-01 92 views
0

我需要腳本來啓動和停止web球體服務器。啓動和停止websphere服務器遠程

我的要求是需要寫的build.xml,我需要在哈德森 配置來啓動和停止的Web Sphere應用服務器。

我完成了所有的任務,但停止和開始在不熟悉的螞蟻腳本。 請提供任何示例。

回答

2

這取決於您是否使用WebSphere Classic或WebSphere Liberty。兩款產品都有啓動/停止服務器腳本,但它們稍有不同。

的WebSphere經典:
開始:$ WAS_INSTALL_HOME /斌/ startserver的<服務器名稱>
站:$ WAS_INSTALL_HOME /斌/ stopServer <服務器名稱>

的WebSphere自由:
開始:$ WLP_INSTALL_HOME /斌/服務器啓動<服務器名稱>
站:$ WLP_INSTALL_HOME /斌/服務器停止<服務器名稱>

一旦你知道如何手動執行這些命令,你可以使用ant < sshexec>任務到遠程服務器上運行的命令。

<sshexec host="somehost" username="user1" password="pwd1" command="/path/to/WAS/bin/server start myserver"/> 
0

使用下面的啓動Ant腳本和停止WebSphere服務器:

<!--Stop Server--><sshexec host="websphere.host.IP" username="websphere.host.username" password="websphere.host.password" 
     command="$sudo server_location/bin/stopServer.sh server_name" trust="true" /> 

<!--Start Server--><sshexec host="websphere.host.IP" username="websphere.host.username" password="websphere.host.password" 
     command="$sudo server_location/bin/startServer.sh server_name" trust="true" />