将任意文件安装到Websphere中所有节点的脚本接口?

发布于 2024-11-19 10:12:13 字数 675 浏览 4 评论 0原文

我对 wsadmin 和可用于 Websphere 的管理客户端相当陌生。我想知道是否有人有将任意文件部署到单元中每个节点的示例?理想情况下,我正在寻找一种可以与Websphere ND v7和v6.1一起使用的解决方案,并且不会诉诸本机文件传输方法(例如Windows共享/ sftp),尽管如果存在可以通过部署管理器发现的配置至于采取什么本机方法来部署该文件可能是一个选项。

对于一些背景,我正在尝试为我们的客户编写应用程序安装脚本。作为其中的一部分,我需要创建一个 JDBC 提供程序和一个共享库以及我的应用程序。 IBM 的文档对于如何创建 具有特定类路径的共享库,以及 JDBC Provider 和 Websphere 变量。但我遇到了一个问题:我应该如何确保配置的提供程序和共享库的类路径上定义的资源在运行时在每个节点上可用?

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.

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

再可℃爱ぅ一点好了 2024-11-26 10:12:13

可以使用 wsadminAdminConfig 对象。这种方法将文件放置在WAS的配置存储库中,该配置存储库由节点同步服务监控,因此自动将主存储库中的文件更改与每个节点存储库同步。现有的 wsadmin 命令允许集中远程添加、更新和删除文件。

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

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

以下 wsadmin jython 代码演示了如何更新该文件。

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()

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.

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()

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()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文