Error listening on router port: 5222

Hi,

I tried to install cells on another machine. Since ejabberd uses port 5222 on it, unable to install cells. When executing ./cells install, it reported an error.

2019-01-26T01:26:36.847+0900	FATAL	Error listening on router port: 5222 - listen tcp 0.0.0.0:5222: bind: address already in use

How can I fix this issue?

Hi,
let me ask the devs if it’s possible to work around that.

In this time, I changed ejabberd port settings, however, I’d like cells to come to be able to change its bind addresses/ports if possible.

ok,
but this 5222 port was it the port that you used for your bind, external?

Yes, port 5222 is generally used by XMPP protocol

Hi,
sorry for the late answer so this port is used by default by nats,
you could change it but only after you have installed cells, so you atleast need to change your XMPP port during Cells installation.

if you use ./cells --help you can see below,
all the flags and the ports that you can change.

Oh, thanks. I missed it.

According to “cells --help” it should be possible to change this port with the global flag “registry_cluster_address”. But how can I set it? I have tried several command variants but none of them worked. Maybe you can post the correct syntax here.

Hi @MHerbst,

If you wish to change the Nats port you must use this command:

  • ./cells start --registry_address :1212

What it does is, it will start your Cells and set the nats port to the one defined (in this case 1212).

The registry_cluster_address is used when you wish to have multiple nats communicating with each other.

Otherwise for your case you can use:

  • ./cells start --registry_cluster_address :1212

Thanks. That was the solution.