-1

I recieve the following error message when I set up load balancing between two servers that are running the zendframework called "SocialEngine"

As it looks there is a problem that I can't connect twice to my DB-Server, how can I handle this problem?

Fatal error: Uncaught exception 'Zend_Db_Adapter_Mysqli_Exception' with message 'Can't connect to MySQL server on '10.8.160.132' (13)' in /var/www/html/Test12082013SocialEngine/application/libraries/Zend/Db/Adapter/Mysqli.php:352 Stack trace: #0 /var/www/html/Test12082013SocialEngine/application/libraries/Zend/Db/Adapter/Abstract.php(448): Zend_Db_Adapter_Mysqli->_connect() #1 /var/www/html/Test12082013SocialEngine/application/modules/Core/Bootstrap.php(112): Zend_Db_Adapter_Abstract->query('SET time_zone =...') #2 /var/www/html/Test12082013SocialEngine/application/libraries/Engine/Application/Bootstrap/Abstract.php(256): Core_Bootstrap->_initDb() #3 /var/www/html/Test12082013SocialEngine/application/libraries/Engine/Application/Bootstrap/Abstract.php(207): Engine_Application_Bootstrap_Abstract->_executeResource('db') #4 /var/www/html/Test12082013SocialEngine/application/libraries/Engine/Application/Bootstrap/Abstract.php(150): Engine_Application_Bootstrap_Abstract->_bootstrap(NULL) #5 /var/www/html/Test12082013SocialEngi in /var/www/html/Test12082013SocialEngine/application/libraries/Zend/Db/Adapter/Mysqli.php on line 352

EDIT This Error only showns on the second server, the first server can connect properly to the db

2
  • What sort of server is this? Feb 5, 2015 at 16:48
  • @MichaelHampton we are using two servers (one apache and one mySQL db), the zend framework runs on Linux OS Centos 7 Both are decicated cloud hostings in the same firewall zone Feb 5, 2015 at 16:49

1 Answer 1

0

You need to set the appropriate SELinux boolean to allow the web server to communicate with remote databases.

setsebool -P httpd_can_network_connect_db 1
2
  • Okay I will try that, could you explain to me why I need to set this boolean? Because one of the server can actually access the db without problems, how is this caused? Thank you for your explanation Feb 5, 2015 at 17:18
  • We just tested it and one server can connect and the second one shows the error message above. Do you think there could be a configuration problem with the MySQL Server? Feb 6, 2015 at 10:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .