Hi Geil...
I'll try to recompile my program to use dinamically the library
libmysequoia... although the result is the same... It only write in one
backed. I adjunt a pice of mysequoia.log to explain it better what is
happening. Something curious is that it doesn't matter what i write in
the field host of mysequoia.conf because always libmysequoia is going to
use the server describer in "mysql://..." chain defined in the
program...
Here the log:
2007-01-08 13:45:44,965 DEBUG 3085952704 MySQLAPI (MySQLAPI.cpp:188) -
Entering mysql_server_init: argc=0 argv=0 groups=0
2007-01-08 13:45:44,965 DEBUG 3085952704 MySQLAPI (MySQLAPI.cpp:196) -
Leaving mysql_server_init.
2007-01-08 13:45:44,965 DEBUG 3085952704 MySQLAPI (MySQLAPI.cpp:109) -
Entering mysql_init: mysql=0x81334f0
2007-01-08 13:45:44,965 DEBUG 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:47) - Entering constructor; mysql=0x81334f0 free_me=0
2007-01-08 13:45:44,965 DEBUG 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:69) - Leaving constructor. 
2007-01-08 13:45:44,965 DEBUG 3085952704 MySQLAPI (MySQLAPI.cpp:134) -
Leaving mysql_init: mysql=0x81334f0
2007-01-08 13:45:44,965 DEBUG 3085952704 MySQLAPI (MySQLAPI.cpp:245) -
Entering mysql_real_connect: : mysql=0x81334f0
host=node1.localhost.localdomain user=openser passwd=sip66.33rw
db=opensequoia port=0
2007-01-08 13:45:44,965 DEBUG 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:111) - Entering connect:
host=node1.localhost.localdomain user=openser passwd=sip66.33rw
db=opensequoia port=0
2007-01-08 13:45:44,965 DEBUG 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:1153) - Entering read_ini_file.
2007-01-08 13:45:44,965 DEBUG 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:926) - Entering push_init_command: cmd=
2007-01-08 13:45:44,965 DEBUG 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:929) - Leaving push_init_command.
2007-01-08 13:45:44,965 DEBUG 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:1238) - Leaving read_ini_file.
2007-01-08 13:45:44,966 DEBUG 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:202) - Connect (adding host):
host=node1.localhost.localdomain port=25322
2007-01-08 13:45:44,967 DEBUG 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:990) - Entering delete_connection.
2007-01-08 13:45:44,967 DEBUG 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:1001) - Leaving delete_connection.
2007-01-08 13:45:44,967 DEBUG 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:972) - Entering set_connect_info:
host=node1.localhost.localdomain user=openser passwd=sip66.33rw
db=opensequoia port=25322
2007-01-08 13:45:44,967 DEBUG 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:984) - Leaving set_connect_info.
2007-01-08 13:45:44,968 INFO 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:219) - Connected: host=node1.localhost.localdomain
user=openser passwd=sip66.33rw db=opensequoia port=25322
persistent_connection=0 ping_delay=0 controller_timeout=0
2007-01-08 13:45:44,968 DEBUG 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:231) - Leaving connect.
2007-01-08 13:45:44,968 DEBUG 3085952704 MySQLAPI (MySQLAPI.cpp:260) -
Leaving mysql_real_connect: result=0x81334f0
2007-01-08 13:45:44,968 DEBUG 3085952704 MySQLAPI (MySQLAPI.cpp:936) -
Entering mysql_real_escape_string: mysql=0x81334f0 to=
from=subscriberlength=10
2007-01-08 13:45:44,968 DEBUG 3085952704 MySQLAPI (MySQLAPI.cpp:945) -
Leaving mysql_real_escape_string: result=10
2007-01-08 13:45:44,968 DEBUG 3085952704 MySQLAPI (MySQLAPI.cpp:414) -
Entering mysql_query: mysql=0x81334f0 query=select table_version from
version where table_name='subscriber'
2007-01-08 13:45:44,968 DEBUG 3085952704 MySQLAPI (MySQLAPI.cpp:426) -
Entering mysql_real_query: mysql=0x81334f0 query=select table_version
from version where table_name='subscriber' length=63
2007-01-08 13:45:44,968 DEBUG 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:313) - Entering real_query: query=select table_version
from version where table_name='subscriber' length=63
2007-01-08 13:45:44,968 INFO 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:315) - Executing query=select table_version from version
where table_name='subscriber' length=63
2007-01-08 13:45:45,087 INFO 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:386) - Executed query with result set. Field_count=1
2007-01-08 13:45:45,087 DEBUG 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:407) - Leaving real_query: result=1
2007-01-08 13:45:45,087 DEBUG 3085952704 MySQLAPI (MySQLAPI.cpp:435) -
Leaving mysql_real_query: result=0
2007-01-08 13:45:45,087 DEBUG 3085952704 MySQLAPI (MySQLAPI.cpp:418) -
Leaving mysql_query: result=0
2007-01-08 13:45:45,087 DEBUG 3085952704 MySQLAPI (MySQLAPI.cpp:469) -
Entering mysql_store_result: mysql=0x81334f0
2007-01-08 13:45:45,087 DEBUG 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:456) - Entering get_results: fetch_all=1
2007-01-08 13:45:45,087 DEBUG 3085952704 MySQLAPI.Carob
(CarobCommon.cpp:45) - Entering get_query_fields:
result=0rsmPtr=0xbfe56a30
2007-01-08 13:45:45,087 DEBUG 3085952704 MySQLAPI.Carob
(CarobCommon.cpp:98) - Leaving get_query_fields: result=1
2007-01-08 13:45:45,087 DEBUG 3085952704 MySQLAPI.Carob
(CarobMySQL.cpp:533) - Leaving get_results: result=0x8e298f8
2007-01-08 13:45:45,087 DEBUG 3085952704 MySQLAPI (MySQLAPI.cpp:478) -
Leaving mysql_store_result: result=0x8e298f8
2007-01-08 13:45:45,087 DEBUG 3085952704 MySQLAPI (MySQLAPI.cpp:730) -
Entering mysql_field_count: mysql=0x81334f0
2007-01-08 13:45:45,087 DEBUG 3085952704 MySQLAPI (MySQLAPI.cpp:734) -
Leaving mysql_field_count: result=1
:%s/node1.localhost.localdomain/node1/g


El vie, 05-01-2007 a las 18:31 +0100, Gilles Rayrat escribió:
> (please make sure to answer directly to the mailing list, I cc you for
> convenience only)
> 
> That's the point, your application is statically linked to
> libmysqlclient: the LD_PRELOAD is thus useless and libmysequoia
> functions are never called !
> 
> First solution (recommended): link dynamically to libmysql
> 
> When you compiled your application, the linker obviously didn't found
> libmysqlclient.so. So it felt back silently to a static linkage (and
> he found the .a).
> 
> Check that the directories you listed in $LIBS contain this .so
> If not, do a "find /usr -name libmysqlclient.so*".
> If you don't have any ".so" but only ".so.14", just add a symlink to
> it (ln -s /usr/???/libmysqlclient.so.14 /usr/???/libmysqlclient.so)
> 
> After that step, recompile (well, just relink) your application and
> retry ldd. If it shows the libmysqlclient, you're done, your can run
> LD_PRELOAD=<path to libmysequoia> application
> 
> 
> Second solution (if you absolutely need to keep this static link):
> link to libsequoia.a (statically)
> edit your makefile, remove any -Lxxxmysqlxx and -lmysqlclient and add
> libmysequoia to the list of objects to link
> 
> Hope these help
> Cheers,
> Gilles.
> 
> Raúl Rodriguez a écrit : 
> > Hi Gilles...
> > First of all, thanks for your help... i'll try to answer your
> > questions
> > El vie, 05-01-2007 a las 15:42 +0100, Gilles Rayrat escribió:
> > > Hi Raúl!
> > >
> > > You are right, the statement should be written on both nodes.
> > >
> > > It looks like for some reason, you are still using the regular
> > libsql lib.
> > > Is your application statically linked to mysql ? if so, you either
> > will
> > > have to recompile it with the
> > > libmysequoia.a or to make it link dynamically
> > 
> > Seeing ldd result i supose that libmysql is linked statically...
> > To do that is enough with change the symbolic lynk libmysql.so.14 to
> > libmysequoia.so.14?
> > 
> > This is the Makefile of my application (Sorry, but i'm a bit newbie
> > in
> > C):
> > 
> >         # mysql.h locations (freebsd,openbsd  solaris)
> >         DEFS +=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/mysql \
> >                 -I$(LOCALBASE)/mysql/include/mysql -I
> >         $(LOCALBASE)/mysql/include \
> >                 -I/usr/include/mysql
> > 
> >         # libmysqlclient locations on RH/Suse, Solaris /OpenBSD,
> > FreeBSD
> >         # (Debian does the right thing and puts it in /usr/lib)
> >         LIBS=-L/usr/lib/mysql -L$(LOCALBASE)/lib
> >                 -L$(LOCALBASE)/lib/mysql \
> >                 -L$(LOCALBASE)/mysql/lib/mysql/ \
> >                 -L$(LOCALBASE)/mysql/lib \
> >                 -L/usr/lib64/mysql \
> >                 -lm -lmysqlclient -lz
> > 
> > > Can you please send the output of 'ldd <yourapplication>'
> > 
> >         libdl.so.2 => /lib/libdl.so.2 (0x00758000)
> >         libresolv.so.2 => /lib/libresolv.so.2 (0x008bf000)
> >         libc.so.6 => /lib/tls/libc.so.6 (0x0062b000)
> >         /lib/ld-linux.so.2 (0x0060d000)
> > 
> > > Besides, try to enable libmysequoia logs (typically in
> > > /etc/mysequoia/logger.conf),
> > > putting log4j.logger.MySQLAPI=DEBUG (or INFO)
> > Thanks... we had to activate this to see something in the log
> > (Previosly it was in blank).
> > The strange thing is that i can't see any error... the only strange
> > this is that
> > mysequoia is always working with node1 of the RAIDB1... node2
> > doesn't
> > appear anywhere
> > > Could you also send us your mysequoia.conf ?
> > [client]
> > user = xxxxxxxx
> > password = xxxxxxx
> > host = mysql1 mysql2
> > database = opensequoia
> > ;default-character-set=latin1
> > 
> > # the default ping delay in milliseconds
> > ;ping_delay = 1000
> > 
> > # the default controller timeout in milliseconds
> > ;controller_timeout = 25000
> > 
> > > Thanks you for your interest in sequoia & friends,
> > > Gilles
> > >
> > >
> > > Raúl Rodríguez a écrit :
> > > > Hi All!
> > > >         I have a little problem using libmysequoia. We have
> > running a
> > > >         sequoia
> > > >         deployment based in two nodes with one backed each one
> > > >         configured in
> > > >         RAIDb-1. I am trying to use one aplication who
> > dinamically link
> > > >         libmyseqouia.so.14 (MYSQL 4.1) to run.
> > > >         The application launch without problem:
> > > >         LD_PRELOAD=$LIBS/libmysequoia.so.14 application
> > > >         The application have configured a link to the database
> > like:
> > > >         mysql://node1/virtualdatabase
> > > >         The problem is that the INSERT operations only take
> > effect over
> > > >         backend
> > > >         in node1, never over the other backend. I'm not sure how
> > this
> > > >         would
> > > >         work, but i suppose that although i use node1 in my sql
> > link,
> > > >         carob with
> > > >         sequoia must distribute my sql statements against the
> > two nodes.
> > > >         Am i
> > > >         right?
> > > >         Any sugestion would be appreciated.
> > > >         Thanks in advanced.
> > > >        
> > > >        
> > > >
> > > > _______________________________________________
> > > > Carob mailing list
> > > > [email protected]
> > > > https://forge.continuent.org/mailman/listinfo/carob
> > > >
> > > >  
> > 
> > 

_______________________________________________
Carob mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob

Reply via email to