简体   繁体   English

如何从wsadmin终止Websphere App Server实例?

[英]How to terminate websphere app server instance from wsadmin?

I have a jython script which stops and starts a websphere application server v7 instance. 我有一个jython脚本,该脚本停止并启动一个Websphere Application Server v7实例。 I normally use AdminControl.stopServer command for the stopping, but sometimes the instance gets hung up, and the request thread times out. 我通常使用AdminControl.stopServer命令进行停止,但是有时实例被挂起,并且请求线程超时。 Then I have to terminate the instance from the web console. 然后,我必须从Web控制台终止实例。 Is there a way to make the instance "terminate" immediately, rather than wait for a graceful stop ? 有没有办法使实例立即“终止”,而不是等待正常停止? I basically want the web console terminate button functionality in wsadmn. 我基本上希望Web控制台在wsadmn中终止按钮功能。

Command assistance says: 指挥协助说:

AdminControl.invoke('WebSphere:name=NodeAgent,process=nodeagent,platform=common,node=node1,diagnosticProvider=true,version=8.5.5.2,type=NodeAgent,mbeanIdentifier=NodeAgent,cell=ndcell,spec=1.0', 'terminate', '[server1]', '[java.lang.String]') AdminControl.invoke('WebSphere:name = NodeAgent,process = nodeagent,platform = common,node = node1,diagnosticProvider = true,version = 8.5.5.2,type = NodeAgent,mbeanIdentifier = NodeAgent,cell = ndcell,spec = 1.0', 'terminate','[server1]','[java.lang.String]')

def getNodeNameForServer(serverName):
    nodes = AdminConfig.list("Node").split("\n")
    for node in nodes:
        nodeServers = AdminConfig.list("Server", node).split("\n")
        for nodeServer in nodeServers:
            sname = AdminConfig.showAttribute(nodeServer, "name")
            if sname == serverName:
                nname = AdminConfig.showAttribute(node, "name")
                return nname
    return 'NONE'

def terminateServer(serverName):
    nodeName=getNodeNameForServer(serverName)
    if (nodeName != "NONE"): 
        print '\nTerminating server: %s\n' % (serverName)
        nodeAgentObj=AdminControl.completeObjectName('type=NodeAgent,node='+nodeName+',*')
        print AdminControl.invoke(nodeAgentObj, 'terminate', '['+serverName+']', '[java.lang.String]')

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将使用wsadmin从websphere提取的ConfigProperties_server1.props转换为xml或json文件? - How to convert the ConfigProperties_server1.props which is extracted from websphere using wsadmin to xml or json file? 如何通过wsadmin更改WebSphere Application Server数据源URL? - How to changing WebSphere Application Server datasource URL by wsadmin? 编辑 WebSphere 变量 - 来自 wsadmin - Editing WebSphere variables - from wsadmin 如何从WebSphere 7.0的wsadmin控制台获取当前应用程序状态 - How to get current application state from wsadmin console for WebSphere 7.0 从WSAdmin脚本更改后,如何刷新Websphere配置? - How to refresh the Websphere configuration when changed from WSAdmin script? 如何使用 wsadmin 创建脚本以在 websphere 应用程序服务器中导入和删除个人证书? - How to create script to import and delete personal certificate in websphere application server using wsadmin? 获取WebSphere app Server的实例名称 - Getting instance name of a WebSphere app Server Websphere wsadmin读取csv - Websphere wsadmin read csv 如何使用wsadmin通过命令行在WebSphere Application Server v.8.5中安装(或卸载)EAR? - How do I install (or uninstall) an EAR in WebSphere Application Server v.8.5 via command line, using wsadmin? 如何通过wsadmin + WebSphere 7启用“通过JDBC驱动程序进行验证” DataSource属性 - How to Enable “Validation by JDBC driver” DataSource property via wsadmin + WebSphere 7
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM