一 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

相关文章:

  • 2022-12-23
  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-12
  • 2022-02-25
猜你喜欢
  • 2021-11-30
  • 2021-10-08
  • 2021-08-17
  • 2021-08-21
  • 2021-12-21
  • 2022-12-23
  • 2022-03-03
相关资源
相似解决方案