Two Zato instances on one server

Hi,

I am trying to setup two separate Zato instances on one server. Is this intended useage, or should every Zato instance always get its own isolated VM?

I found one issue about this, that seems to indicate that it is possible:

I am using two separete os users for this (maybe that is different from the setup in the issue mentioned above).

What I did:

  • install zato from debian package
  • create one instance with user1, use default settings
  • create separate postgresql database + user
  • create separate Redis instance
  • create second Zato instance with user2 using the second redis + second postgresql db + user
  • change ports to unique numbers for: loadbalancer, webadmin, server1 + server2 gunicorn

When I try to see the list of channels in the webadmin I get this exception:

Traceback:
File “/opt/zato/2.0.7/code/eggs/Django-1.3.7-py2.7.egg/django/core/handlers/base.py” in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File “/opt/zato/2.0.7/code/eggs/Django-1.3.7-py2.7.egg/django/contrib/auth/decorators.py” in _wrapped_view
23. return view_func(request, *args, **kwargs)
File “/opt/zato/2.0.7/code/zato-web-admin/src/zato/admin/web/views/init.py” in inner_view
102. return view(*args, **kwargs)
File “/opt/zato/2.0.7/code/zato-web-admin/src/zato/admin/web/views/http_soap.py” in index
122. for def_item in req.zato.client.invoke(‘zato.security.get-list’, {‘cluster_id’: req.zato.cluster.id}):
File “/opt/zato/2.0.7/code/zato-web-admin/src/zato/admin/middleware.py” in invoke
72. raise Exception(‘CID: {}\nDetails: {}’.format(zato_env.get(‘cid’), zato_env.get(‘details’)))

CID: K04H0XVF6NPDDHJNFZ687FYSSPT3
Details: UNAUTHORIZED path_info:[/zato/admin/invoke], cid:[K04H0XVF6NPDDHJNFZ687FYSSPT3], sec-wall code:[0004.0003], description:[]

These same exceptions also start to appear in the first zato instance. So, there is some kind of interference between the two instances.

Regards, Jan

Did you change the ports of on of the clusters? If I remember correctly, zato quickstart create assigns the same ports for load balancer and both servers it creates, so when you start both clusters - they try to bind to the same ports and some of them fail to bind. You’ll have to change the ports on one of the clusters to make it work correctly.

P. S.
I am not an experienced Zato user. This is just an idea I have about this issue. Correct me if I am wrong.

Hi dmytro,

I isolated all the ports (loadbalancer, web-admin, server1, server2) and use a separate Redis instance.
Each instance has its own PostgreSQL databases.

But still, the two instances are interfering.

Regards, Jan

Ok, for the record, I found out what was wrong. Port numbers are not only configured on the filesystem, but also in the odb database. Using zato quickstart the redis port can be configured, but the rest of the ports need to be changed in the *.conf files on the filesystem AND in de odb database.

Regards, Jan