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