使用 wsadmin 脚本修改 WebSphere 7 中的默认 WorkManager
我想使用 wsadmin (Jython) 脚本提高默认工作管理器线程池中的最大线程数。最好的方法是什么?
我似乎找不到可以让我修改此属性的细粒度控件的文档。我能找到的最接近我想要的是 AdminTask.applyConfigProperties,需要传递一个文件。文档解释说,如果要修改现有属性,则必须提取现有属性文件,在编辑器中对其进行编辑,然后将编辑后的文件传递给 applyConfigProperties。
我想避免提取现有属性文件并编辑它的手动步骤。这些脚本需要完全无人值守地运行。事实上,我宁愿根本不使用文件,而是直接在脚本中将属性设置为值。
类似下面的伪代码:
defaultwmId = AdminConfig.getid("wm/default")
AdminTask.setProperty(defaultwmId, ['-propertyName', maxThreads, '-propertyValue', 20])
I want to raise the maximum number of threads in the default work manager's thread pool using a wsadmin (Jython) script. What is the best approach?
I can't seem to find documentation of a fine-grained control that would let me modify just this property. The closest I can find to what I want is AdminTask.applyConfigProperties, which requires passing a file. The documentation explains that if you want to modify an existing property, you must extract the existing properties file, edit it in an editor, and then pass the edited file to applyConfigProperties.
I want to avoid the manual step of extracting the existing properties file and editing it. The scripts needs to run completely unattended. In fact, I'd prefer to not use a file at all, but just set the property to a value directly in the script.
Something like the following pseudo-code:
defaultwmId = AdminConfig.getid("wm/default")
AdminTask.setProperty(defaultwmId, ['-propertyName', maxThreads, '-propertyValue', 20])
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以下表示更新默认工作管理器上的最大线程数的相当简单的
wsadmin
方法:请注意,第一行将检索所有范围中的所有默认工作管理器,因此,如果您只想选择其中之一(例如,如果您只选择一个来修改特定应用程序服务器或集群的工作管理器属性),则需要进一步细化遏制路径。此外,您可能需要同步节点并重新启动修改后的服务器,以便在运行时应用该属性。
有关使用
AdminConfig
脚本对象的更多信息可以在 WAS 信息中心找到:http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/rxml_adminconfig1.html
The following represents a fairly simplistic
wsadmin
approach to updating the max threads on the default work managers:Note that the first line will retrieve all of the default work managers across all scopes, so if you want to only choose one (for example, if you only one to modify a particular application server or cluster's work manager properties), you will need to refine the containment path further. Also, you may need to synchronize the nodes and restart the modified servers in order for the property to be applied at runtime.
More information on the use of the
AdminConfig
scripting object can be found in the WAS InfoCenter:http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/rxml_adminconfig1.html