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
- change
path-name
attribute instandalone/configuration/standalone-sip.xml
- add
org.mobicents.ha.javax.sip.BALANCERS
tostandalone/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,
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 sometimesConnection refused to host: 127.0.1.1
yesterday i tired to specify
java.rmi.server.hostname
but it did not help metoday 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:
After that i specified
externalHost
andpublic-ip
for my sip-balancer and got bean endpoint address with127.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.