[OpenSIPS-Users] Load balancer problem
Anshuman S Rawat
arawat at 3clogic.com
Wed Aug 27 09:03:37 CEST 2014
Hi,
Yes, load_balance() returned false. But I found the problem. I had probing
on and '200' for OPTIONS was the only measurement for success. Fixed that
and it worked.
Thanks for responding.
Anshuman
From: Bogdan-Andrei Iancu [mailto:bogdan at opensips.org]
Sent: Tuesday, August 26, 2014 10:44 PM
To: OpenSIPS users mailling list; arawat at 3clogic.com
Subject: Re: [OpenSIPS-Users] Load balancer problem
Hi,
By "failing" you mean the "load_balance" function returns false in script ?
Could you post the output of:
opensipsctl fifo lb_list
Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 26.08.2014 15:04, Anshuman S Rawat wrote:
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
_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140827/e23834df/attachment-0001.htm>
More information about the Users
mailing list