[SR-Users] DB_CLUSTER - Cluster Definition

Charles Chance charles.chance at sipcentric.com
Tue Aug 20 17:18:22 CEST 2013


Hi All,

I'm having difficulties with the above module and can't see what I'm doing
wrong.

Config as follows:

modparam("db_cluster", "connection", "db01=>mysql://
> readwrite:password at db01.domain.com/kamailio")
> modparam("db_cluster", "connection", "db02=>mysql://
> readonly:password at db02.domain.com/kamailio")
> modparam("db_cluster", "cluster", "cls1=>db01=0s9s;db02=9s0s")



As you can see, there are two database servers - a master and a slave. I am
trying to force all read operations to the slave (db02) and all write
operations to the master (db01).

Unless I am missing the point, the above priorities should achieve the
desired effect. However, it seems to be going wrong somewhere as write
operations are being sent to the slave:

ERROR: db_mysql [km_dbase.c:122]: driver error on query: DELETE command
> denied to user 'readonly'@'x.x.x.x' for table 'location'
>
ERROR: db_mysql [km_dbase.c:122]: driver error on query: UPDATE command
> denied to user 'readonly'@'x.x.x.x' for table 'location'
> ERROR: db_mysql [km_dbase.c:122]: driver error on query: INSERT command
> denied to user 'readonly'@'x.x.x.x' for table 'location'


It is the same for all modules, by the way, not just usrloc. For each
module, I have db_url set to "cluster://cls1".

If I change the cluster definition to "cls1=>db01=9s9s;db02=0s0s", all
operations (read and write) are sent to db01 as expected.

Am I missing something here? Can anyone see what I may be doing wrong?

Many thanks,

Charles

-- 
www.sipcentric.com

Follow us on twitter @sipcentric <http://twitter.com/sipcentric>

Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered 
office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham 
B7 4EJ.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130820/aa5dbc89/attachment.html>


More information about the sr-users mailing list