指定“路线”的方法和“URIGroups”在WebSphere AS中
环境:WebSphere Network Deployment 版本 v6.1(在 Linux 上)
我们有 2 个应用程序“主” 和 “动态”,每个应用程序都在服务器集群上运行。这些应用程序中的每一个都设置为从其唯一的域名运行。因此,www.main.com/ 由Main 应用程序提供服务,而 www.dynamic.com/ 由Dynamic< /strong> 应用程序。
所需的配置非常简单。所以到目前为止没有问题。
动态应用程序与 Main 相关,展望未来,我们希望能够执行以下操作:
我们希望能够从以下位置为动态应用程序提供服务: www.dynamic.com/ 以及 www.main.com/d/
为了实现这一目标,我们在 plugin-cfg.xml 中指定了以下配置。
<URIGroup Name="MainURIs">
<URI Name="/*" />
</URIGroup>
<URIGroup Name="DynamicURIs">
<URI Name="/*" />
</URIGroup>
<URIGroup Name="Main_DynamicURIs">
<URI Name="/d/*" />
</URIGroup>
2 个服务器集群,即“MainCluster”和“DynamicCluster”已在plugin-cfg.xml 中定义。同样,我们为 www.main.com(虚拟主机名)和 www.dynamic.com 定义了虚拟主机组,分别为“MainVH”和“DynamicVH”强>”分别。我们指定的路由规则如下:
<Route UriGroup="MainURIs" VirtualHostGroup="MainVH" ServerCluster="MainCluster"/>
<Route UriGroup="DynamicURIs" VirtualHostGroup="DynamicVH" ServerCluster="DynamicCluster"/>
<Route UriGroup="Main_DynamicURIs" ServerCluster="DynamicCluster"/>
请注意,我们没有为第三条路由规则指定虚拟主机组。
这似乎很适合我们的目的。但是,我们必须手动对plugin-cfg.xml 进行上述更改。每次重新生成plugin-cfg.xml 文件时,更改都会丢失,我们必须再次进行更改。我们的客户对此不以为然,他们不希望这种情况继续下去。
有没有办法解决这个手动编辑plugin-cfg.xml 文件的问题?
我想到的一些模糊的方式:
1)如何使用WebSphere的管理控制台进行此更改,以便即使重新生成xml文件,它也会自动具有相关的路由规则。
2) 编写一个 wsadmin JACL/Jython 脚本,每次重新生成插件文件后都可以运行该脚本。该脚本应该能够更新配置中的上述路由规则。我对这种方法进行了大量搜索,但没有找到对此方法的令人鼓舞的答复。
任何有用的提示都将受到高度赞赏。
Environment: WebSphere Network Deployment edition v6.1 (on Linux)
We have 2 applications "Main" and "Dynamic" that each run on a server cluster. Each of these applications is set to run from its unique domain name. So www.main.com/ is serviced by the Main application while www.dynamic.com/ is serviced by the Dynamic application.
The configurations required for this have been pretty simple. So no problem so far.
Dynamic application is related to Main and going forward, we want to be able to do the following:
We want to be able to serve the Dynamic application from:
www.dynamic.com/ as well as
www.main.com/d/
In order to achieve this, we have the following configuration specified in plugin-cfg.xml.
<URIGroup Name="MainURIs">
<URI Name="/*" />
</URIGroup>
<URIGroup Name="DynamicURIs">
<URI Name="/*" />
</URIGroup>
<URIGroup Name="Main_DynamicURIs">
<URI Name="/d/*" />
</URIGroup>
2 server clusters namely "MainCluster" and "DynamicCluster" have already been defined in plugin-cfg.xml. Similarly we have virtual host groups defined for www.main.com (virtual host name) and www.dynamic.com as "MainVH" and "DynamicVH" respectively. We have the routing rules specified as follows:
<Route UriGroup="MainURIs" VirtualHostGroup="MainVH" ServerCluster="MainCluster"/>
<Route UriGroup="DynamicURIs" VirtualHostGroup="DynamicVH" ServerCluster="DynamicCluster"/>
<Route UriGroup="Main_DynamicURIs" ServerCluster="DynamicCluster"/>
Please note that we don't specify a virtual host group for the third route rule.
This seems to work fine for our purpose. However, we had to make the above change to plugin-cfg.xml by hand. Every time the plugin-cfg.xml file in regenerated, the changes are lost and we have to make them again. This is frowned upon by our clients and they don't want that to be the case going forward.
Is there a way we can overcome this problem of hand-editing the plugin-cfg.xml file?
Some vague ways I was thinking of:
1) Some how making this change using the admin console of WebSphere so that even if the xml file is regenerated, it would have the relevant routing rules automatically.
2) Writing a wsadmin JACL/Jython script that could be run each time after the plugin file is regenerated. This script should be able to update the above routing rules in the configuration. I have searched quite a lot for this approach but haven't found an encouraging reply to this approach.
Any helpful tips are highly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论