[Tutorial] Creating a two node FusionPBX cluster the easy way.

Status
Not open for further replies.

PoolPro2017

New Member
Dec 14, 2017
3
0
1
57
Hey @DigitalDaz thanks for this post, Great work. i do have a few questions before i start testing this.
  1. How would one use the Master repository say version 4.3?
  2. are sessions transferred if you loose a server, Does the call get lost?
  3. Would we still need to run the Csync2 after performing the above instructions?, And will this also work for fail-over provisioning.
Once again thanks for your all your hard work.
 
Last edited:

yaboc

New Member
Nov 23, 2017
10
2
3
33
@DigitalDaz

is 2 node install easily upgrade able (fusionpbx and freeswitch)? if so will there be upgrade script ? can freeswitch packages be upgraded from the OS with apt-get update/upgrade without breaking the cluster ?
Thanks
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,068
576
113
With respect guys, get testing and find out. I will be far more encouraged to develop this further if I feel people are helping rather than expecting me to provide them a complete solution on a plate that they cannot even bother to test and help a little bit.
 
  • Like
Reactions: c0reM
Sep 2, 2017
46
2
8
I'm upgrading my test cluster this evening. I plan on taking a snapshot of both nodes, then installing the update on node 1 then node 2. I'll report my findings.
 
Sep 2, 2017
46
2
8
Getting the following error on the secondary node when entering the Advanced->Upgrade menu:

Warning: Invalid argument supplied for foreach() in /var/www/fusionpbx/core/upgrade/index.php on line 256

The code:

foreach($_SESSION["response"] as $part => $response){
echo "<b>". $text["label-results"]." - ".$text["label-${part}"]."</b>";
echo "<br /><br />";
if (is_array($response)) {
echo "<pre>";
echo implode("\n", $response);
echo "</pre>";
}
else {
echo $response;
}
echo "<br /><br />";
}
unset($_SESSION["response"]);

It does let me run all the upgrade steps -- it just shows this error.

Any ideas?
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,068
576
113
Do you check each box individually and run through them all and does it happen if you run through it multiple times?

That looks like its just for print out the response messages so it is possibly harmless and will fix once the update is completed.
 

yaboc

New Member
Nov 23, 2017
10
2
3
33
thanks dudeinmyrtlebeach and digidaz. dudeinmyrtlebeach did u try to upgrade freeswitch packages (apt-get upgrade)? im checking with my vps host if i they can snapshot my 2nd node before i attempt this upgrade. my main is on proxmox so i can do it on my own.
 
Sep 2, 2017
46
2
8
I'm running 4.35 as of now. I get the message when I enter Advanced->Upgrade, or when I execute restore Menu Defaults or restore Permission Defaults. I get no messages or errors whatsoever on the primary node.

I'm thinking that it's not a good idea to deploy a live system on the Master branch... Is that a fair assumption? The only reason that I am attempting it is that there are provisioning templates that I need in the Master branch that aren't there in stable -- and I don't know enough about Fusion (yet) o_O to know if I can just use your 2-node installer then copy the updated provisioning templates.

@yaboc, I did upgrade freeswitch.
 

Baulder

New Member
Jul 17, 2017
18
1
3
Russia, Siberia
I am installed two node FusionPBX cluster according your manual. I discovered that pg_hba.conf doesn't define access settings for PostgreSQL database. This PostgreSQL allow access of user postgres from any host and no password!

I created new user, added string
host all all 10.77.0.0/24 md5
to pg_hba.conf and reloaded postgresql service. After that I tried to get access to DB but was failed. I tried other users like fusionpbx and freeswitch but all I got the error:

> psql -h 10.77.0.88 -U freeswitch -d fusionpbx psql: FATAL: no pg_hba.conf entry for host "10.77.0.88", user "freeswitch", database "fusionpbx", SSL on FATAL: no pg_hba.conf entry for host "10.77.0.88", user "freeswitch", database "fusionpbx", SSL off

How can I restrict access to PostgreSQL databases cluster setup?
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,068
576
113
Hmm.. cannot understand how you did that because I moved the repo a couple of days ago and I haven't fixed the links yet, I will do this today. The script definitely deals with the postgres though. There is absolutely not a way in this world it allows postgres from anywhere without password, in fact, as far as I remember it does not touch the postgres user at all except for replication.
 

Baulder

New Member
Jul 17, 2017
18
1
3
Russia, Siberia
cannot understand how you did that because I moved the repo a couple of days ago
I installed cluster at Sep 7, 2017. I restricted access to hosts by iptables and doesn't care about access to Postgres. Now I have to get requests to DB directly to make some analysis about PBX usage. I allowed access to cluster hosts for some hosts in my LAN. All other history I told one post ago.
 

Baulder

New Member
Jul 17, 2017
18
1
3
Russia, Siberia
pg_hba.conf:
local all postgres peer local all all trust host all all 127.0.0.1/32 trust host all all ::1/128 trust host fusionpbx fusionstat 10.77.0.0/24 md5 host all all 10.77.0.0/24 md5 host replication postgres 10.77.0.86/32 trust host all postgres 10.77.0.86/32 trust host replication postgres 10.77.0.87/32 trust host all postgres 10.77.0.87/32 trust host replication postgres 10.77.0.88/32 trust host all postgres 10.77.0.88/32 trust

10.77.0.86, 10.77.0.88 - IPs of node1 and node2 of cluster, 10.77.0.87 - current IP address of master node.
 

Kenny Riley

Active Member
Nov 1, 2017
243
39
28
37
Hi Daz

I got my cluster installed from your video, thank you! One thing I noticed, when I register an extension, it's only registering on the first node and not showing a registration on the 2nd node. Additionally when I have an active call, I only see it on the first node as you did in your video.

What do I need to do on my end to correct this?

Also, how is everyone handling the actual failover? Are you creating DNS SRV records for each of your domains to do this?
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,068
576
113
@Kenny Riley That is by design. We don't replicate the Freeswitch db so it is much lighter. It can only work in active/passive anyway so there is no point.

As to DNS SRV it completely depends on how you are doing the rep. If its same datacenter you could use a floating IP
 

smn

Member
Jul 18, 2017
201
20
18
Just wanted to say thanks for putting this up. I hope you do another video like this with setting up multiple boxes with Kamailio! Nothing makes my eyes glaze over more than looking at kamailio configs.

I grudingly use Kamailio out of necessity. The config files are kind of alien and different to everything else. It does not improve over time. Been several years now and I still get a headache everytime I look at Kamailio config files. Most config files ignore "#" at the start of a comment line but for whatever reason they decided that one # would be actively interpreted syntax. The documentation is a bit weird too. It's like the developer(s) is/are from another planet.
 
Last edited:

fortissimus

New Member
Jan 15, 2017
3
0
1
123
I followed the tutorial and deployed a 2-node cluster with success. All has been working as advertised. Thank you.
However, I have noticed pattern and am hoping anyone might have some pointer here.
Disc usage on Master node has been increasing faster than Slave Node. I currently Node 1(Master) is using 51% of disc space while Node 2 (slave) is only using 18%. HDD is configured for 100 GB on each node.
Upong looking further, I find this folder filling up rapidly /var/lib/postgresql/9.4/main/pg_xlog with what appears to be cluster transaction logs similar to this 000000010000000900000061 with each file weighting about 16MB in size.

Node 1: is hording about 31 GB of pg_xlog while Node 2 only have 1GB of these around

Can I simply delete old logs and move on or there's a much clever way of doing it? Shouldn't these logs purge themselves once no longer relevant? Anything I'm doing (or have done) wrong?

I must add that both nodes receives a somewhat equal amount of traffic/registration as I have placed a kamailio in front to balance the load.
 
Last edited:

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,068
576
113
Are you sure your BDR is functioning correctly? Those folders on mine are very small and more or less the same size
 
Status
Not open for further replies.