Friday, September 2, 2016

Setting Up multiple Instance of OpenERP (Odoo) 9 on CentOS 7.x

This is how to blog to setup multiple Instance of Odoo in centos 7.x


What is Odoo -

Odoo, formerly known as OpenERP, is an Open Source Enterprise Resource Planning ERP web based business software written in Python which comes with a suite of web apps designed for every business, such as Website Builders, eCommerce modules, Billing and Accounting, Human Resources, Point of Sale, Customer Relationship Management, Inventory module, Live Chat and many other apps and features.

Requirement -

1- One working Centos box.
2- PostgreSQL
3- Python 2.7

Step 1- Installation of ODOO 9.
To perform fresh installation of Odoo 9 please view my previous article

Setting Up OpenERP (Odoo) 9 with Apache on CentOS 7.x


Step 2- setting up multiple instances of Odoo.

First, we need to check currently installed oddo path including configuration file, service path, and other package add-ons. Use below mentioned command:


[root@localhost ~]# find / -name odoo
/etc/odoo
/var/lib/odoo
/var/lib/odoo/filestore/odoo
/var/log/odoo
[root@localhost ~]#


We found above-mentioned odoo configuration file path add-ons path.

Step 3 - Create a copy of the above directory.

First copy configuration folder using cp command 
[root@localhost ~]# cp -R /etc/odoo/ /etc/odoo1
Second copy odoo data folder using below command;
[root@localhost ~]# cp -R /var/lib/odoo/ /var/lib/odoo1
Third copy filestore folder using below command.
[root@localhost ~]# cp -R /var/lib/odoo1/filestore/odoo /var/lib/odoo1/filestore/odoo1
Fourth copy log folder
[root@localhost ~]# cp -R /var/log/odoo/ /var/log/odoo1
Step 4 - Let's make required changes in copied folder's configuration files.

First change configuration file using vim editor :
[root@localhost ~]# vi /etc/odoo1/openerp-server.conf
 Now make the highlighted changes in this file :
[options]
addons_path = /usr/lib/python2.7/site-packages/openerp/addons
admin_passwd = *****
csv_internal_sep = ,
data_dir = /var/lib/odoo1
db_host = False
db_maxconn = 64
db_name = False
db_password = False
db_port = False
db_template = template1
db_user = odoo
dbfilter = .*
debug_mode = False
demo = {}
email_from = False
geoip_database = /usr/share/GeoIP/GeoLiteCity.dat
import_partial =
limit_memory_hard = 2684354560
limit_memory_soft = 2147483648
limit_request = 8192
limit_time_cpu = 60
limit_time_real = 120
list_db = True
log_db = False
log_db_level = warning
log_handler = :INFO
log_level = info
logfile = None
logrotate = False
longpolling_port = 8072
max_cron_threads = 2
osv_memory_age_limit = 1.0
osv_memory_count_limit = False
pg_path = None
pidfile = None
proxy_mode = False
reportgz = False
server_wide_modules = None
smtp_password = False
smtp_port = 25
smtp_server = localhost
smtp_ssl = False
smtp_user = False
syslog = False
test_commit = False
test_enable = False
test_file = False
test_report_directory = False
translate_modules = ['all']
unaccent = False
without_demo = False
workers = 0
xmlrpc = True
xmlrpc_interface =
xmlrpc_port = 8070
Save and Exit from the file.

Step 5 - Create service for this odoo1 instance.

 First, create a copy of odoo python script using below command.
[root@localhost ~]# cp -R /usr/bin/odoo.py /usr/bin/odoo1.py
Second Create a copy of existing service using below command :
[root@localhost ~]# cp -R /usr/lib/systemd/system/odoo.service /usr/lib/systemd/system/odoo1.service



Now made the required changes into newly created service.
[root@localhost ~]# vi /usr/lib/systemd/system/odoo1.service
[Unit]
Description=Odoo Open Source ERP and CRM
After=network.target

[Service]
Type=simple
User=odoo
Group=odoo
ExecStart=/usr/bin/odoo1.py --config=/etc/odoo1/openerp-server.conf

[Install]
WantedBy=multi-user.target

Save and Exit from the file.

Step 6 - Change the permission on required files and folders:
First Change the permission of Configuration folder using below command:
[root@localhost ~]# chown -R odoo:odoo /etc/odoo1

Second change the permission of /Var/lib/odoo1 folder using below command :
[root@localhost ~]# chown -R odoo:odoo /var/lib/odoo1

 Third change the permission of logs folder :
[root@localhost ~]# chown -R odoo:odoo /var/log/odoo1

Step 7 - Let's Start and enable odoo1 service using below command:
 First start service using below command:
[root@localhost ~]# systemctl start odoo1
Second, enable service to start at the boot time using below command.


[root@localhost ~]# systemctl enable odoo1

Let's check odoo1 service status using below command;
[root@localhost ~]# systemctl status odoo1
● odoo1.service - Odoo Open Source ERP and CRM
   Loaded: loaded (/usr/lib/systemd/system/odoo1.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2016-09-02 17:33:54 IST; 7min ago
 Main PID: 7541 (odoo1.py)
   CGroup: /system.slice/odoo1.service
           └─7541 /usr/bin/python /usr/bin/odoo1.py --config=/etc/odoo1/openerp-server.conf

Sep 02 17:38:37 localhost.localdomain odoo1.py[7541]: 2016-09-02 12:08:37,227 7541 INFO odoo1 openerp.models: Computing parent left and right for table ir_ui_menu...
Sep 02 17:38:37 localhost.localdomain odoo1.py[7541]: 2016-09-02 12:08:37,254 7541 INFO odoo1 openerp.addons.base.ir.ir_translation: module base: loading base translation file...guage en_US
Sep 02 17:38:37 localhost.localdomain odoo1.py[7541]: 2016-09-02 12:08:37,254 7541 INFO odoo1 openerp.tools.translate: loading /usr/lib/python2.7/site-packages/openerp/addons/.../i18n/en.po
Sep 02 17:38:37 localhost.localdomain odoo1.py[7541]: 2016-09-02 12:08:37,262 7541 INFO odoo1 openerp.addons.base.ir.ir_translation: module web_planner: loading translation fi...guage en_US
Sep 02 17:38:37 localhost.localdomain odoo1.py[7541]: 2016-09-02 12:08:37,262 7541 INFO odoo1 openerp.tools.translate: loading /usr/lib/python2.7/site-packages/openerp/addons/...8n/en_US.po
Sep 02 17:38:37 localhost.localdomain odoo1.py[7541]: 2016-09-02 12:08:37,401 7541 INFO odoo1 werkzeug: 10.0.1.13 - - [02/Sep/2016 12:08:37] "POST /web/database/create HTTP/1.1" 303 -
Sep 02 17:38:37 localhost.localdomain odoo1.py[7541]: 2016-09-02 12:08:37,405 7541 INFO odoo1 openerp.addons.base.ir.ir_http: Generating routing map
Sep 02 17:38:37 localhost.localdomain odoo1.py[7541]: 2016-09-02 12:08:37,441 7541 INFO odoo1 werkzeug: 10.0.1.13 - - [02/Sep/2016 12:08:37] "GET /web/ HTTP/1.1" 303 -
Sep 02 17:38:37 localhost.localdomain odoo1.py[7541]: 2016-09-02 12:08:37,480 7541 INFO odoo1 werkzeug: 10.0.1.13 - - [02/Sep/2016 12:08:37] "GET /web/login HTTP/1.1" 200 -
Sep 02 17:38:55 localhost.localdomain odoo1.py[7541]: 2016-09-02 12:08:55,528 7541 INFO odoo1 openerp.addons.base.ir.ir_autovacuum: GC'd 0 user log entries
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]#

Step 8 - Allow port number 8070 from firewall using below command:
[root@localhost ~]# firewall-cmd --zone=public --permanent --add-port=8070/tcp
success

Let's Reload firewall service using below command 
[root@localhost ~]# firewall-cmd --reload
success

Step 9 - Let's access odoo new instance.

Open browser and hit URL - http://server-ip:8070 

- Now select manage database and create one new database for newly created instance:


















- Now select create new database :

















- Now fill the information to create new database as below: and click on continue







































- Now enter the given details to log in :






















After successful login you will get below window:




















Congratulations New Instance has been setup successfully.


That's All
!!!Cheers!!!



2 comments:

  1. where is the part of setting up multiple instances

    ReplyDelete
  2. Really good work there. Informative and helpful. Appreciate it. But might be looking for Odoo eCommerce Development Company in Alabama

    ReplyDelete