客户端

环境依赖

  • 插入内核FUSE模
  • 安装libfuse
modprobe fuse
yum install -y fuse

配置文件

fuse.json

{
  "mountPoint": "/cfs/mountpoint",
  "volName": "ltptest",
  "owner": "ltptest",
  "masterAddr": "10.196.59.198:17010,10.196.59.199:17010,10.196.59.200:17010",
  "logDir": "/cfs/client/log",
  "logLevel": "info",
  "profPort": "27510"
}
配置选项
名称 类型 描述 必需
mountPoint string 挂载点
volName string 卷名称
owner string 所有者
masterAddr string Master节点地址
logDir string 日志存放路径
logLevel string 日志级别:debug, info, warn, error
profPort string golang pprof调试端口
exporterPort string prometheus获取监控数据端口
consulAddr string 监控注册服务器地址
lookupValid string 内核FUSE lookup有效期,单位:秒
attrValid string 内核FUSE attribute有效期,单位:秒
icacheTimeout string 客户端inode cache有效期,单位:秒
enSyncWrite string 使能DirectIO同步写,即DirectIO强制数据节点落盘
autoInvalData string FUSE挂载使用AutoInvalData选项
ronly bool 以只读方式挂载,默认为false
writecache bool 利用内核FUSE的写缓存功能,需要内核FUSE模块支持写缓存,默认为false
keepcache bool 保留内核页面缓存。此功能需要启用writecache选项,默认为false
token string 如果创建卷时开启了enableToken,此参数填写对应权限的token
readRate int 限制每秒读取次数,默认无限制
writeRate int 限制每秒写入次数,默认无限制
followerRead bool 从follower中读取数据,默认为false
accessKey string 卷所属用户的鉴权密钥
secretKey string 卷所属用户的鉴权密钥
disableDcache bool 禁用Dentry缓存,默认为false
subdir string 设置子目录挂载
fsyncOnClose bool 文件关闭后执行fsync操作,默认为true
maxcpus int 最大可使用的cpu核数,可限制client进程cpu使用率
enableXattr bool 是否使用*xattr*,默认是false

挂载

执行如下命令挂载客户端:

nohup ./cfs-client -c fuse.json &

如果使用示例的``fuse.json``,则客户端被挂载到``/mnt/fuse``。所有针对``/mnt/fuse``的操作都将被作用于ChubaoFS。

卸载

建议使用标准的Linux umount 命令终止挂载。