Zmq conflicting ports with Zato 3


#1

Hi,

I am running several Zato instances on the same server. That worked OK with zato 2.0.x (needs manual configuration or ports). However, with Zato 3, I am getting ports conflicts for ZeroMQ.

Traceback (most recent call last):
  File "/opt/APPS/batches/tst/zato-batches/3.0/code/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
    self.cfg.post_fork(self, worker)
  File "/opt/APPS/batches/tst/zato-batches/3.0/code/zato-server/src/zato/server/base/parallel/__init__.py", line 781, in post_fork
    ParallelServer.start_server(worker.app.zato_wsgi_app, arbiter.zato_deployment_key)
  File "/opt/APPS/batches/tst/zato-batches/3.0/code/zato-server/src/zato/server/base/parallel/__init__.py", line 491, in start_server
    spawn_greenlet(self.ipc_forwarder.run)
  File "/opt/APPS/batches/tst/zato-batches/3.0/code/lib/python2.7/site-packages/gevent/greenlet.py", line 534, in run
    result = self._run(*self.args, **self.kwargs)
  File "/opt/APPS/batches/tst/zato-batches/3.0/code/zato-common/src/zato/common/ipc/api.py", line 62, in run
    spawn_greenlet(Forwarder, self.name, self.pid)
  File "/opt/APPS/batches/tst/zato-batches/3.0/code/lib/python2.7/site-packages/gevent/greenlet.py", line 534, in run
    result = self._run(*self.args, **self.kwargs)
  File "/opt/APPS/batches/tst/zato-batches/3.0/code/zato-common/src/zato/common/ipc/forwarder.py", line 28, in __init__
    super(Forwarder, self).__init__(base_address, pid)
  File "/opt/APPS/batches/tst/zato-batches/3.0/code/zato-common/src/zato/common/ipc/__init__.py", line 62, in __init__
    spawn_greenlet(self.set_up_sockets)
  File "/opt/APPS/batches/tst/zato-batches/3.0/code/lib/python2.7/site-packages/gevent/greenlet.py", line 534, in run
    result = self._run(*self.args, **self.kwargs)
  File "/opt/APPS/batches/tst/zato-batches/3.0/code/zato-common/src/zato/common/ipc/forwarder.py", line 36, in set_up_sockets
    self.socket_for_publishers.bind(self.socket_for_publishers_address)
  File "zmq/backend/cython/socket.pyx", line 547, in zmq.backend.cython.socket.Socket.bind
  File "zmq/backend/cython/checkrc.pxd", line 25, in zmq.backend.cython.checkrc._check_rc
    raise ZMQError(errno)
ZMQError: Address already in use

However, in the config files I cannot find entries to configure ZMQ ports.

Regards, Jan


#2

I tried to switch off zmq useage in server config with:

[component_enabled]
 ...
zeromq=False

But these Address conflicts do not go away.


#3

I see these files in /tmp:

zato-ipc-server1-pub
zato-ipc-server1-sub
zato-ipc-server2-pub
zato-ipc-server2-sub

It seems the two zato instance are writing to the same location.


#4

Yes, the addresses are not TCP ones but IPC pipes used for communication between servers.

Alright, so the situation is that you have more than one cluster and servers have the same name within each cluster?


#5

The problem is in zato-common/src/zato/common/ipc/forwarder.py:

from tempfile import gettempdir

is being used, always resulting in /tmp


#6

Yes, correct.
So I can solve it by using different names for the servers?


#7

OK, I changed it to include cluster name, which must be always unique, in the name of the IPC socket, you can pull the updates:

https://zato.io/docs/3.0/admin/guide/install/update.html


#8

@dsuch Well, that was fast :slight_smile:

Tx. for the quick solution!

Jan