Comments (10)
@sebastian-code and @tvibliani do you guys see any negative points in adding in the dbfilter parameter? Does this code look good too?
from installscript.
Shouldn't the dbfilter
parameter be injected from the nginx proxy?
from installscript.
@sebastian-code to be honest my knowledge about Nginx is so limited that I have barely any idea. What I do understand is that in the Nginx you specify the database, which is in essence some sort of dbfilter too. This will map a specific database to a specific URL.
But I'd like to offer this ability for the default installation script too, for if you wouldn't use the Nginx installation script.
from installscript.
Just a quick note, I think it may be worthwhile to assign a unique path for:
data_dir = (eg. data_dir = /opt/odoo/.local/share/Odoo)
for multi-tenant setups.
My setup was a bit oddball I admit, I had:
PostgreSQL 9.3 = 5422
PostgreSQL 9.5 = 5433
both running using the system user 'odoo', and running database users.
I was testing duplicate databases between the two PostgreSQL versions and made the mistake of leaving the database names identical and letting them share the same data_dir.
Strange things started to happen with images, and when I dumped the 9.5 database it dumped the images for the 9.3 counterpart with the same database name.
Stupid error on my part, however I just thought I would note this here, as it may be worthwhile in multi-tenant, multi-db type setups to make sure this data_dir is a unique value.
from installscript.
Thanks for letting me know. I didn't know that two different PostgreSQL version would interfere with eachother if they had the same user running it. Sounds like a flaw to me..
You're talking about the variable data_dir in the .conf file, right?
from installscript.
Yes, that's the variable i'm referring to.
Steps to reproduce would be:
- Install Odoo using your installation script without any changes
- Install Aeroo Reports using your installation script
- Install PostgreSQL 9.5 (http://raonyguimaraes.com/installing-postgresql-9-5-on-linux/)
- PostgreSQL 9.5 will then be by default running on 5433
- Create a seperate startup script using odoo123-server instead of odoo-server and point this to a different configuration file (eg. /etc/odoo123-server.conf)
- keep data_dir the same default value and modify:
db_port = 5433
xmlrpc_port = 8079
longpolling_port = 8082
ogfile = /var/log/odoo/odoo123-server.log - Create postgreSQL 'odoo' user on 9.5 like follows:
sudo su - postgres -c "createuser -p 5433 -s odoo" 2> /dev/null || true - restart postgreSQL and Odoo (or just reboot the server if you haven't already in step 1 or 2.
- create TEST123 database in the 9.3 instance, add some products, photos, etc. and backup (with zip filestore) and restore to the 9.5 instance.
- play around in the 9.5 instance for a bit and then dump it from /web/database/manager
- go back to 9.3 instance and your photos will likely be blanked out but still in cache which means they'll show up on the kanban, but not on the individual product profile pages in the backend.
I guess if more than one instance of a duplicated database is sharing the data_dir it would make sense that the data would overwrite, but it definitely caught me off guard.
from installscript.
That's why I said before than the script has to control the whole process, creating a different user, but I also has to confess than I haven't give a though about dealing with a situation were even a different user creates a database with the same name. And well, perhaps for testing purposes you will have different PostgreSQL engines, but in production I don't see that happening.
from installscript.
I agree that this situation is incredibly unlikely to occur in a production environment, however if the script is to include multi-tenant type situations it may be worthwhile assigning a sequential or random two to three digit code to additional instances to be used in the odoo-server.conf file name, data_dir, and log file path among other things.
from installscript.
The truth be said, I don't see how. A multi-tenant deployment is (if I understand correctly) one Odoo instance, one DB engine instance, one Odoo system user, and over that, at the DB management page you create multiple databases. If that's the right concept (which I do think so) how are you going to detect and interfere the DB creation with a script made only to install Odoo?
The other possibility is than you're talking about one DB engine (or one alone for every tenant) with different Odoo instances. If that's the case you're referring to, the script already solves that, because what you do is to run the script every single time for each tenant, providing a different system username (odoo, odoo_testing, odoo_production...), that would create a different folder structure, system user, port and process for every single tenant (the only thing left out would be the installation of different PostgreSQL instances, something I think is not wise because you can handle everything with just one well handled engine); in this case, the only thing to configure would be the port routing through Nginx for the different deployments.
Am I correct?
from installscript.
Yes, you may be right. I'll take a look at the script in more detail this afternoon to confirm, however for a standard multi-tenant setup I agree, it's should not be possible to run into the issue i've described.
from installscript.
Related Issues (20)
- Enterprise edition HOT 5
- Hi all, HOT 1
- 404 error HOT 16
- [Not Found] when trying to visit URL only when installing enterprise HOT 2
- 404: syntax error near unexpected token `fi' HOT 3
- error during running installed script HOT 3
- after odoo 15 to 16 database migration error is coming psycopg2.errors.InvalidDatetimeFormat: invalid input syntax for type timestamp: "" HOT 2
- AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK' HOT 2
- the script can't point my domain to the machine in contabo HOT 2
- Having problem when install with python3.10 HOT 1
- [10.0] pip2 and pip requirements missing HOT 1
- I want to add a translation HOT 2
- Some necessary changes to the odoo_install_debian.sh
- 17.0 on Ubuntu 22.04 HOT 6
- Instructions in script don't align with instructions in readme HOT 2
- Installation Error - AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK' HOT 2
- Odoo17 on ubuntu 22.04 error HOT 12
- The SSL script causes (refused to connect) after the installation HOT 1
- Ubuntu 22.04 Odoo17 wkhtml issue HOT 6
- Odoo v16 - Error on apt update after installation on ubuntu 22.04. + Proposed solution
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from installscript.