Hi David,

sorry to be so late to reply.
Maybe you were able to fix the issue and your questions are outdade.

Le 09/03/2012 12:24, David Seira a écrit :
Hi again Cyril,

I'm trying the option "mysql-check" as you comment me. I've found that
I must create a user into the mysql server for permit the haproxy
access:

insert into user (Host,User) values ('192.168.1.3','haproxy'); (The
users table has the ndbcluster engine, for that the permissions are
replicated inmediatly)

Then I modify my haproxy.conf like this:

listen MySQL_Node 192.168.1.3:3306
         mode tcp
         option mysql-check user haproxy
         option tcplog
         balance roundrobin
         server mysqlnode1 192.168.1.1 check port 3306 weight 50
         server mysqlnode2 192.168.1.2 check port 3306 weight 50

I start the haproxy in debug mode. The problem is that, I don't know
why, but the haproxy puts DOWN the mysqlnode1 after 20 seconds (2
seconds/haproxy request x 10 max connections mysql errors) with the
connections problems, mysql server on mysqlnode1 still block the
haproxy request. However the mysqlnode2 is still UP.

I'd recommend the use of GRANT requests instead of inserting directly into the 'user' table. When inserting directly in the table, mysql requires to flush the privileges with "flush privileges" or "mysqladmin flush-privileges". That could explain why your first node was DOWN.

Another quick question, I've seen in several blogs that it is more
interesting to put an script in the xinetd for monitor the mysql

I'd say that it depends on your needs, but I'm also pretty sure that those blog entries were written before "option mysql-check" was available in haproxy ;-)

--
Cyril Bonté

Reply via email to