Table of Contents

Filesystem in Userspace (FUSE), is an open source adoption functionality provided by Google Cloud Storage (GCS). It allows users to access and operate GCS buckets (for backup, extra storage, ...etc) from their Linux or OS X machines.

Step-by-step guide

Prerequisites

  1. The next two steps (2&3) are not needed if you are running your machine on GCE.

  2. Install the Cloud SDK: 'yum install google-cloud-sdk'.

  3. Run gcloud init to get started: 'gcloud init'.

  4. Before invoking gcsfuse, you must have a GCS bucket that you want to mount. If your bucket doesn't yet exist, create one using the Google Developers Console.

  5. Make sure the Google Cloud Storage JSON API is enabled.

  6. GCS credentials are automatically loaded using Google application default credentials, or a JSON key file can be specified explicitly using --key-file. If you haven't already done so, the easiest way to set up your credentials for testing is to run the gcloud tool: 'gcloud auth login'.

  7. Stop your VM in GCE console, once it’s stopped edit the VM and scroll to the bottom the Cloud API access scopes section. Change the storage API to full access. (stopping the VM is important, you need to reboot for the fstab config to take affect and properly mount, also you must allow full access to the storage api).

  8. Start the VM.

Installing Cloud Storage FUSE and its dependencies

The following instructions set up  yum  to see updates to gcsfuse.

sudo tee /etc/yum.repos.d/gcsfuse.repo > /dev/null <<EOF

[gcsfuse]

name=gcsfuse (packages.cloud.google.com)

baseurl=https://packages.cloud.google.com/yum/repos/gcsfuse-el7-x86_64

enabled=1

gpgcheck=1

repo_gpgcheck=1

gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg

       https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg

EOF

Be sure to answer "yes" to any questions about adding the GPG signing key.

Be sure to answer "yes" to any questions about adding the GPG signing key.

Future updates to gcsfuse will automatically show up when updating with  yum .

Using Cloud Storage FUSE

'mkdir /path/to/mount'

'gcsfuse example-bucket /path/to/mount'

'ls /path/to/mount'

'nano /etc/fstab'

'example-bucket /var/spool/asterisk/cloud gcsfuse rw,allow_other,file_mode=777,dir_mode=777'

'cd /path/to/mount'

'mkdir test'

'touch testfile'

[Tip] Change Call Recording Location:

Settings >> Advanced Settings

 

References

  1. https://community.freepbx.org/t/gcsfuse-freepbx-freepbx-is-unable-to-write-to-folder-mounted-with-gcsfuse-and-the-sync-stops/62802

  2. https://cloud.google.com/storage/docs/gcs-fuse

  3. https://github.com/GoogleCloudPlatform/gcsfuse/

Page: [How-to] Install & Secure FreePBX Distro (with commercial modules) on Google Compute Engine

Page: [How-to] Mount Google Cloud Storage Bucket to (FreePBX) Instance as a File System