To setup multiple instances of OpenMRS, follow this general procedure:
- Checkout the latest source code from Subversion
- Create separate instances of your database (i.e. openmrs1, openmrs2)
- Create separate instances of your OpenMRS runtime file (i.e openmrs1-runtime.properties)
- Build an instance of the WAR file
- Rename openmrs.war to openmrs1.war
- Copy the openmrs1.war to openmrs2.war
- Modify runtime properties to point to correct database
- Copy openmrs1.war, openmrs2.war to Tomcat webapps
- Start tomcat
[runtime] Make sure Database connection URL is pointing to the right database.
connection.url=jdbc:mysql://localhost:3306/openmrs?autoReconnect=true
[global] Make sure that the form entry global properties are distinct.
formentry.infopath_server_url=http://localhost:8080/openmrs1
formentry.queue_dir=formentry/openmrs1/queue
formentry.queue_archive_dir=formentry/openmrs1/archive/%Y/%M
In Malawi we had an issue that caused the creation of duplicate encounters for each form entry. We realized that it was due to the fact that we had multiple instances of OpenMRS running. In our scenario, the form entry queue processor was scheduled on both instances and was looking at the same queue directory. Therefore, both tasks got to the queue at the same time and processed the incoming form entry submissions. We happened to be using the same database instance for each (one was a read-only OpenMRS instance).