Star2Billing / a2billing

A2Billing is a telecom switch and billing system capable of providing and billing a range of telecom products and services to customers such as calling card products, residential and wholesale VoIP termination, DID resale and callback services.
www.asterisk2billing.org
Other
180 stars 174 forks source link

A2Billing can't connect HAProxy as LB for MariaDB Galera Cluster #116

Closed pecuna closed 8 years ago

pecuna commented 8 years ago

Hello! I have a Galera Cluster with several nodes and HAProxy as a loadbalncer using Percona Xtradb cluster for checking status and A2Billing v2.1.4 configured on a different server with nginx. A2billing config is set to use the HAProxy server with port 3377 as this is the port I set in HAProxy config for the frontend bind. In browser I got "Connection failed". If I set any node as dbserver in a2b config It connects and opens the pages. Nginx log says:

" [error] 15090#0: *274281 FastCGI sent in stderr: "PHP message: PHP Warning: mysqli_real_connect(): (42000/1049): Unknown database 'a2billing' in /usr/local/src/a2billing-master/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php on line 121" while reading response header from upstream"

From the web server shell when I execute several times "mysql -uuser -p database -P 3377 -e "SELECT @@hostname" " I can see different db nodes as HAProxy is working correctly from A2billing host. How can I use A2billing with HAProxy for DB loadbalancing?

pecuna commented 8 years ago

I managed to figure it out. The port option is ignored. To make it work the config should be hostname = _ip:port _ and then it works as expected. Please paste that note so everyone could see it if there is no other fix. Thanks!

areski commented 8 years ago

Thanks for sharing! People having the same problem will found this issue on github.