<p dir="ltr">Hello,</p>
<p dir="ltr">Is anyone able to confirm whether the cluster definition I provided should indeed do what I think it should? If so, I will take a look further myself to find the reason why not.</p>
<p dir="ltr">Thanks in advance,</p>
<p dir="ltr">Charles</p>
<div class="gmail_quote">On 20 Aug 2013 16:18, "Charles Chance" <<a href="mailto:charles.chance@sipcentric.com">charles.chance@sipcentric.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi All,<div><br></div><div>I'm having difficulties with the above module and can't see what I'm doing wrong.</div><div><br></div><div>Config as follows:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

modparam("db_cluster", "connection", "db01=>mysql://<a href="http://readwrite:password@db01.domain.com/kamailio" target="_blank">readwrite:password@db01.domain.com/kamailio</a>")<br>modparam("db_cluster", "connection", "db02=>mysql://<a href="http://readonly:password@db02.domain.com/kamailio" target="_blank">readonly:password@db02.domain.com/kamailio</a>")<br>

modparam("db_cluster", "cluster", "cls1=>db01=0s9s;db02=9s0s")</blockquote></div><div><br></div><div><br></div><div>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).</div>

<div><br></div><div>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:</div><div><br></div>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">ERROR: db_mysql [km_dbase.c:122]: driver error on query: DELETE command denied to user 'readonly'@'x.x.x.x' for table 'location'<br>

</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">ERROR: db_mysql [km_dbase.c:122]: driver error on query: UPDATE command denied to user 'readonly'@'x.x.x.x' for table 'location'<br>

ERROR: db_mysql [km_dbase.c:122]: driver error on query: INSERT command denied to user 'readonly'@'x.x.x.x' for table 'location' </blockquote><div><br></div><div>It is the same for all modules, by the way, not just usrloc. For each module, I have db_url set to "cluster://cls1".</div>

<div><br></div><div>If I change the cluster definition to "cls1=>db01=9s9s;db02=0s0s", all operations (read and write) are sent to db01 as expected.</div><div><br></div><div>Am I missing something here? Can anyone see what I may be doing wrong?</div>

<div><br></div><div>Many thanks,</div><div><br></div><div>Charles</div><div><br></div><div>
</div></div>
</blockquote></div>

<br>
<font face="Helvetica, Arial, sans-serif"><font size="2"><span style="font-size:10pt"><a href="http://www.sipcentric.com/" title="blocked::http://www.sipcentric.com/" target="_blank">www.sipcentric.com</a><br>
            <br>
            Follow us on twitter <a href="http://twitter.com/sipcentric" title="blocked::http://twitter.com/sipcentric" target="_blank">@sipcentric</a><br>
            <br>
            <font color="gray">Sipcentric Ltd.
                Company registered in England & Wales no. 7365592.</font> <font color="gray">Registered
                office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.</font></span></font></font>