[OpenSIPS-Users] mongo query and params confusion

Ovidiu Sas osas at voipembedded.com
Tue Sep 9 03:48:54 CEST 2014


I haven't tried raw queries.
I'm using mongo as a backend db for all loaded modules.

Try to enable debug logs and see if you can spot something.
Also, try to connect to mongo from mongo shell and run some commands
and compare them with what opensips attempts to do.


-ovidiu

On Mon, Sep 8, 2014 at 8:42 PM, Tito Cumpen <tito at xsvoce.com> wrote:
> I doubt that I am seeing the connection the db load fine during startup
>
>
>
> Sep  9 00:35:29 mediaproxy2 /sbin/opensips[24461]:
> NOTICE:presence:child_init: init_child [14]  pid [24461]
>
> Sep  9 00:35:29 mediaproxy2 /sbin/opensips[24461]:
> INFO:cachedb_mongodb:mongo_new_connection: Connected at server 162.XX.XX.XX
> with version 2.4.6 , to db AOR.Location
>
> Sep  9 00:35:29 mediaproxy2 /sbin/opensips[24465]:
> NOTICE:presence:child_init: init_child [15]  pid [24465]
>
> Sep  9 00:35:29 mediaproxy2 /sbin/opensips[24459]:
> NOTICE:presence:child_init: init_child [13]  pid [24459]
>
> Sep  9 00:35:29 mediaproxy2 /sbin/opensips[24465]:
> INFO:cachedb_mongodb:mongo_new_connection: Connected at server 162.XX.XXX.XX
> with version 2.4.6 , to db AOR.Location
>
> Sep  9 00:35:29 mediaproxy2 /sbin/opensips[24467]:
> NOTICE:presence:child_init: init_child [16]  pid [24467]
>
> Sep  9 00:35:29 mediaproxy2 /sbin/opensips[24459]: INFO
>
>
> Is there anyway to reference the server to use during a raw query? Also I am
> not sure if this applies to raw queries:
>
> section 1.5, 1.2
>
>
> of
>
> http://www.opensips.org/html/docs/modules/devel/cachedb_mongodb.html
>
> cache_store("mongodb:group1","key","$ru value");
>
> cache_fetch("mongodb:replicaset1","key",$avp(10));
>
> cache_remove("mongodb:cluster1","key");
>
>
>
>
> Thanks,
>
> Tito
>
>
>
>
>
>
>
>
>
>
> On Mon, Sep 8, 2014 at 8:29 PM, Ovidiu Sas <osas at voipembedded.com> wrote:
>>
>> Maybe some firewall issues?
>>
>> -ovidiu
>>
>> On Mon, Sep 8, 2014 at 8:11 PM, Tito Cumpen <tito at xsvoce.com> wrote:
>> > Ovidiu,
>> >
>> >
>> > I have corrected the param and now I am seeing opensips start without a
>> > problem the query problem still persists with the error
>> >
>> > /sbin/opensips[22454]: ERROR:core:cachedb_raw_query: failed to get
>> > connection for grp name []
>> >
>> > I am not seeing any attempts being made from this server to the my mongo
>> > instance on the ingress interface. Any ideas??
>> >
>> >
>> >
>> > Thanks,
>> >
>> > Tito
>> >
>> >
>> >
>> > On Mon, Sep 8, 2014 at 8:01 PM, Ovidiu Sas <osas at voipembedded.com>
>> > wrote:
>> >>
>> >> Here's what works for me (I use both mongo and cache):
>> >> loadmodule "cachedb_mongodb.so"
>> >>   modparam("cachedb_mongodb",
>> >> "cachedb_url","mongodb:instance1://localhost:27017/db.collection")
>> >> loadmodule "db_cachedb.so"
>> >>
>> >>
>> >> modparam("db_cachedb","cachedb_url","mongodb:instance1://localhost:27017/db.collection")
>> >>
>> >> You have the wrong module name (cachedb_mongo vs. cachedb_mongodb)
>> >>
>> >> Regards,
>> >> Ovidiu Sas
>> >>
>> >> On Mon, Sep 8, 2014 at 7:50 PM, Tito Cumpen <tito at xsvoce.com> wrote:
>> >> > Hello Group,
>> >> >
>> >> >
>> >> > I am perplexed about what the correct params are to point opensips to
>> >> > an
>> >> > instance of mongodb
>> >> >
>> >> >
>> >> > I am currently using these
>> >> >
>> >> >
>> >> > loadmodule "db_cachedb.so"
>> >> >
>> >> > loadmodule "cachedb_mongodb.so"
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > modparam("cachedb_mongo","cachedb_url","mongodb:instance1://162.XXX.XX.XXXX:27017/AOR.Location")
>> >> >
>> >> > which triggers this error
>> >> >
>> >> >  Parameter <cachedb_url> not found in module <cachedb_mongo> - can't
>> >> > set
>> >> >
>> >> > Alternatively I have tried using :
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > modparam("db_cachedb","cachedb_url","mongodb:instance1://162.XX.XX.XX:27017/AOR.Location")
>> >> >
>> >> > which would cause the following error when running this query
>> >> >
>> >> >                 cache_raw_query("mongodb","{ \"op\" : \"find\",
>> >> > \"ns\" :
>> >> > \"AOR.Location\", \"query\": {\"User\" : $rU}
>> >> > }","$avp(mongo_result)");
>> >> >
>> >> >
>> >> > ERROR:core:cachedb_raw_query: failed to get connection for grp name
>> >> > [}
>> >> >
>> >> > I am using Opensips version 1.11
>> >> >
>> >> > Thanks
>> >> >
>> >> >
>> >> >
>> >> > _______________________________________________
>> >> > Users mailing list
>> >> > Users at lists.opensips.org
>> >> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> VoIP Embedded, Inc.
>> >> http://www.voipembedded.com
>> >>
>> >> _______________________________________________
>> >> Users mailing list
>> >> Users at lists.opensips.org
>> >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>> >
>> >
>> >
>> > _______________________________________________
>> > Users mailing list
>> > Users at lists.opensips.org
>> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>> >
>>
>>
>>
>> --
>> VoIP Embedded, Inc.
>> http://www.voipembedded.com
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



-- 
VoIP Embedded, Inc.
http://www.voipembedded.com



More information about the Users mailing list