Hello ,
I would like connect my web servers to the Haproxy which will distribute the request on my 3 nodes PXC.
But when I test my website I have this error :
After adding max_connections=10000 and max_connect_errors=10000 in mysql configuration file (/etc/my.cnf) ; and doing the following command mysqladmin -uroot -ppasswd flush-hosts I restart mysql service.
I get this following error when I test the website again :
Here is my haproxy conf
frontend pxc-front
bind *:3307
mode tcp
default_backend pxc-back
frontend stats-front
bind *:8080
mode http
default_backend stats-back
frontend pxc-onenode-front
bind *:3306
mode tcp
#option mysql-check user root
default_backend pxc-onenode-back
backend pxc-back
mode tcp
balance leastconn
option httpchk
server node1 @ip :3306 check port 9200 inter 12000 rise 3 fall 3
server node2 @ip :3306 check port 9200 inter 12000 rise 3 fall 3
server node3 @ip :3306 check port 9200 inter 12000 rise 3 fall 3
backend stats-back
mode http
balance roundrobin
stats uri /haproxy/stats
stats refresh 10s
backend pxc-onenode-back
mode tcp
balance leastconn
option httpchk
server node1 @IP :3306 check port 9200 inter 12000 rise 3 fall 3 backup
server node2 @IP :3306 check port 9200 inter 12000 rise 3 fall 3
server node3 @IP :3306 check port 9200 inter 12000 rise 3 fall 3 backup
And web service configuration (settings.php)
$databases = array (
‘default’ =>
array (
‘default’ =>
array (
‘database’ => ‘Drupal’,
‘username’ => ‘drupal-user’,
‘password’ => ‘secret’,
‘host’ => ‘haproxy’, //@IP Haproxy
‘port’ => ‘3306’,
‘driver’ => ‘mysql’,
‘prefix’ => ‘’,
),
),
);
Is that I forgot something on these configurations? How can I solve that . Thanks in advance for your help.
Are you sure Mysql credentials are correct…? check with command line… and see whether you are able to login on all nodes with same credentials.
mysql -u [COLOR=#252C2F]drupal-user -P’secret’
Madhusudan;
The credentials are ok. I change the port in settings.php to 3307. Now the system goes well . Thanks for your answer.
good… That means I guess some other process was occupying that port…?.
Hello Madhusudan;
The only process which use this port is haproxy . I configure it to listen on ports 3306 and 3307. But I did not install mysql client.
I saw in pxc with haproxy configuration that it is not necessary to do like that. Perhaps this is not the good solution.
I will continue to think about the question.