启动和停止websphere服务器远程

时间:2015-10-01 22:09:22

标签: ant websphere websphere-traditional

我需要脚本来启动和停止web sphere服务器。

我的要求是需要编写我需要在Hudson中配置的build.xml 启动和停止Web sphere应用程序服务器。

我完成了所有任务,但停止并开始不熟悉的蚂蚁脚本。 请提供任何示例。

2 个答案:

答案 0 :(得分:2)

这取决于您使用的是WebSphere Classic还是WebSphere Liberty。这两种产品都有启动/停止服务器脚本,但它们略有不同。

WebSphere Classic:
start:$ WAS_INSTALL_HOME / bin / startServer< servername>
停止:$ WAS_INSTALL_HOME / bin / stopServer< servername>

WebSphere Liberty:
开始:$ WLP_INSTALL_HOME / bin / server start< servername>
停止:$ WLP_INSTALL_HOME / bin / server stop< servername>

一旦您知道如何手动执行这些命令,就可以使用ant< sshexec>任务在远程服务器上运行命令。

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

答案 1 :(得分:0)

使用以下ant脚本启动和停止WebSphere Server:

<!--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" />
相关问题