I have a new drupal site running behind a load balancer. I've got one master slave set up with the database and another that syncs files from the web dir.
For the remote slave, I've got ENV vars setup for the database host, which is the INTERNAL IP of the master slave holding the database. This works fine as the master has this too with it's ENV var being 'localhost'
Now, when accessing the site, getting put on the master slave works fine. But when hitting the remote slave I get the database error from Drupal :
PDOException: SQLSTATE[HY000] [2002] Can't connect to local MySQL
server through socket '/var/lib/mysql/mysql.sock' (2) in
lock_may_be_available() (line 167 of /var/www/html/includes/lock.inc).
I've run the regular GRANT commands for the remote slave and I can connect over SSH from the slave machine using
mysql -u root -p -h master.slave.internal.ip
So from what I can tell it's not a firewall or mysql permissions issue, I'm stumped! :(
Big beer coming someones way, as I'm left scratching my head.