May 06, 2011 02:52PM
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.
Subject Author Posted

MySQL and Nginx mystery

TECK May 06, 2011 02:52PM

Re: MySQL and Nginx mystery

TECK May 06, 2011 03:50PM

Re: MySQL and Nginx mystery

Francis Daly May 06, 2011 05:08PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 262
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready