Multiple instances of iDempiere
From iDempiere en
Running multiple instances of iDempiere on a single server is not too difficult. Here is a checklist of things to take care of:
- Install the instances into different directories. The instances do not need to share any common files. So you are just fine making a full installation for each instance.
- Make sure the iDempiere server instances use different TCP ports.
- If you really should need to use a single port to access all of the instances you could use an HTTP server like Apache or Ngnix to define virtual hosts. Proxying or use of rewrite rules will then allow you to manage the desired redirections. I recommend using subdomains to do the job.
- With an HTTP server in front of iDempiere, you will also be able to offload the ssh encryption (HTTPS) onto the HTTP server.
- There is another benefit to using subdomains for browser access: If all your server instances use the same hostname the client browser will sometimes not be able to keep cookies from different instances apart. This can lead to a blocked session as discussed here in the iDempiere google group.
- Make sure each instance uses its own database. Use different names for the instance databases.
- Use different DB user names. The docs advise not to change the default user name Adempiere and this is ok for a single instance installation. However, if you use a single DB user for all of your instances you will run into trouble once you need to restore a database from a backup file. The RUN_DBRestore.sh will attempt to delete and recreate the DB user which will throw an error when the user owns more than one DB.
- Multiple database Clusters under Postgresql: If a Postgresql database server is used it might make sense to use a dedicated database cluster for each iDempiere instance to avoid any side effects of having multiple iDempiere databases side by side. Firewalling the iDempiere instances through database clusters allows to use the recommended configuration for database and database user names in each cluster (You can ignore points 6. and 7. then). Note that using dedicated database clusters requires some additional steps in database server setup. Also server hardware requirements might be a bit higher because of the added overhead.
- You can run all of your instances as services in parallel. Before the installation of another instance rename the service script:
sudo mv /etc/init.d/iDempiere /etc/init.d/iDempiere-theInstance.
Of course, you will need to do some book keeping work with the service controller of your OS to ensure that the renamed services are started as desired. - The service controller talks to the iDempiere server via the OSGI console. For this to work without problems in a multi-instance environment you need to assign a different telnet port number to each of the instances: in the editor of your choice open the file
/etc/init.d/iDempiere
. Find the lineexport TELNET_PORT=12612
and change the port number to something else.
Please Note:
- OS specific descriptions in this guide are for Ubuntu 16/18/20 or Debian, if on another OS you might need to do some further research.
- I have been using the described approach to host iDempiere since version 5 for some time now and did not have any problems so far. Still make sure you do your own thorough tests if you want to go that route.
- If you run into any problems (and maybe even manage to solve them) please report back to the community. (You can edit this page or post to the iDempiere Google group) Thanks!