Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

OpenERP in a High Availability cloud environment

By
Agus
on 2/20/13, 6:59 AM 9,757 views

I would like to know if there would be any problem setting up OpenERP in a cloud environment (AWS for example).

I'm thinking about this setup:

  1. One instance for the PostgreSQL DB
  2. Two or more instances behind a Load Balancer, both using the same DataBase.

Does OpenERP store/persist data (images?) on the disk that would not be shared between both instances?

6

Axel Mendoza

--Axel Mendoza--
10238
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 8/8/14, 1:47 PM

I'm right now in the process of setup a high availability enviroment with 2 distributed OpenERP servers and there are some points that you need to consider that are not exposed in the link before and I couldn't find any reference.

When you do a load balance for any service you need to take care of sessions handling in the number of servers that you may have, in the case of OpenERP the session management is done by werkzeug at the low level and OpenERP use the werkzeug.contrib.sessions.FilesystemSessionStore wich write sessions to disk. If all of your OpenERP servers are on the same server machine and they are started with the same user you should not have any trouble but if the OpenERP servers are distributed perhaps you will end having different sessions for the same user in all the OpenERP servers, for example you ask to the loadbalancer for http://yours.server.com/ and that generate request for load js, css, and many more stuffs like dblist, etc. if you have 2 servers you may be creating session in both of them, so when you login in the UI, you are login in one of the servers and in that server the session store the information related to who you are, but again others request will be send to the rest of the servers and in those your session are not authenticated so you will be seen errors like "your session has expired" because you are trying to access a resource that need to have been authenticated agains a db and in that server your session doesn't. to resolve this I create a session store that use Redis as a backend and is configured to be used in all my OpenERP servers to query Redis for session information, that way all the request agains all the servers can access to the same session information.

How you stored session on redis cache?

OpenWorks
on 7/9/15, 6:36 AM

I create a new werkzeug SessionStore based on Redis and use it in OpenERP(version 7) web/http.py. The same apply to Odoo v8 and v9. You can look at my RedisSessionStore at https://gist.github.com/aek/efb0f9dd8935471f9070 The redis config values used to connect to the redis instance are retrieved from OpenERP config. Due to all the servers in my environment are using workers I cannot monkey patch the Root class in web/http.py so im running a modified version of http.py to ensure that all the workers are using the RedisSessionStore class My new Root class only diff from the original in the init part when initializing the session_store like: if tools.config.get('redis_store', False): self.session_store = RedisSessionStore() path = 'Redis' else: path = session_path() self.session_store = werkzeug.contrib.sessions.FilesystemSessionStore(path) My config file for Redis look like this: [options] ... redis_store = True redis_host = localhost redis_port = 6379 redis_dbindex = 1 redis_pass = admin ...

Axel Mendoza
on 7/9/15, 12:34 PM

@Axel,

Thanks for your work on this. I've been searching for ages for a Redis Cache option for Odoo. Do you have any suggestions on how to get it working with Odoo 8, or would I be able to pay for your time to train me how to use it?

I'm interested in using it as a session store as well as for storing cached objects like product images in redis.

Luke Branch
on 8/4/15, 11:13 PM
3

Fabrice Henrion (fhe)

--Fabrice Henrion (fhe)--
5823
| 7 7 8
San Francisco, United States
--Fabrice Henrion (fhe)--

Director Odoo USA

Fabrice Henrion (fhe)
On 2/20/13, 10:05 AM

This setup is possible.
You should have a look at this documentation "High availability OpenERP":
http://www.scribd.com/doc/116781163/High-Availability-Opener-p

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

4 follower(s)

Stats

Asked: 2/20/13, 6:59 AM
Seen: 9757 times
Last updated: 10/17/15, 7:36 AM