Fusion on Google Cloud Compute or AWS

Status
Not open for further replies.

smn

Member
Jul 18, 2017
201
20
18
Instead of using redundant servers and all that entails, has anyone tried running using NFS using something like Google Cloud Compute? I am wondering how well the DB works on a busy server since NFS is inherently slower than local hard drives. It seems to me that would be a good way to do redundancy instead of using multiple servers. With Google Cloud Compute, you are already fairly redundant within the zone in the datacenter. If your server hardware crashes or they are doing maintenance, a reboot will automatically put you on different hardware. In the unlikely event the NFS in the datacenter zone crashes, you can switch to an NFS in another zone or even another datacenter if you set it up to replicate.

I don't use AWS but I believe you can do similar things with them as well. I know they both have Cloud PostGreSQL services that are also inherently redundant, They are kind of expensive when you add it all up so I dropped that idea.
 
Last edited:

yukon

Member
Oct 3, 2016
138
14
18
I run fully in AWS and put my sql server in the RDS service. Works great so far.
 

smn

Member
Jul 18, 2017
201
20
18
I run fully in AWS and put my sql server in the RDS service. Works great so far.
What does RDS end up costing you per month for something usable? Not just the bare minimum starter plan. I know that Google charges a lot for using their equivalent service and as you require more compute power and more storage the costs start to skyrocket.
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,038
556
113
The ideal setup is multiple servers with a shared DB just like you would a regular cluster but it becomes expensive.

Amazon Lightsail on the other hand gives you this but very cheaply.
 

smn

Member
Jul 18, 2017
201
20
18
The ideal setup is multiple servers with a shared DB just like you would a regular cluster but it becomes expensive.

Amazon Lightsail on the other hand gives you this but very cheaply.
Lightsail is an interesting product. The billing is much more simplified which I really like. Adding a managed high availability database kills the price advantage though. There is no getting around that if you want to use managed SQL cloud database services.
 
Last edited:

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,038
556
113
Lightsail is an interesting product. The billing is much more simplified which I really like. Adding a managed high availability database kills the price advantage though. There is no getting around that if you want to use managed SQL cloud database services.

And you need the ha db because? I've just clustered two instances with BDR. Same region, different availability zones, works like a charm.
 

smn

Member
Jul 18, 2017
201
20
18
And you need the ha db because? I've just clustered two instances with BDR. Same region, different availability zones, works like a charm.
I don't want to deal with doing the clustering myself. Seems the only 2 options are that or paying for the managed service.
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,038
556
113
Just pointing at a single db does not a cluster make, what about call recordings, voicemail amongst other things.
 

smn

Member
Jul 18, 2017
201
20
18
Just pointing at a single db does not a cluster make, what about call recordings, voicemail amongst other things.
We seem to be having 2 different conversations. I understand how databases and clustering work so not sure what you are trying to say. All I am trying to say is that it would be nice if I could use a managed cloud plan that did a lot of that redundancy and management for me. I am aware I can cluster DB's myself but with limited resources and time I would rather not if at all possible.
 
Last edited:

gflow

Active Member
Aug 25, 2019
261
28
28
We seem to be having 2 different conversations. I understand how databases and clustering work so not sure what you are trying to say. All I am trying to say is that it would be nice if I could use a managed cloud plan that did a lot of that redundancy and management for me. I am aware I can cluster DB's myself but with limited resources and time I would rather not if at all possible.
You can just use something like Amazon RDS "Amazon RDS provides high availability and failover support for DB instances using Multi-AZ deployments" point your FusionPBX servers to that.

Also you could use EFS on Amazon as your NFS its more than double the price of EBS but you also get Multi-AZ redundancy and also unlimited storage, you only pay for what you use.
 

atmosphere617

Member
May 19, 2018
31
4
8
I am also using RDS without issues for several years in a fairly large deployment with multiple freeswitch servers. I'd definitely recommend this.

As far as filesystem goes I went a different route, I moved everything off the filesystem and into s3(recodings, voicemail files, etc). I use mod_http_cache to download these files and I have a separate web service handles http_put requests which uploads these files to s3. With a little bit of tweaking the code this can work pretty seemlessly in fusion.

The freeswitch "file format" api allows you to just drop a URL into any place you would have otherwise put a local filesystem path and if mod_http_cache is loaded it will automagicilly call the correct method based on the application being invoked.

For example:
"<action application="playback" data="https://some_s3_server/file.mp3"/>"
Would make a GET request to that URL.

"<action application="record_session" data="https://my_web_server.com/upload_2_s3/filename.mp3"/>"
Would trigger and http_put to that URL.

You can also setup a "VPC endpoint" inside your VPC to authorize all http requests to s3 from your freeswitch VM.
 
Last edited:

abelitouci

Member
Jul 3, 2019
31
6
8
Houston, Texas
I run fully in AWS and put my sql server in the RDS service. Works great so far.
HI @yukon , I have the same scenario, 2 FS servers pointing to the same RDS database, the problem i'm having is setting up the ext-rtp-ip and ext-sip-ip where i have the public IP for one instance but i need the other server to have a different IP value there, did you figure out how to resolve this?
Thank you
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,038
556
113
@abelitouci

In your autoload_configs/sofia.conf.xml:

add a line similar to the following, I use this for lightsail, exactly the same scenario

Code:
<X-PRE-PROCESS cmd="include" data="../local_vars.xml"/>

Then create a file in /etc/freeswitch called local_vars.xml

In it put:

Code:
<X-PRE-PROCESS cmd="set" data="aws_external_ip_v4=X.X.X.X" />

where X.X.X.X is your public IP

Then in your profiles for external-rtp-ip etc put:

Code:
$${aws_external_ip_v4}

Happy days :D
 
  • Love
Reactions: ardyhash

abelitouci

Member
Jul 3, 2019
31
6
8
Houston, Texas
I am also using RDS without issues for several years in a fairly large deployment with multiple freeswitch servers. I'd definitely recommend this.

As far as filesystem goes I went a different route, I moved everything off the filesystem and into s3(recodings, voicemail files, etc). I use mod_http_cache to download these files and I have a separate web service handles http_put requests which uploads these files to s3. With a little bit of tweaking the code this can work pretty seemlessly in fusion.

The freeswitch "file format" api allows you to just drop a URL into any place you would have otherwise put a local filesystem path and if mod_http_cache is loaded it will automagicilly call the correct method based on the application being invoked.

For example:
"<action application="playback" data="https://some_s3_server/file.mp3"/>"
Would make a GET request to that URL.

"<action application="record_session" data="https://my_web_server.com/upload_2_s3/filename.mp3"/>"
Would trigger and http_put to that URL.

You can also setup a "VPC endpoint" inside your VPC to authorize all http requests to s3 from your freeswitch VM.

@abelitouci

In your autoload_configs/sofia.conf.xml:

add a line similar to the following, I use this for lightsail, exactly the same scenario

Code:
<X-PRE-PROCESS cmd="include" data="../local_vars.xml"/>

Then create a file in /etc/freeswitch called local_vars.xml

In it put:

Code:
<X-PRE-PROCESS cmd="set" data="aws_external_ip_v4=X.X.X.X" />

where X.X.X.X is your public IP

Then in your profiles for external-rtp-ip etc put:

Code:
$${aws_external_ip_v4}

Happy days :D
@DigitalDaz you are the best! this is exactly what i was trying to accomplish.
as always thanks for your help.
 

agile

New Member
Oct 21, 2020
27
2
3
42
@abelitouci

In your autoload_configs/sofia.conf.xml:

add a line similar to the following, I use this for lightsail, exactly the same scenario

Code:
<X-PRE-PROCESS cmd="include" data="../local_vars.xml"/>

Then create a file in /etc/freeswitch called local_vars.xml

In it put:

Code:
<X-PRE-PROCESS cmd="set" data="aws_external_ip_v4=X.X.X.X" />

where X.X.X.X is your public IP

Then in your profiles for external-rtp-ip etc put:

Code:
$${aws_external_ip_v4}

Happy days :D
I had the same problem Daz thanks for the process.
Every time I test failover of the secondary node the IP in the ext-rtp-ip and ext-sip-ip is still for the primary node as I had manually change it to be primary node IP. So I was thinking I might need to manually change it which defies the purpose of automated failover?

surprisingly on my failover tests, I was still able to get audio without any problem and I have tested this couple of time even with Power-off my primary node.
Not sure how the secondary server is allowing audio through when the IP it holds on ext-rtp-ip and ext-sip-ip is from the primary server.
but this configuration will make sure it always see the correct Public ip-address, on both Primary and Secondary servers.


Update - I had to do the above setup as after clearing cache and acl the voice stopped. so it's important to get the public ip address on local server on the ext-rtp-ip and ext-sip-ip ... just one question where is the file?
autoload_configs/sofia.conf.xml - what is the location of sofia.conf.xml can any one advice ?


Thank you again.
 
Last edited:

agile

New Member
Oct 21, 2020
27
2
3
42
@abelitouci

In your autoload_configs/sofia.conf.xml:

add a line similar to the following, I use this for lightsail, exactly the same scenario

Code:
<X-PRE-PROCESS cmd="include" data="../local_vars.xml"/>

Then create a file in /etc/freeswitch called local_vars.xml

In it put:

Code:
<X-PRE-PROCESS cmd="set" data="aws_external_ip_v4=X.X.X.X" />

where X.X.X.X is your public IP

Then in your profiles for external-rtp-ip etc put:

Code:
$${aws_external_ip_v4}

Happy days :D



Update - this is how I got this to work using an alternate method.

Hey guys I got this to work using the following I have Failover setup on AWS using RDS. I found this is the easiest way to setup up the public IP using the curl command curl -s http://instance-data/latest/meta-data/public-ipv4

https://freeswitch.org/confluence/display/FREESWITCH/Amazon+EC2

/etc/freeswitch

Edit vars.xml

conf/vars.xml

<X-PRE-PROCESS cmd="exec-set" data="bind_server_ip=curl -s http://instance-data/latest/meta-data/public-ipv4"/>
<X-PRE-PROCESS cmd="exec-set" data="external_rtp_ip=curl -s http://instance-data/latest/meta-data/public-ipv4"/>
<X-PRE-PROCESS cmd="exec-set" data="external_sip_ip=curl -s http://instance-data/latest/meta-data/public-ipv4"/>

after that's done. Dont forgot to put the default value back and test.
Set the value of sip profile external and internal back to default

$${external_rtp_ip}

In the Sip profiles

External sip profile
ext-rtp-ip /ext-sip-ip set it to $${external_rtp_ip} if its not set already

Internal sip profiles

ext-rtp-ip /ext-sip-ip set it to $${external_rtp_ip} if its not set already

I am running a Failover setup on AWS when I failover node A the node be stated picking up the correct elastic IP address and I can hear the voice.
in my setup when i bring node A back online the traffic automatically redirects to node A and all the phones get re-registered. However, the good news is if we have calls going on they do not drop they continue on the Node B.
 
Last edited:
Status
Not open for further replies.