Restcomm cluster: nodes list is empty in sip-balancer

161 views Asked by At

i'm trying to create restcomm cluster: sip-balancer + a few restcomm instances. But i can't connect restcomm node and sip-loadbalancer.

i used this tutorial - http://docs.telestax.com/sip-servlets-clustering-high-availability/ however haven't got any result.

Seems it should be 2 steps

  1. change path-name attribute in standalone/configuration/standalone-sip.xml
  2. add org.mobicents.ha.javax.sip.BALANCERS to standalone/configuration/mss-sip-stack.properties

as i understand node and loadbalancer use rmi as channel. i see(i used netstat) that server listens port 2000 and node establishes connection to it.

but when i try to use loadbalancer from sip client it returns "error 500 - no available nodes". also i used remote debugged - nodes list is empty.

have i missed something?

p.s. i used docker restromm instance and sip-loadbalancer on the same machine.

thanks,

1

There are 1 answers

1
hamsterksu On BEST ANSWER

so i have found my issue.

According to the log file on restcomm node - it can't connect to balancer by RMI.

Connection error is very strange - Connection refused to host: 127.0.0.1 and sometimes Connection refused to host: 127.0.1.1

yesterday i tired to specify java.rmi.server.hostname but it did not help me

today i created small RMI client to balancer and it worked from my local machine(balancer is hosted on it too). however this app did work from virtual machine. so i added more logs to code and found:

  1. app can lookup remote been
  2. remote endpoint of this been is 127.0.0.1, but should be ip address of remote machine

After that i specified externalHost and public-ip for my sip-balancer and got bean endpoint address with 127.0.1.1

so issue was found - ubuntu uses this "local" ip address for your "machine name". you can find it in /etc/hosts.

sip-balancer(java application) gets it as ip address of endpoint for services

My fix is - change 127.0.1.1 to 127.0.0.1 in /etc/hosts. after that sip-balancer provides real ip address of your machine for remote objects.

Conclusion: my issue - wrong operation system :)

Common solution: developer should check address type and don't use loopback addresses.