Several local instances at the same time?

Hello Trytonies,

can I run several Tryton instances locally, at the same machine?
I added the entry listen = localhost:8010 to the other trytond.conf, but that does not work. Error message is permission denied for table ir_module, and netstat does not find a process at port 8010.

How can this be done?

Thanks a lot in advace,
Wolf

It seems you are missing the database configuration or your user is not allowed to read the database.

Note that you can use multiple files to specify the configuration, so in the first one you define the common parameters of all servers and on the second the specific for this port.

It seems I haven’t been clear enough, sorry for this.

At my machine, there is

  • 1st Tryton instance, running at localhost port 8000, with werkzeug and the GTK client
  • a 2nd Tryton instance should be accessible at the same time with another client.

Each instance runs nicely, when started alone. But the 1st gets in trouble when the 2nd is launched. My guess is that I need to change the 2nd to another port.

True? - And how can I do that?

Cheers,
Wolf

True, you need to have two separate config files and use a differnt port on each tryton instance.

When opening the client you will need to select the right port to connect to one server or to the other.

In my multi-tenant solution, I replicate everything for every service:

  • the Linux user to protect users from each others
  • the postgres user to prevent access of of others’ databases
  • the file store for documents and attachments
  • the python environment so they can be different
  • the trytond code and sao code so they can be modified separatly
  • the config file
  • the log config and log file
  • the database backups
  • and other information used by my hosting system itself.

If you don’t need any separation for security and can share code and databases, I’d say just separating config files should “work”, as Polkoli said.

I tried as good as I can - but could not manage it. If somebody still is patient with me, would you please let me know, for each of the two instances:

  • what has to go into each of trytond.conf
  • what inputs does each of GTK clients require ?

Thank you,
Wolf

Here is an example from my demo/test service

  1 #created by /usr/local/bin/xoe on 2024-08-18-13-57-03 for Trytond server /home/sisalpuser/xoe.services/tryton70-sslp-173/server/bin/trytond version 7.0
  2 #documentation : http://doc.tryton.org/projects/server/en/7.0/topics/configuration.html
  3 [web]
  4 listen = 10.0.0.173:60006
  5 root = /home/sisalpuser/xoe.services/tryton70-sslp-173/sao
  6 num_proxies = 1
  7 [database]
  8 uri = postgresql://pg-tryton70-sslp-173@/
  9 path = /home/sisalpuser/xoe.services/tryton70-sslp-173/filestore
 10 list = True
 11 retry = 20
 12 [session]
 13 timeout = 2400
 14 [uwsgi]
 15 http-socket = 10.0.0.173:60006
 16 master = true
 17 wsgi = trytond.application:app
 18 processes = 1
 19 threads = 4
 20 check-static = /home/sisalpuser/xoe.services/tryton70-sslp-173/sao
 21 virtualenv = /home/sisalpuser/xoe.services/tryton70-sslp-173/server
 22 [email]
 23 uri = smtp://localhost:25
 24 from = service.client@sisalp.fr
 25 #modified by /usr/local/bin/xoe on 2024-08-18-13-57-03 for Tryton server version 7.0

Every service is accessed through a proxy server and has a dedicated URL (or several) with its certificates. ssl is declared on both 443 and 8000 ports so gtk client hasn’t to care.
Connecting to that URL, the traffic is routed to 10.0.0.173:60006 on the local area network (simulated)

Hope this helps.

With friendly help by Frederik I finally could resolve the issue, and it’s as easy as I expected:

In my trytond.conf, I had the line
listen = localhost:8010
but it was not under the [web] statement.

So here is the solution for simple-minded people like me. To operate two local Tryton instances on one machine, with two GTK clients at a time, you need to

create an entry in trytond.conf, looking like this:

[database]
all entries needed here
...
...

[web]
listen = localhost:your-port-number

at GTK client, at the “host” box type in:
localhost:your-port-number

your-port-number must be <> the default value 8000.
All of this is very obvious to you nerds. It is not to us users.

Thanks for all your effort,
Wolf

Good if it fits your need.
Nevertheless, if you share the database between services, I don’t really get the point to use several services.

I don’t. Each instance has its own database.

So I think you have a
[database]
section too in every conf file to prevent cross access. That’s fine.

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.