NFS

From Alessandro's Wiki
Revision as of 22:09, 10 September 2015 by Xunil (talk | contribs) (→‎NFSometer)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Nfs, Network File System serve per condividere dati tra due o + computer in rete, con linux naturalmente. E`molto potente ma ha degli svantaggi, pochi in realtà.

Export

  • Nel mio caso ho bisogno di accedere a risorse del computer della camera da quello della cucina:
  • Esporterò le seguenti directory:
  1. /export
  • Modifico il file /etc/exports per dire a NFS di espoortare queste directory a chi e come:
vi /etc/exports
  • Aggiungo le seguenti linee:
/export/                192.168.1.251(rw,async,no_root_squash)
  • la formattazione è Directory | ip/domain/hostname(opzione,opzione,...)
  • rw dal client sarà possibile scrivere nella directory
  • sync tutte le operazioni di scrittura vengono eseguite in modo sincrono
  • no_root_squash vuoldire che se dal client monto la partizione e cerco di modificare qualche file come root, il root del server viene mappato con il root del client
  • Ricarico file di configurazione:
/etc/init.d/nfs reload
  • reload the exports table
exportfs -ra
  • Ora dal client sarà possibile montare la partizione in questo modo:
mkdir /mnt/remote_export
mount -t nfs -o rw,users elwood:/export /mnt/remote_export
  • ls -la /mnt/remote_export
  • check open ports:
 rpcinfo -p | awk -F " " '{print $3 ", " $4 ", " $5}' | sort | uniq

Configuration

  • In Gentoo
    • File di configurazione generale
/etc/conf.d/nfs
  • Directory attualmente esportate:
elwood ~ # exportfs
/export         zombie

From the Client

  • show remote mounts
showmount -e <hostname>

ubuntu

  • to allow the system to mount a NFS share, you need to install:
apt-get install nfs-common

Benchmarks

NFSometer

  • deps
apt-get install python-numpy python-setuptools python-matplotlib python-mako
yum  install numpy python-setuptools python-matplotlib python-mako -y       
# ./nfsometer.py workloads
> Using results directory: /root/nfsometer_results
Available workloads:
  cthon
  dd_100m_100k
  dd_100m_1k
  gitclone
  kernel
  python
Unavailable workloads:
  bonnie++             - binary 'bonnie++' not found,
  custom               - env variable 'NFSOMETER_CMD' not defined,
  filebench_fileserver - binary 'filebench' not found, file '/usr/share/filebench/workloads/fileserver.f' not found,
  filebench_networkfs  - binary 'filebench' not found, file '/usr/share/filebench/workloads/networkfs.f' not found,
  filebench_varmail    - binary 'filebench' not found, file '/usr/share/filebench/workloads/varmail.f' not found,
  filebench_webserver  - binary 'filebench' not found, file '/usr/share/filebench/workloads/webserver.f' not found,
  iozone               - binary 'iozone' not found,
  iozone_direct        - binary 'iozone' not found,