No subject


Wed Jan 27 21:05:54 CET 2016


use db
db.version.insert({ table_version : NumberInt(1009),  table_name : =
"location"})
db.version.insert({ table_version : NumberInt(10),  table_name : =
"dialog"})
From: Sasmita Panda=20
Sent: Wednesday, June 01, 2016 6:17 AM
To: OpenSIPS users mailling list=20
Subject: [OpenSIPS-Users] Connecting to mongodb Replica set from =
opensips .

HI Guys ,=20

     i am trying to use mongodb in replica set . I have tested my =
opensips-1.11 with a stand alone mongodb instance . Its working fine .

       Now I am trying to connect to a replica set . But somehow I amnot =
able to do this . Opensips is getting connected to the replica set but =
its not able to run raw query .

My opensips configuration is like bellow :

loadmodule "cachedb_mongodb.so"
loadmodule "db_cachedb.so"     =20
modparam("cachedb_mongodb", =
"cachedb_url","mongodb:replicaset1://root:password@1.2.3.4:27017,2.3.4.5:=
27017/jack.db.CallCenter_Info")
modparam("db_cachedb","cachedb_url","mongodb:replicaset1://root:password@=
1.2.3.4:27017,2.3.4.5:27017/jack.db.test")

modparam("acc", "db_url", "cachedb://mongodb:replicaset1")
modparam("acc", "db_flag", 2)
modparam("acc", "log_flag", 2)
modparam("acc", "cdr_flag", 1)
modparam("acc", "log_facility", "LOG_LOCAL7")


Opensips is not able to execute version check query for acc module .  =
Bellow is the logs of opensips .

    INFO:cachedb_mongodb:mongo_new_connection: Connected at server =
52.71.216.67:27017,23.21.65.168:27017 with version 3.0.12 , to db =
db.test
DBG:db_cachedb:db_cachedb_init: Succesfully initiated connection to =
[mongodb:replicaset1]
DBG:cachedb_mongodb:mongo_db_query_trans: Running raw mongo query on =
table db.my_version_table
ERROR:cachedb_mongodb:mongo_db_query_trans: Failed to run query. Err =3D =
0, 0 , 0
DBG:cachedb_mongodb:mongo_db_query_trans: Fetched key lastOp
DBG:cachedb_mongodb:mongo_db_query_trans: (unknown type 17)
DBG:cachedb_mongodb:mongo_db_query_trans: Fetched key connectionId
DBG:cachedb_mongodb:mongo_db_query_trans: (int) 516
DBG:cachedb_mongodb:mongo_db_query_trans: Fetched key n
DBG:cachedb_mongodb:mongo_db_query_trans: (int) 0
DBG:cachedb_mongodb:mongo_db_query_trans: Fetched key syncMillis
DBG:cachedb_mongodb:mongo_db_query_trans: (int) 0
DBG:core:wait_status_code: read code 0 ? rc =3D 0, errno=3DSuccess
INFO:core:daemonize: pre-daemon process exiting with -1


       In my mongodb instance there is some error printing also .
[initandlisten] connection accepted from 104.131.6.7:35857 #565 (7 =
connections now open)
2016-06-01T10:09:14.802+0000 I QUERY    [conn565] assertion 13 not =
authorized for query on db.my_version_table ns:db.my_version_table =
query:{ $query: { table_name: "acc" } }

       By login through a remote machine with same username and password =
. I am able to execute all query manually . But why my opensips cant do =
this . If anybody have tried this can you suggest me any solution . What =
else I should do in my replica set or in opensips to make it happen ?

     Please help me . As I am quite new to mongodb replica set so not =
able to understand the actual problem also .


Thanks & Regards=20
Sasmita Panda
Network Testing and Software Engineer
3CLogic , ph:07827611765


-------------------------------------------------------------------------=
-------
_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

------=_NextPart_000_00FA_01D1BC59.8D7D85E0
Content-Type: text/html;
	charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<HTML><HEAD></HEAD>
<BODY dir=3Dltr>
<DIV dir=3Dltr>
<DIV style=3D"FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'; COLOR: #000000">
<DIV>Hi, some modules are not safe to use with mongodb, namely; acc =
(Cannot=20
write to missed_call), msilo (Does not delete stored messages after =
sent),=20
avpops(do not recall the issue with this one) and there may be =
others.</DIV>
<DIV>&nbsp;</DIV>
<DIV>To connect to the replica set (Minimum 3 replicas for proper master =

election):</DIV>
<DIV>All the modules (cachedb_mongodb.so, db_cachedb.so etc.) should =
point to=20
the same db name in the xdb_url module parameter.</DIV>
<DIV>&nbsp;</DIV>
<DIV>loadmodule "cachedb_mongodb.so"</DIV>
<DIV>loadmodule "db_cachedb.so"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
<DIV>
<DIV>modparam("cachedb_mongodb", "cachedb_url","mongodb:replicaset1://<A =

style=3D'href: =
"http://root:password@1.2.3.4:27017"'>root:password at 1.2.3.4:27017</A>,<A =

style=3D'href: =
"http://2.3.4.5:27017/jack.db.CallCenter_Info"'>2.3.4.5:27017,5<A=20
style=3D'href: =
"http://2.3.4.5:27017/jack.db.CallCenter_Info"'>.5.5.5:27017</A>,/jack.db=
.CallCenter_Info</A>")</DIV>
<DIV>modparam("db_cachedb","cachedb_url","mongodb:replicaset1://<A=20
style=3D'href: =
"http://root:password@1.2.3.4:27017"'>root:password at 1.2.3.4:27017</A>,<A =

style=3D'href: =
"http://2.3.4.5:27017/jack.db.CallCenter_Info"'>2.3.4.5:27017,5<A=20
style=3D'href: =
"http://2.3.4.5:27017/jack.db.CallCenter_Info"'>.5.5.5:27017</A>,/jack.db=
.CallCenter_Info</A>")</DIV></DIV>
<DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV></DIV>
<DIV>loadmodule "usrloc.so"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
<DIV>
<DIV>modparam("usrloc", "db_url","mongodb:replicaset1://<A=20
style=3D'href: =
"http://root:password@1.2.3.4:27017"'>root:password at 1.2.3.4:27017</A>,<A =

style=3D'href: =
"http://2.3.4.5:27017/jack.db.CallCenter_Info"'>2.3.4.5:27017,5<A=20
style=3D'href: =
"http://2.3.4.5:27017/jack.db.CallCenter_Info"'>.5.5.5:27017</A>,/jack.db=
.CallCenter_Info</A>")</DIV>
<DIV>&nbsp;</DIV></DIV>
<DIV>Use the mongo slave_ok,1 parameter to read write via slaves.</DIV>
<DIV>&nbsp;</DIV>
<DIV>For the version table, you will need to create a copy in mongodb =
with the=20
same name as the version table in mysql. Use the db_version_table=3D =
global=20
parameter if you want to change the default name of the table. From =
mongo shell=20
do this:</DIV>
<DIV>&nbsp;</DIV>
<DIV>use db</DIV>
<DIV>db.version.insert({ table_version : NumberInt(1009),&nbsp; =
table_name :=20
"location"})</DIV>
<DIV>db.version.insert({ table_version : NumberInt(10),&nbsp; table_name =
:=20
"dialog"})</DIV>
<DIV>
<DIV=20
style=3D'FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: =
"Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; =
DISPLAY: inline'></DIV>
<DIV style=3D"FONT: 10pt tahoma">
<DIV style=3D"BACKGROUND: #f5f5f5">
<DIV style=3D"font-color: black"><B>From:</B> <A =
title=3Dspanda at 3clogic.com=20
href=3D"mailto:spanda at 3clogic.com">Sasmita Panda</A> </DIV>
<DIV><B>Sent:</B> Wednesday, June 01, 2016 6:17 AM</DIV>
<DIV><B>To:</B> <A title=3Dusers at lists.opensips.org=20
href=3D"mailto:users at lists.opensips.org">OpenSIPS users mailling =
list</A> </DIV>
<DIV><B>Subject:</B> [OpenSIPS-Users] Connecting to mongodb Replica set =
from=20
opensips .</DIV></DIV></DIV>
<DIV>&nbsp;</DIV></DIV>
<DIV=20
style=3D'FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: =
"Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; =
DISPLAY: inline'>
<DIV dir=3Dltr>HI Guys ,=20
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp; i am trying to use mongodb in replica set =
. I have=20
tested my opensips-1.11 with a stand alone mongodb instance . Its =
working fine=20
.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Now I am trying to connect to =
a=20
replica set . But somehow I amnot able to do this . Opensips is getting=20
connected to the replica set but its not able to run raw query .</DIV>
<DIV>&nbsp;</DIV>
<DIV>My opensips configuration is like bellow :</DIV>
<DIV>&nbsp;</DIV>
<DIV>loadmodule "cachedb_mongodb.so"</DIV>
<DIV>loadmodule "db_cachedb.so"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
<DIV>
<DIV>modparam("cachedb_mongodb", "cachedb_url","mongodb:replicaset1://<A =

href=3D"http://root:password@1.2.3.4:27017">root:password at 1.2.3.4:27017</=
A>,<A=20
href=3D"http://2.3.4.5:27017/jack.db.CallCenter_Info">2.3.4.5:27017/jack.=
db.CallCenter_Info</A>")</DIV>
<DIV>modparam("db_cachedb","cachedb_url","mongodb:replicaset1://<A=20
href=3D"http://root:password@1.2.3.4:27017">root:password at 1.2.3.4:27017</=
A>,<A=20
href=3D"http://2.3.4.5:27017/jack.db.test">2.3.4.5:27017/jack.db.test</A>=
")</DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV>
<DIV>modparam("acc", "db_url", "cachedb://mongodb:replicaset1")</DIV>
<DIV>modparam("acc", "db_flag", 2)</DIV>
<DIV>modparam("acc", "log_flag", 2)</DIV>
<DIV>modparam("acc", "cdr_flag", 1)</DIV>
<DIV>modparam("acc", "log_facility", "LOG_LOCAL7")</DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Opensips is not able to execute version check query for acc module =
.&nbsp;=20
Bellow is the logs of opensips .</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; INFO:cachedb_mongodb:mongo_new_connection: =
Connected at=20
server <A href=3D"http://52.71.216.67:27017">52.71.216.67:27017</A>,<A=20
href=3D"http://23.21.65.168:27017">23.21.65.168:27017</A> with version =
3.0.12 , to=20
db db.test</DIV>
<DIV>DBG:db_cachedb:db_cachedb_init: Succesfully initiated connection to =

[mongodb:replicaset1]</DIV>
<DIV>DBG:cachedb_mongodb:mongo_db_query_trans: Running raw mongo query =
on table=20
db.my_version_table</DIV>
<DIV>ERROR:cachedb_mongodb:mongo_db_query_trans: Failed to run query. =
Err =3D 0, 0=20
, 0</DIV>
<DIV>DBG:cachedb_mongodb:mongo_db_query_trans: Fetched key lastOp</DIV>
<DIV>DBG:cachedb_mongodb:mongo_db_query_trans: (unknown type 17)</DIV>
<DIV>DBG:cachedb_mongodb:mongo_db_query_trans: Fetched key =
connectionId</DIV>
<DIV>DBG:cachedb_mongodb:mongo_db_query_trans: (int) 516</DIV>
<DIV>DBG:cachedb_mongodb:mongo_db_query_trans: Fetched key n</DIV>
<DIV>DBG:cachedb_mongodb:mongo_db_query_trans: (int) 0</DIV>
<DIV>DBG:cachedb_mongodb:mongo_db_query_trans: Fetched key =
syncMillis</DIV>
<DIV>DBG:cachedb_mongodb:mongo_db_query_trans: (int) 0</DIV>
<DIV>DBG:core:wait_status_code: read code 0 ? rc =3D 0, =
errno=3DSuccess</DIV>
<DIV>INFO:core:daemonize: pre-daemon process exiting with -1</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; In my mongodb instance there =
is some=20
error printing also .</DIV>
<DIV>
<DIV>[initandlisten] connection accepted from <A=20
href=3D"http://104.131.6.7:35857">104.131.6.7:35857</A> #565 (7 =
connections now=20
open)</DIV>
<DIV>2016-06-01T10:09:14.802+0000 I QUERY&nbsp;&nbsp;&nbsp; [conn565] =
assertion=20
13 not authorized for query on db.my_version_table =
ns:db.my_version_table=20
query:{ $query: { table_name: "acc" } }</DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; By login through a remote =
machine with=20
same username and password . I am able to execute all query manually . =
But why=20
my opensips cant do this . If anybody have tried this can you suggest me =
any=20
solution . What else I should do in my replica set or in opensips to =
make it=20
happen ?</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp; Please help me . As I am quite new to =
mongodb=20
replica set so not able to understand the actual problem also .</DIV>
<DIV>&nbsp;</DIV>
<DIV>
<DIV>&nbsp;</DIV>
<DIV>
<DIV class=3Dgmail_signature data-smartmail=3D"gmail_signature">
<DIV dir=3Dltr><B><I>Thanks &amp; Regards</I></B>=20
<DIV><I>Sasmita Panda</I></DIV>
<DIV><I>Network Testing and Software Engineer</I></DIV>
<DIV><I>3CLogic , ph:07827611765</I></DIV></DIV></DIV></DIV></DIV></DIV>
<P>
<HR>
_______________________________________________<BR>Users mailing=20
list<BR>Users at lists.opensips.org<BR>http://lists.opensips.org/cgi-bin/mai=
lman/listinfo/users<BR></DIV></DIV></DIV></BODY></HTML>

------=_NextPart_000_00FA_01D1BC59.8D7D85E0--




More information about the Users mailing list