High Availability Failover

I think that last weekend the mysql service migrated from freepbx-a to freepbx-b or maybe it’s been that way for a long time. Here is the current status:

Cluster name: freepbx-ha
Last updated: Fri Jan 27 14:13:22 2017
Last change: Fri Jan 27 14:03:21 2017 via cibadmin on freepbx-a
Stack: cman
Current DC: freepbx-b - partition with quorum
Version: 1.1.11-97629de
2 Nodes configured
24 Resources configured

> Online: [ freepbx-a freepbx-b ]

> Full list of resources:

>  spare_ip	(ocf::heartbeat:IPaddr2):	Started freepbx-b 
>  floating_ip	(ocf::heartbeat:IPaddr2):	Started freepbx-a 
>  Master/Slave Set: ms-asterisk [drbd_asterisk]
>      Masters: [ freepbx-a ]
>      Slaves: [ freepbx-b ]
>  Master/Slave Set: ms-mysql [drbd_mysql]
>      Masters: [ freepbx-b ]
>      Slaves: [ freepbx-a ]
>  Master/Slave Set: ms-httpd [drbd_httpd]
>      Masters: [ freepbx-a ]
>      Slaves: [ freepbx-b ]
>  Master/Slave Set: ms-spare [drbd_spare]
>      Masters: [ freepbx-b ]
>      Slaves: [ freepbx-a ]
>  spare_fs	(ocf::heartbeat:Filesystem):	Started freepbx-b 
>  Resource Group: mysql
>      mysql_fs	(ocf::heartbeat:Filesystem):	Started freepbx-b 
>      mysql_ip	(ocf::heartbeat:IPaddr2):	Started freepbx-b 
>      mysql_service	(ocf::heartbeat:mysql):	Started freepbx-b 
>  Resource Group: asterisk
>      asterisk_fs	(ocf::heartbeat:Filesystem):	Started freepbx-a 
>      asterisk_ip	(ocf::heartbeat:IPaddr2):	Started freepbx-a 
>      asterisk_service	(ocf::heartbeat:freepbx):	Started freepbx-a 
>  Resource Group: httpd
>      httpd_fs	(ocf::heartbeat:Filesystem):	Started freepbx-a 
>      httpd_ip	(ocf::heartbeat:IPaddr2):	Started freepbx-a 
>      httpd_service	(ocf::heartbeat:apache):	Started freepbx-a 
>  fence_b	(stonith:fence_ipmilan):	Started freepbx-a 
>  fence_a	(stonith:fence_ipmilan):	Started freepbx-b 
>  Clone Set: ClusterMon-SMTP-clone [ClusterMon-SMTP]
>      Started: [ freepbx-a freepbx-b ]

Be that as it may; i’m getting the following error in the asterisk console:

[2017-01-27 14:08:41] ERROR[48283][C-0000da4f]: cdr_mysql.c:203 mysql_log: Cannot connect to database server localhost: (2002) Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Thoughts? Thanks in advance.

I don’t know how your database and PBX are set up, but the error message kind of says it all. The MySQL server on the machine hosting your PBX is not responding. My guess is that either the mysql server isn’t successfully starting or the CDRDB database in Asteriskcdrdb is broken.

My PBX is an HA cluster with the commercial HA module, freepbx-a and freepbx-b running on identical hardware.

It seems that the MySQL server is running just fine; on the other PBX though. I’m wondering if i should just standby freepbx-b to force MySQL to freepbx-a or if that would cause more issues?