【发布时间】:2010-07-16 15:20:33
【问题描述】:
简单地说,在开发环境中将应用程序 (EAR) 部署到作为集群一部分的两台 Weblogic 10 托管服务器的最佳(最快)方法是什么?我已经尝试过自动部署目录,但据我了解,它只部署到管理服务器。
【问题讨论】:
标签: java deployment weblogic
简单地说,在开发环境中将应用程序 (EAR) 部署到作为集群一部分的两台 Weblogic 10 托管服务器的最佳(最快)方法是什么?我已经尝试过自动部署目录,但据我了解,它只部署到管理服务器。
【问题讨论】:
标签: java deployment weblogic
我已经在使用 ant 来构建项目,所以最有效的方法似乎是使用 ANT 部署脚本进行 weblogic。我遇到的唯一问题是要定义 WLDeploy 任务。我最初将所有 jar 包含在 weblogic 服务器库中,但经过一番谷歌搜索后,将其缩小到您看到的两个。我没有检查两者是否真的有必要,但它是这样工作的。稍后我会回去仔细检查。
<target name="deploy">
<path id="wl.deploy.path">
<fileset file="${env.WL_HOME}\server\lib\weblogic.jar" />
<fileset file="${env.WL_HOME}\server\lib\webservices.jar" />
</path>
<taskdef name="wldeploy" classname="weblogic.ant.taskdefs.management.WLDeploy">
<classpath refid="wl.deploy.path" />
</taskdef>
<wldeploy
action="deploy" verbose="false" debug="false"
name="${ear.name}" source="${deploy.dir}/goip.ear"
user="weblogic" password="weblogic"
adminurl="t3://localhost:7001" targets="GO_Cluster1">
</wldeploy>
</target>
我也尝试使用 hotdeploy 目录,但据我了解,该目录仅部署到管理服务器,而不部署到集群,因此不符合我的需求。
【讨论】:
有ant 任务可部署到WebLogic。
This article 有点过时了,但据我所知,这些工具仍然适用于更现代的版本。
您知道有一个“管理器”应用程序(又名 WebLogic 控制台)吗? ant 任务基本上像 Web 服务一样使用它来执行您在 (Web) 控制台中手动执行的操作。
【讨论】:
部署过程可以通过三种方式完成...
1.Stage 2.Nostage 3.ExtenalStage
这是对 WebLogic 中的暂存模式的解释:
舞台模式——
The Administration Server copies the archive files from their source location to a location on each of the targeted Managed Servers that deploy the archive. For example, if you deploy a J2EE Application to three servers in a cluster, the Administration Server copies the application archive files to each of the three servers. Each server then deploys the J2EE Application using its local copy of the archive files.
阶段模式是部署到多个 WebLogic Server 实例时的默认模式。
Nostage 模式——
The Administration Server does not copy the archive files from their source location. Instead, each targeted server must access the archive files from a single source directory for deployment. For example, if you deploy a J2EE Application to three servers in a cluster, each server must be able to access the same application archive files (from a shared or network-mounted directory) to deploy the application.
Nostage 模式是仅部署到管理服务器(例如,在单服务器域中)时的默认模式。如果您在同一台机器上运行服务器实例集群,也可以选择 nostage 模式。
External_stage 模式——
External_stage mode is similar to stage mode, in that the deployment files must reside locally to each targeted server. However, the Administration Server does not automatically copy the deployment files to targeted servers in external_stage mode; instead, you must manually copy the files, or use a third-party application to copy the files for you.
希望对你有帮助。
【讨论】: