Ordinary hut

人间一福地,胜似天仙宫
posts - 61, comments - 50, trackbacks - 0, articles - 1

weblogic中的staging mode

Posted on 2009-12-29 22:39 landor 阅读(3730) 评论(0)  编辑  收藏 所属分类: weblogic
英文文档如下:
http://download.oracle.com/docs/cd/E12840_01/wls/docs103/deployment/deploy.html#wp1029629

设置staging mode的文档如下
http://download.oracle.com/docs/cd/E12840_01/wls/docs103/ConsoleHelp/taskhelp/deployment/SetAServerStagingMode.html

下面是部分翻译,鉴于英文水平,这翻译的实在太差,只能自己对付着看

Nostage:管理服务器(Administration Server)并不拷贝所发布文件,相反,每一个目标服务器必须通过一个单一源文件夹来访问这个文件并进行发布。目标服务器(target servers)上的stage目录在nostage模式下会被忽略。

例如,如果你发布了一个Java EE应用程序到集群中的三个服务器,那么每一个服务器必须能够访问相同的应用程序文件(从一个共享的网络目录)去发布程序

备注:发布文件的来源在nostage模式下是一个路径,这个路径是在发布的时候有用户提供(与stage模式相反,stage模式的来源是每一个服务器的stage目录)。尽管如此,甚至在nostage模式中,weblogic服务器拷贝出部分deployment到临时目录。这能使用户去更新整个发布文件或者部分发布文件。

nostage模式中,web容器自动的检测jsp或者servlet的改变。Nostage also allows you to later update only parts of an application by updating those parts in one file system location and then redeploying.

当仅仅发布到管理服务器的时候,管理控制台使用nostage模式作为默认值。Weblogic.Deployer使用目标服务器的staging模式(就是看目标服务器是哪种模式),管理服务器上默认使用nostage模式。如果你在一个主机上运行一个集群,或者你通过一个共享目录发布一个非常大的应用到多个主机,那么也可以选择nostage模式。用nostage模式来发布大应用会节省发布时间,因为不需要复制文件。

 

Stage:管理服务器把所发布的文件从原始的位置(在管理服务器上)拷贝到目标服务器的staging目录上。例如,如果你采用stage模式发布一个Java EE应用到集群的三个服务器上,这个管理服务器会在集群中的每一个服务器上都拷贝一份。每一个服务器使用拷贝过来的本地的文件来发布Java EE应用。

 这里有个需要住的地方(个人记录):在weblogic10+中,如果清除了集群中一个服务器的缓存,比如这个服务器叫appserver1,或者删除了stage目录下的文件,那么程序不会自动从管理服务器上自动把程序同步到appserver1的stage目录,只有重新向管理服务器发布程序(是管理服务器,如果重新向appserver1发布程序,程序也不会被复制到stage目录),这样程序才会被拷贝到appserver1的stage目录;再有一种情况,如果我在源目录更改了jsp内容,那么appserver1也不会同步这个jsp文件,必须人工的去appserver1的stage目录去替换该jsp文件,才能做到及时更新。这也是采用nostage的一个好处,修改之后会立刻看到效果。

如果不指定staging 目录,那么默认的目录是stage

·  For exploded archive deployments, the deployment name and staging subdirectory are the name of the directory you deployed (physicianEar in the example above).

·  For archived deployments, the default deployment name is the name of the archive file without the extension. For example, if you deploy physicianEar.ear, the deployment name and staging subdirectory are physicianEar.

 

当发布到多个weblogic实例的时候,管理控制台使用stage模式作为默认模式。Weblogic.Deployer使用target服务器的staging mode作为默认,并且托管的服务器使用stage模式作为默认。

Stage模式保证每一个服务器有一个发布的本地拷贝,这样由于一个网络中断会使管理服务器连接不上其他服务器也没关系(因为它用的是本地发布)。如果你正要发布一个大的应用到集群中的多个服务器,那会是非常耗费时间的。可以考虑nostage模式去避免往多个服务器拷贝大文件的多余举动

 

External_stagestage相似,目标服务器使用本地的拷贝来发布应用。然而,管理服务器并不自动的拷贝所发布的文件到目标服务器;相反,在发布之前,你必须拷贝这些文件到每一个目标服务器的staging目录。你可以手工的执行拷贝或者用自动化脚本。

Within each target server’s staging directory, deployment files must be stored in a subdirectory that reflects the deployment name. This can either be the name you type in for the deployment, or the default deployment name (the name of the exploded archive directory, or the name of the archive file without its file extension).

External_stage mode is the least common deployment staging mode. It is generally used only in environments that are managed by third-party tools that automate the required copying of files. You may also choose to use external_stage mode when you are deploying very large applications to multiple machines and you do not have a shared file system (and cannot use nostage mode). Using external_stage in this scenario decreases the deployment time because files are not copied during deployment.




只有注册用户登录后才能发表评论。


网站导航: