PDA

View Full Version : NFS - serving big data from remote server on local server?



Fli
11-02-2014, 05:06 PM
I was curious if i can use a VPS with small HDD to serve large videos from folder on an remote server. And it appears it is possible thanks to SSHFS (http://internetlifeforum.com/linux-forums/1378-easy-sshfs-tutorial-mounting-remote-server-folder-local-folder/) or NFS (http://www.tecmint.com/how-to-setup-nfs-server-in-linux/) (there can be obstacles if you're using an outdated OpenVZ virtual server).

Following is about NFS, other mentioned method is under link above.

WARNING: plain NFS is insecure unencrypted (https://www2.cs.siu.edu/~cs491-2/projects/tzigler-snfs.pdf) there is possibly more secure workaround (http://www.crufty.net/ftp/pub/sjg/help/sNFS.html), but the throughput is claimed to be very low, possibly better to use above linked $$HFS which should have similar throughput (https://blog.ja-ke.tech/2019/08/27/nas-performance-sshfs-nfs-smb.html#conclusion) like original NFS..

NFS installation on the client and on the server:
deb: sudo apt install nfs-common
arch: sudo pacman install nfs-utils
rhel: yum install nfs-common (says: "No package nfs-common available."? try: yum groupinstall "Network file system client" )

If you want some new features in NFS, you may consider more complicated setup described here (https://github.com/zilexa/Homeserver/tree/master/network%20share%20(NFSv4.2)). We continue here with most simple setup:


just use NFS

mkdir OTHERSERVER
mount -t nfs IP_OTHERSERVER:/path/to/folder OTHERSERVER

also, you need to install nfs-server on OTHERSERVER and edit /etc/exports file

Source: http://www.linuxforums.org/forum/servers/202229-how-symlink-directory-other-server-ip.html#post954743

ERRORS?
mount: unknown filesystem type 'nfs' - Try to install nfs: sudo apt install nfs-common" (or yum install nfs-common ?)
mount.nfs: No such device - Try "modprobe nfs", if it show error like FATAL: Module nfs not found in directory /lib/modules/..., you may duck.com it or if you are on a VPS (OpenVZ), you can ask physical server admin to run that command to enable nfs kernel module.

there is more detailed tutorial: http://www.tecmint.com/how-to-setup-nfs-server-in-linux/