将脚本文件安装到Websphere中所有节点的脚本接口? [英] Script interface to install an arbitrary files to all nodes in Websphere?

查看:119
本文介绍了将脚本文件安装到Websphere中所有节点的脚本接口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对wsadmin和可用于Websphere的管理客户端不熟悉.我想知道是否有人有向单元中的每个节点部署任意文件的示例?理想情况下,我正在寻找一种既可以与Websphere ND v7也可以与v6.1一起使用的解决方案,并且不求助于本机文件传输方法(例如Windows share/sftp),即使存在可以通过Deployment Manager发现的配置也可以.关于可以采用哪种本机方法来部署文件.

I'm rather new to wsadmin and the administration client available for Websphere. I was wondering if anyone had an example of deploying arbitrary files to every Node in a Cell? Ideally I am looking for a solution that would work with both Websphere ND v7 and v6.1, and would not resort to native file transfer methods (e.g. windows shares / sftp), although if there is configuration that could be discovered through the Deployment Manager as to what native method to take to deploy the file that could be an option.

出于某些背景,我正在尝试为客户编写脚本安装应用程序.作为其中的一部分,我将需要与我的应用程序一起创建一个JDBC提供程序和一个共享库.关于如何创建

For some background, I'm trying to script the installation of an application for our clients. As part of that I will need to create a JDBC provider and a shared library along with my Application. IBM's documentation is fairly clear on how to create shared library with a particular classpath, and a JDBC Provider, and Websphere variables. But I am running into the problem of how I should go about ensuring that the resources defined on the classpaths of the configured provider and shared library are available on each Node at runtime?

推荐答案

可以使用wsadmin

Arbitrary files can be managed centrally using wsadmin's AdminConfig object. This approach places the files in WAS's configuration repository which is monitored by the node synchronization service, and therefore automatically synchronizes file changes from the master repository with each node repository. There are existing wsadmin commands that enable the files to be added, updated, and deleted centrally and remotely.

这是一些wsadmin jython代码示例,这些代码会将本地文件(/temp/jdbc-driver.jar)上传到配置库(<WAS_PROFILE_ROOT>/config/test-app/jdbc-driver.jar).如脚本中所示,可以显式调用节点同步,或者如果启用了自动同步,则同步将自动发生.

Here is some example wsadmin jython code which will upload a local file (/temp/jdbc-driver.jar) to the configuration repository (<WAS_PROFILE_ROOT>/config/test-app/jdbc-driver.jar). The node synchronization may be explicitly invoked as demonstrated in the script, or the synchronization will occur automatically if automatic synchronization is enabled.

file = "/temp/jdbc-driver.jar"
dest = "test-app/jdbc-driver.jar"
AdminConfig.createDocument(dest, file)
AdminNodeManagement.syncActiveNodes()

下面的wsadmin jython代码演示了如何更新文件.

The following wsadmin jython code demonstrates how to update the file.

file = "/temp/jdbc-driver.jar"
dest = "test-app/jdbc-driver.jar"
digest = AdminConfig.extract(dest, file)
# update the file locally in /temp/jdbc-driver.jar
AdminConfig.checkin(dest, file, digest)
AdminNodeManagement.syncActiveNodes()

这篇关于将脚本文件安装到Websphere中所有节点的脚本接口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆