[OpenSIPS-Users] Connecting to mongodb Replica set from opensips .

Sasmita Panda spanda at 3clogic.com
Wed Jun 1 12:17:33 CEST 2016


HI Guys ,

     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"
modparam("cachedb_mongodb", "cachedb_url","mongodb:replicaset1://
root:password at 1.2.3.4:27017,2.3.4.5:27017/jack.db.CallCenter_Info")
modparam("db_cachedb","cachedb_url","mongodb:replicaset1://
root:password at 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 = 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 = 0, errno=Success
 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*
*Sasmita Panda*
*Network Testing and Software Engineer*
*3CLogic , ph:07827611765*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20160601/48025738/attachment.htm>


More information about the Users mailing list