【问题标题】:How do you automate setting the preferred coordinator servers in Websphere Application Server using Jython scripts?如何使用 Jython 脚本在 Websphere Application Server 中自动设置首选协调器服务器?
【发布时间】:2019-10-10 12:43:15
【问题描述】:

我们正在尝试使用 Jython 代码自动化“首选服务器协调器”JVM 列表,并使用 wsadmin 实用程序运行它。手动方法是登录 Admin Console 并选择 Servers > Core Groups > Coure group settings > DefaultCoreGroup > Preferred Coordinator Servers

通过在管理控制台中进行更改并使用显示要使用的 Jython 代码的“命令帮助”链接,我们已经自动化了大部分 Websphere Application Server 构建。此任务没有该功能。

代码如下所示: AdminTask.listChains('(cells/wamt13Cell01/nodes/wamt13CellManager01/servers/dmgr|server.xml#TransportChannelService_1)', '[-acceptorFilter DCSInboundChannel]')

完成后,我们希望为首选协调服务器框设置 JVM。

【问题讨论】:

    标签: websphere jython wsadmin


    【解决方案1】:

    使用以下代码 sn-p 为核心组配置“首选协调服务器”

    在运行脚本之前更新变量“coreGroupPrefServer”和“coreGroupName”,以根据您的环境配置分别更新首选服务器名称和核心组名称。

    #User Input: Define preferred server name below
    coreGroupPrefServer='server1'
    
    
    #Get config id of the preferred coreGroup Server
    coreGroupPrefServerId=AdminConfig.getid('/CoreGroupServer:%s' %coreGroupPrefServer)
    
    #Define coreGroupName below, default is 'DefaultCoreGroup'
    coreGroupName='DefaultCoreGroup'
    
    #Get config id for the coreGroup defined above
    coreGroupId=AdminConfig.getid('/CoreGroup:%s' %coreGroupName)
    
    
    #Remove preferredCoordinatorServers if any already configured
    AdminConfig.unsetAttributes(coreGroupId, '[preferredCoordinatorServers]')
    
    #Set the user provided coreGroupPrefServer as the preferredCoordinatorServer for the coreGroup
    AdminConfig.modify(coreGroupId, '[[preferredCoordinatorServers %s]]' %coreGroupPrefServerId)
    
    #Save the changes
    AdminConfig.save()
    

    【讨论】:

      猜你喜欢
      • 2014-12-10
      • 2012-09-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-08
      • 1970-01-01
      相关资源
      最近更新 更多