禁用 websphere 应用程序自动启动命令行或管理脚本

Disable websphere app autostart command line or admin script

我正在寻找一个管理命令或脚本来禁用自动启动由 WAS 托管的应用程序。

我通过网络界面在以下菜单中找到: Application -> Application Types -> Websphere Enterprise Applications -> 单击 App -> Details Properties: "Target specific application status" -> Select cluster 然后单击 "Disable Auto start".

但是找不到对应这个动作的命令行。

你能帮帮我吗?

提前致谢,

您可以使用 "wsadminlib.py" 脚本库轻松完成此操作,它包含一个带有签名的 setDeploymentAutoStart 函数:

这是签名和文档:

def setDeploymentAutoStart(deploymentname, enabled, deploymenttargetname=None):
    """Sets an application to start automatically, when the server starts.
    Specify enabled as a lowercase string, 'true' or 'false'.
    For example, setDeploymentAutoStart('commsvc', 'false')
    Returns the number of deployments which were found and set successfully.
    Raises exception if application is not found.
    You may optionally specify an explicit deployment target name, such as a server or cluster name.
    For example, setDeploymentAutoStart('commsvc', 'true',  deploymenttargetname='cluster1')
                 setDeploymentAutoStart('commsvc', 'false', deploymenttargetname='server1')
    If the deployment target name is not specified, autostart is set on all instances of the deployment.
    Ultimately, this method changes the 'enable' value in a deployment.xml file.  For example,
    <targetMappings xmi:id="DeploymentTargetMapping_1262640302437" enable="true" target="ClusteredTarget_1262640302439"/>
    """

使用 wsadminlib.py 就像从 github 下载它一样简单,启动 wsadmin,然后 运行 execfile /path/to/wsadminlib.py

那你只需要整理好你想要的参数,调用上面的函数就可以了