Odoo 12 Development Essentials
上QQ阅读APP看书,第一时间看更新

Changing the listening port

The --http-port=<port> command option (or just -p <port>) allows us to change the listening port of a server instance from the default 8069. This can be used to run more than one instance at the same time, on the same machine.

Changed in Odoo 11
The --http-port server option was introduced in Odoo 11 and replaces the old --xmlrpc-port option, used in previous versions.

Let's try this out. Open two terminal windows. On the first, run this:

$ ~/odoo-dev/odoo/odoo-bin --http-port=8070

Run the following command on the second terminal:

$ ~/odoo-dev/odoo/odoo-bin --http-port=8071

There you go, two Odoo instances on the same server listening on different ports! The two instances can use the same or different databases, depending on the configuration parameters used, and the two could be running the same or different versions of Odoo.

Different Odoo versions must work with different databases. Trying to use the same database with different Odoo versions won't work, since major versions have incompatible database schemas.