Sunday, July 22, 2012

OpenERP Server running on two different servers

Here is the scenario:

I want to execute OpenERP server on two different machines, but run with 
single database. So let say

So let say there would be finance and sales module running on one server, when the rest modules would be running on another server but all the data would communicate with each other with single database. How you will configure this ?

Answer:

To start OpenERP server from on different machines such that the data would communicate with each other, then, one need to configure PostgreSQL Server so that both OpenERP server can communicate to the single PostgreSQL database.


However one can try by following PostgreSQL configuration for Ubuntu 10.04 with PostgreSQL 8.4.

Update following file:
/etc/postgresql/8.4/main/postgresql.conf 
with
listen_addresses = '*' 


Update following file:
/etc/postgresql/8.4/main/pg_hba.conf:
with
# IPv4 local connections:
host    all         all         0.0.0.0/0           md5
# IPv6 local connections:
host    all         all         0.0.0.0/0           md5
After making these changes, restart postgres server using following command:
sudo /etc/init.d/postgresql restart

The path might be different for postgresql.conf and pg_hba.conf according to your operating system and PostgreSQL versions.
Some of the reference links for such configuration :
1. http://www.unixsurgeon.com/kb/how-to-access-postgresql-database-server-remotely.html
2. http://kb.mediatemple.net/questions/1237/How+do+I+enable+remote+access+to+my+PostgreSQL+server%3F#dv
3. http://obroll.com/how-to-open-postgresql-remote-access-with-ip-address-limitation-on-ubuntu/

After configuring PostgreSQL server, one can start OpenERP servers from different machines with proper argument like the IP address of the machine on which PostgreSQL server is running, user name of PostgreSQL through which OpenERP server can communicate, password corresponding to that user.

Command:
tiny@tiny-Aspire-4738Z:~/workspace/openerp/61stable/server$ ./openerp-server --addons=<OpenERP modules/addons path> --db_user=<database user> --db_password=<password> --db_host=<IP address of PostgreSQL server machine>

The few of the important arguments are:
addons_path The path of your OpenERP module.
db_host  IP of the machine on which PostgreSQL server is running.
db_user  user name of PostgreSQL through which OpenERP server can communicate.
db_password password corresponding to that user.
Now you can start OpenERP server as like follow:
tiny@tiny-Aspire-4738Z:~/workspace/openerp/61stable/server$ ./openerp-server --addons=../web/addons/,../addons/ --db_user=priyesh --db_password=123456 --db_host=192.168.1.160 

You can provid different addons path as per your need at the time of starting OpenERP server on each machine.
Hope this post will help you, guys, if you will require to configure this kind of configuration.
Regards,
Priyesh

No comments:

Post a Comment