Re: [Sqlrelay-discussion] r/w splitting configuration question
                
                Brought to you by:
                
                    mused
                    
                
            
            
        
        
        
    | 
      
      
      From: <jan...@id...> - 2012-03-09 10:43:02
      
     | 
| thanks David for your fix. This solved the problem ! Very cool.
Unfortunately I can't use the router instance 'test'.
# query -config /opt/sqlrelay-0.44/etc/sqlrelay.conf -id test "select * from ut_online;"
(If using 'master' or 'slave' instance query works.)
The connections are as follows :
# lsof -ni4 |grep sql
sqlr-list 12967 nobody    6u  IPv4 116943      0t0  TCP *:9000 (LISTEN)
sqlr-conn 12986 nobody    3u  IPv4 116940      0t0  TCP 192.168.122.13:34141->192.168.122.152:mysql (ESTABLISHED)
sqlr-list 13081 nobody    6u  IPv4 117139      0t0  TCP *:9001 (LISTEN)
sqlr-conn 13096 nobody    4u  IPv4 117114      0t0  TCP 192.168.122.13:33377->192.168.122.153:mysql (ESTABLISHED)
sqlr-list 23694 nobody    7u  IPv4 127196      0t0  TCP *:9002 (LISTEN)
192.168.122.13
----------------------
port 9000 'master' instance
port 9001 'slave' instance
port 9002 'test' instance (router)
192.168.122.152 MySQL master
192.168.122.153 MySQL slave
Furthermore I can't use neither
$ mysql -h 192.168.122.13 -P 9000 -p -e "select * from ut_online;"
Enter password: 
nor -P 9001
(output is missing)
MySQL client version is :
$ mysql --version
mysql  Ver 14.14 Distrib 5.1.58, for debian-linux-gnu (x86_64) using readline 6.2
Could you please point me to the right direction.
kind regards, 
---
Jan
________________________________________
Von: David Muse [dav...@fi...]
Gesendet: Freitag, 9. März 2012 03:40
An: Discussion of topics related to SQL Relay
Betreff: Re: [Sqlrelay-discussion] r/w splitting configuration question
Hi Jan,
It looks like I introduced a bug in the last release.  Here is a quick fix:
Edit src/util/sqlrconfigfile.cpp and look for the following code, near
line 558:
         // Filter section, nested (runquery*)
         case FILTER_TAG:
             currentname="filter";
             if (!charstring::compare(name,"runquery")) {
                 thistag=RUNQUERY_TAG;
             } else {
                 ok=false;
             }
             break;
         // Filter section, nested (runquery*)
         case ROUTE_TAG:
             currentname="route";
             if (!charstring::compare(name,"runquery")) {
                 thistag=RUNQUERY_TAG;
             } else {
                 ok=false;
             }
             break;
Change instances of "runquery" to "query" and RUNQUERY_TAG to QUERY_TAG,
as follows:
         // Filter section, nested (query*)
         case FILTER_TAG:
             currentname="filter";
             if (!charstring::compare(name,"query")) {
                 thistag=QUERY_TAG;
             } else {
                 ok=false;
             }
             break;
         // Filter section, nested (query*)
         case ROUTE_TAG:
             currentname="route";
             if (!charstring::compare(name,"query")) {
                 thistag=QUERY_TAG;
             } else {
                 ok=false;
             }
             break;
I guess I got a little too aggressive with search and replace.  With
those modifications, it should work as expected.
Sorry for the confusion.
David Muse
dav...@fi...
 |