Jan 11, 2018 Setup and configuration of FreePBX HA is done in the FreePBX GUI, which you can use as an online management tool to easily switch between nodes. Our new FreePBX HA Appliances provide out-of-the-box support for FreePBX High Availability (HA) solutions.
Now, on the secondary server, we’ll configure replication from primary to secondary server (remember to use server’s fixed IP address and not the virtual one):mysql slave stop;Query OK, 0 rows affected, 1 warning (0.00 sec)mysql CHANGE MASTER TO MASTERHOST = ' 192.168.143.201', MASTERUSER = 'replicator', MASTERPASSWORD = ' ChangeMePlease!!!!!' , MASTERLOGFILE = ' mysql-bin.000001', MASTERLOGPOS = 254163;Query OK, 0 rows affected (0.03 sec)mysql slave start;Query OK, 0 rows affected (0.00 sec)Still on the secondary server, we’ll get information for setting up secondary to primary replication:mysql show master status; FilePositionBinlogDoDBBinlogIgnoreDBmysql-bin.23asterisk,asteriskcdrdbmysql. Finally, set up replication on the primary server from secondary to primary (remember to use server's fixed IP address and not the virtual one):mysql slave stop;Query OK, 0 rows affected, 1 warning (0.00 sec)mysql CHANGE MASTER TO MASTERHOST = ' 192.168.143.202', MASTERUSER = 'replicator', MASTERPASSWORD = ' ChangeMePlease!!!!!' , MASTERLOGFILE = ' mysql-bin.000001', MASTERLOGPOS = 383123;Query OK, 0 rows affected (0.02 sec)mysql slave start;Query OK, 0 rows affected (0.00 sec)That’s it.
Easy, isn’t it? Now you can go on and configure your installation. FINAL THOUGHTS, NEXT STEPS AND HELPFUL LINKS. Depending on the client used, I’ve got under 5 seconds downtime. Passwords, too open configuration. Please change the passwords stated here.
Also, the configuration can (and should) be thightened. You can configure the whole installation in one server and the configuration will be synchronized at FreePBX level. You must apply changes on the secondary server for Asterisk to notice them (there are workarounds but see next point). If you can afford it (if you need HA, it’s probable you can afford this), please consider purchasing. This way, they get paid so they can go on developing and everyone benefits on the long run (Disclaimer: I have no relation with FreePBX.
I just think they’re developing an amazing piece of software). Recordings, if you use them, they are (still) not synchronized on the filesystem. They get stored on the server which is running in the moment the call is made. You’ll have to set up a synchronization mechanismDid you find the post useful? Would you invite me to a nice coffe or offer some help running the site ad-free?LINKS I USED FOR SETTING EVERYTHING UP keepalivedMySQLAsteriskNov 1, 2016.
Hi againI don’t know this particular SIP client, but as it works with the primary server, it should work just fine. I think the problem might be in the config of the secondary server, but, could you do a little test?Let’s say that for your particular installation:192.168.1.1 is the virtual IP (the one managed by keepalived)192.168.1.2 is the primary server IP192.168.1.3 is the secondary server IPLet’s forget for a moment about virtual IP and keepalived and assume both servers as standalone with the same config. Can you register both phones to 192.168.1.2? (I assume yes from the comment) Modify the config from both clients so now they will only register to 192.168.1.3 Does this work?If the second step doesn’t work, then the problem should be in the config of the secondary server.Login to the secondary server and look for the apply config button on the top of the screen. If it’s not present, make a dummy change (add a dummy extension and delete it, some insignificant change, ) so this button appears. Apply config and try to register the phones again to 192.168.1.3When both phones are able to register to both servers independently, it’s time to take a look at keepalived. Modify the config of both clients so they now register to 192.168.1.1Make it so 192.168.1.1 and 192.168.1.2 are in the same server.
If the clients are not able to register, then it seems that Asterisk is not listening to 192.168.1.1 When the phones register to this interface, make this server fail so now 192.168.1.1 and 192.168.1.3 are in the same server.If the phones are not able to register, the problem seems to be in Asterisk not listening to 192.168.1.1Also, take a look in the log of the secondary server (I don’t recall the exact menu but there’s a link from a FreePBX menu) as it migh give you hints to where the problem is. I’m glad I was helpful. I think I can give you one more hint so it will also work on your PC.Before provoking a failovet, can your PC register on the secondary 192.168.1.3) server? If it can’t, I would recheck the sip configuration on the server.But of it’s able to register, then I would think of a network problem. When the failover happens, the new association of IP address and MAC address can take some time to propagate (it depends on network hardware, and OS and version).Can you check asterisk’s log whether the registration petition arrives. There should appear the extension number.If it doesn’t appear, can you check the contents of the ARP table, before and after the failover?The MAC associated to 192.168.1.1 (cluster IP) should change before and after the failover.
If it remains the same, try to flush the cache. If this fixes the problem, then it would mean it’s almost for sure related to your network configuration.