MySQL and Nginx mystery
TECK
nginx-forum at nginx.us
Fri May 6 22:52:43 MSD 2011
Hi all,
I have set a fastcgi upstream into Nginx configuration:
upstream fastcgi {
ip_hash;
server 192.168.0.2:9000;
server 192.168.0.3:9000;
server 192.168.0.4:9000;
}
Everything works perfect, except when I try to connect to MySQL, using
PHP.
$server = '192.168.0.40';
$username = 'tester';
$password = 'password';
mysql_connect($server, $username, $password);
I get a connection error telling me that I cannot connect to MySQL using
192.168.0.2!
(or whatever server I'm on it at that specific moment)
Current setup:
3 web servers, 2 set with heartbeat, nginx as start service
2 db servers, set with heartbeat and DRBD, mysqld as start service
Is there a header that I need to set into Nginx or this is a network
configuration issue that I need to alert the host guys about?
I did set the bind-address in my.cnf to 192.168.0.40 ip.
Thanks for your help.
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196165,196165#msg-196165
More information about the nginx
mailing list