nfs-ganesha使用


一 nfs-ganesha在centos7上安裝

yum -y install centos-release-gluster
yum install -y nfs-ganesha.x86_64
yum install -y nfs-ganesha-vfs.x86_64
yum install -y nfs-ganesha-proxy.x86_64

通過以上命令就可成功安裝了。

systemctl start nfs-ganesha.service 啟動服務

 

二 使用dbus命令動態更新nfs-ganesha配置


 

To add export:

dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.AddExport string:/path-to-new-export-file string:"EXPORT(Path=/volname)"
ex:

dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.AddExport string:/etc/ganesha/test.conf string:"export(path=/opt/testnfs)"

dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.AddExport string:/etc/ganesha/test.conf string:"export(export_id=3)"


To remove export:
dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.RemoveExport uint16:export_id

ex:

dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.RemoveExport uint16:3


 

To update export:

dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.AddExport string:/path-to-new-export-file string:"EXPORT(Path=/volname)"

dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.AddExport string:/path-to-new-export-file string:"EXPORT(export_id=uint16)"

ex:

dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport string:/etc/ganesha/test.conf string:"export(path=/opt/testnfs)"
method return time=1552554389.002397 sender=:1.263 -> destination=:1.282 serial=593 reply_serial=2
   string "1 exports updated"

dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport string:/etc/ganesha/test.conf string:"export(export_id=3)"
method return time=1552554430.929315 sender=:1.263 -> destination=:1.283 serial=636 reply_serial=2
   string "1 exports updated"


 

https://github.com/nfs-ganesha/nfs-ganesha/wiki/DBusExports


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM