- Developer Zone
- Customers & Industries
You may want to mount an NFS drive if you are recording files, so that multiple origins can share the same storage target.
sudo apt-get install nfs-common
Once you have installed the NFS service, you should test the connection.
sudo mount 10.126.192.250:/red5profileshare /usr/local/red5pro/webapps/live/streams
10.126.192.250 is the IP address of your Filestore instance, and
red5profileshare is the fileshare name that you configured above.
To verify that the filesystem is mounted, run
df -h and you should see the path listed at the bottom, for example:
Filesystem Size Used Avail Use% Mounted on udev 3.7G 0 3.7G 0% /dev tmpfs 748M 8.6M 739M 2% /run /dev/sda1 16G 2.1G 14G 14% / tmpfs 3.7G 0 3.7G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 3.7G 0 3.7G 0% /sys/fs/cgroup tmpfs 748M 0 748M 0% /run/user/1001 10.126.192.250:/red5profileshare 1007G 76M 956G 1% /usr/local/red5pro/webapps/live/streams
GCP doesn't seem to have the same
user_data option as AWS, but you can add the NFS mount to your node image via CronTab.
Create a script (
nfsmount.sh) in a root-owned directory to reference via the crontab. For example:
NFS Startup Mount Sample Script:
local/red5pro/webapps/live/streams sudo mount 10.126.192.250:/red5profileshare /usr/local/red5pro/webapps/live/streams sudo chmod go+rw /usr/local/red5pro/webapps/live/streamssudo mkdir /usr/
Make the script executable:
sudo chmod +x /usr/local/nfsmount.sh
Now edit the crontab
sudo crontab -e
And add the following line:
You can test this script by rebooting the VM (
sudo reboot). Then ssh into the instance after it restarts to verify that the drive is mounted.
After you have verified, create an image from this node as per these steps