简体   繁体   English

部署WSO2 ESB策略的最佳实践

[英]Best practice to deploy wso2 esb policies

I have setup an ESB cluster using jdbc connections to ms sql databases for local and remotely mounted config and gov registries. 我已经使用与本地数据库和远程安装的config和gov注册表的ms sql数据库的jdbc连接设置了ESB群集。 1x mgt and 2xworker 1x mgt和2xworker

Our .car file contains some ws-security policy artifacts which go to config. 我们的.car文件包含一些ws-security策略构件,这些构件可以进行配置。 When I deploy to mgt it deploys OK. 当我部署到mgt时,它可以部署。 I have SVN dep sync setup to the cluster and when it picks up the .car it starts to deploy on the worker but fails when loading the policy files into conf. 我将SVN dep同步设置安装到集群,当它选择.car时,它开始部署在worker上,但是在将策略文件加载到conf时失败。 It is trying to duplicate the policy in the shared conf and fails - of course that is right but; 它试图在共享的conf中复制该策略,但失败了-当然可以,但是; how should I deploy these 'shared' artifacts when a .car file is distributed by svn? 当svn分发.car文件时,应如何部署这些“共享”工件? I need to be able to control the deploy properly. 我需要能够正确控制部署。 The only way I can see is via the dev studio which is terrible for our change management practice. 我能看到的唯一方法是通过开发工作室,这对于我们的变更管理实践非常糟糕。

Thanks for you help. 感谢您的帮助。

I can recommend multiple solutions. 我可以推荐多种解决方案。 You can decide what to choose from them. 您可以决定从中选择什么。

  1. Since you have only 2 worker nodes, you can get rid of (disable) deployment synchronization and deploy the car files to all the nodes. 由于只有2个工作节点,因此可以摆脱(禁用)部署同步,并将car文件部署到所有节点。 I believe you have some automated process, so it wont be a problem to deploy to all nodes. 我相信您有一些自动化的流程,因此部署到所有节点都不会有问题。 While doing so, modify your project to bundle the policies to a separate car file and the services to another. 这样做时,请修改项目以将策略捆绑到单独的汽车文件中,并将服务捆绑到另一个汽车文件中。 When deploying, you deploy the policies only to management node and the services to all nodes. 部署时,仅将策略部署到管理节点,将服务部署到所有节点。

  2. Second option is to, add the policies to local registry. 第二种选择是将策略添加到本地注册表。 ie Not the config registry, not the governance registry. 即不是配置注册表,不是治理注册表。 Then, when you deploy the car to the management node, it will add the policies to local registry of the management node. 然后,将汽车部署到管理节点时,它将把策略添加到管理节点的本地注册表中。 When the car file is dep-synced, worker nodes will deploy them and they will add the policies to their local registry. 汽车文件进行Dep同步后,辅助节点将对其进行部署,并将其添加到其本地注册表中。 This will avoid the worker nodes trying to add the policies to the same location. 这样可以避免工作节点尝试将策略添加到同一位置。

By going through the question, I felt you have external databases to the local registry too. 通过回答这个问题,我觉得您也有本地注册表的外部数据库。 But, its not necessary. 但是,这不是必需的。 You can use the internal H2 database for the local registry. 您可以将内部H2数据库用于本地注册表。 H2 databases sometimes get corrupted. H2数据库有时会损坏。 If such a thing happens, all you have to do is, delete the H2 database and restart the server with -Dsetup option. 如果发生这种情况,您要做的就是删除H2数据库并使用-Dsetup选项重新启动服务器。 Having an external DB is fine. 拥有一个外部数据库很好。 But, thats an overkill. 但是,那太过分了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM