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

sevpal sevpal at aol.com
Thu Jun 2 05:01:38 CEST 2016


Hi, some modules are not safe to use with mongodb, namely; acc (Cannot write to missed_call), msilo (Does not delete stored messages after sent), avpops(do not recall the issue with this one) and there may be others.

To connect to the replica set (Minimum 3 replicas for proper master election):
All the modules (cachedb_mongodb.so, db_cachedb.so etc.) should point to the same db name in the xdb_url module parameter.

loadmodule "cachedb_mongodb.so"
loadmodule "db_cachedb.so"      
modparam("cachedb_mongodb", "cachedb_url","mongodb:replicaset1://root:password@1.2.3.4:27017,2.3.4.5:27017,5.5.5.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,5.5.5.5:27017,/jack.db.CallCenter_Info")


loadmodule "usrloc.so"      
modparam("usrloc", "db_url","mongodb:replicaset1://root:password@1.2.3.4:27017,2.3.4.5:27017,5.5.5.5:27017,/jack.db.CallCenter_Info")

Use the mongo slave_ok,1 parameter to read write via slaves.

For the version table, you will need to create a copy in mongodb with the same name as the version table in mysql. Use the db_version_table= global parameter if you want to change the default name of the table. 


More information about the Users mailing list