Hi Robert, one way to achieve your goal is to have multiple x_repository.xml files where x could be a specific name or identifier of different storage locations. Then in $drools-guvnor.war/WEB-INF/components.xml file contains the mapping to which one to point to, e.g:
<!-- JackRabbit --> <property name="properties"> <key>org.drools.repository.configurator</key><value>org.drools.repository.jackrabbit.JackrabbitRepositoryConfigurator</value> <!-- the root directory for the repo storage the directory must exist. --> <key>repository.root.directory</key><value>/directory/location/where/your/repositoryconfigfile/is/</value> </property> you would need to change the value of repository.root.directory to switch to a different storage configuration. For this approach you would need to deploy the drools-guvnor war as an exploded war, and I also believe you would need a restart of your guvnor instance (which I think you would need in any possible scenario anyways). If you use the approach you mentioned, I'm pretty sure a Guvnor restart is also needed, as the configuration afaik is read in only once. You could test that out. Another approach I could think of is where you could have multiple Guvnor instances point to different database instances, for example have a "master guvnor" point to your master db and also have "slave guvnor" instances already configured and running configured to point to your slave db instances. In case of a failure on master db, you would just make sure that all load moves to one of the "slave guvnor" instances via a load balancer or something similar. This would cause your users to have to possibly have to relog into guvnor but could mean you not to have to start and stop Guvnor instances .. so no down time...just an idea. There are couple of ant tasks that come in drools-ant module that could be of interest to you: http://blog.athico.com/2011/03/using-drools-ant-to-migrateback-up.html http://blog.athico.com/2011/01/configuring-multiple-guvnor-instances.html but not sure if they would help in your particular case..just throwing it out there. Hope this helps. Thanks. On 8/13/11 5:37 AM, Robert Morse wrote: > Our Seam 2.2.x application uses Drools 5.2 and Guvnor 5.2 running under JBoss > 5.1.0.GA. We use an external MySql database set up in a master slave > configuration. The repository.xml file points to the master MySql database > (obviously). > Here's my question: Let's assume the database master fails, and we promote > the slave so it's now the master. The repository.xml file would now need to > point to the slave's database instance. Does anything in the Guvnor created > repository directory need to be modified? Is it safe to switch simply by > changing the values in repository.xml? > > Thanks. > > -robert. > > > > > The human mind is an iterative processor, it never does anything right the > first time. What it does well is to make improvements on every iteration > (deMarco) > > > > > _______________________________________________ > rules-users mailing list > [email protected] > https://lists.jboss.org/mailman/listinfo/rules-users > _______________________________________________ rules-users mailing list [email protected] https://lists.jboss.org/mailman/listinfo/rules-users
