[OpenSIPS-Users] Load balancer problem

Anshuman S Rawat arawat at 3clogic.com
Tue Aug 26 14:04:14 CEST 2014


Hi,

 

I am trying to use the load_balancer module for load balancing requests
between 2 OpenSIPS instances but my load_balance() function is failing for
reasons I couldn't figure out.

 

My load balancer table looks like this.

 

+----+----------+-------------------------+-----------+------------+--------
-----+

| id | group_id | dst_uri                 | resources | probe_mode |
description |

+----+----------+-------------------------+-----------+------------+--------
-----+

|  1 |        1 | sip:192.168.1.18:6606   | vm=1000   |          2 |
|

|  2 |        1 | sip:192.168.1.15:3300 | vm=1000   |          2 |
|

+----+----------+-------------------------+-----------+------------+--------
-----+

 

Loaded modules:

loadmodule "db_mysql.so"

loadmodule "sl.so"

loadmodule "tm.so"

loadmodule "rr.so"

loadmodule "maxfwd.so"

loadmodule "usrloc.so"

loadmodule "signaling.so"

loadmodule "registrar.so"

loadmodule "textops.so"

loadmodule "mi_fifo.so"

loadmodule "xlog.so"

loadmodule "nathelper.so"

loadmodule "lcr.so"

loadmodule "dialog.so"

loadmodule "siptrace.so"

#loadmodule "uac.so"

loadmodule "path.so"

loadmodule "load_balancer.so"

loadmodule "auth.so"

loadmodule "auth_db.so"

loadmodule "msilo.so"

 

 

Module specific parameters:

 

# -- load balancer --

modparam("load_balancer", "db_url",
"mysql://user:password@localhost/opensips")

modparam("load_balancer", "db_table", "load_balancer")

modparam("load_balancer", "probing_interval", 30)

 

 

 

Syslog contains the following on startup:

 

Aug 26 07:58:23 tatatest2 /usr/local/sbin/opensips[19419]: NOTICE:core:main:
version: opensips 1.6.0-notls (x86_64/linux)

Aug 26 07:58:23 tatatest2 /usr/local/sbin/opensips[19419]: INFO:core:main:
using 128 Mb shared memory

Aug 26 07:58:23 tatatest2 /usr/local/sbin/opensips[19419]: INFO:core:main:
using 16 Mb private memory per process

Aug 26 07:58:23 tatatest2 /usr/local/sbin/opensips[19419]: INFO:sl:mod_init:
Initializing StateLess engine

Aug 26 07:58:23 tatatest2 /usr/local/sbin/opensips[19419]: INFO:tm:mod_init:
TM - initializing...

Aug 26 07:58:23 tatatest2 /usr/local/sbin/opensips[19419]:
INFO:maxfwd:mod_init: initializing...

Aug 26 07:58:23 tatatest2 /usr/local/sbin/opensips[19419]:
INFO:usrloc:ul_init_locks: locks array size 512

Aug 26 07:58:23 tatatest2 /usr/local/sbin/opensips[19419]:
NOTICE:signaling:mod_init: initializing module ...

Aug 26 07:58:23 tatatest2 /usr/local/sbin/opensips[19419]:
INFO:registrar:mod_init: initializing...

Aug 26 07:58:23 tatatest2 /usr/local/sbin/opensips[19419]:
INFO:textops:mod_init: initializing...

Aug 26 07:58:23 tatatest2 /usr/local/sbin/opensips[19419]:
INFO:xlog:mod_init: initializing...

Aug 26 07:58:23 tatatest2 /usr/local/sbin/opensips[19419]:
INFO:dialog:mod_init: Dialog module - initializing

Aug 26 07:58:23 tatatest2 /usr/local/sbin/opensips[19419]:
INFO:siptrace:mod_init: initializing...

Aug 26 07:58:23 tatatest2 /usr/local/sbin/opensips[19419]:
INFO:path:mod_init: initializing...

Aug 26 07:58:23 tatatest2 /usr/local/sbin/opensips[19419]:
INFO:load_balancer:mod_init: Load-Balancer module - initializing

Aug 26 07:58:23 tatatest2 /usr/local/sbin/opensips[19419]:
INFO:auth:mod_init: initializing...

Aug 26 07:58:23 tatatest2 /usr/local/sbin/opensips[19419]:
INFO:auth_db:mod_init: initializing...

Aug 26 07:58:23 tatatest2 /usr/local/sbin/opensips[19419]:
INFO:core:probe_max_receive_buffer: using a UDP receive buffer of 512 kb

 

 

load_balance() is called from main route the following way-

 

if (load_balance("1","vm"))

                {

                        xlog("L_NOTICE", "Loadbalancer: route:method ($rm)
r-uri ($ru) : Contact : $ct  :callID $ci: destination: $du\n");

                        t_on_failure("3");

                        t_on_reply("1");

                        t_relay();

                }

                else

                {

                        xlog("L_NOTICE", "Loadbalancer: route:method ($rm)
r-uri ($ru) : Contact : $ct  :callID $ci: FAILED $retcode\n");

                        t_reply("500", "Service unavailable");

                }

 

 

The function always fails and I couldn't figure out why.

What am I doing wrong?

 

Thanks,

Anshuman

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140826/516bae1b/attachment.htm>


More information about the Users mailing list