命令参考
在终端输入 juicefs 并执行,就能看到所有可用的命令。在每个子命令后面添加 -h/--help 并运行,就能获得该命令的详细帮助信息,例如 juicefs mount -h。
NAME:
juicefs - A POSIX file system built on object storage.
USAGE:
juicefs [global options] command [command options]
VERSION:
5.3.7 (2026-04-22 58af72b)
COMMANDS:
help, h Shows a list of commands or help for one command
ADMIN:
auth Authorize a volume
destroy Destroy an existing volume
gc Garbage collector of objects in data storage
fsck Check consistency of a volume
dump Dump metadata into a JSON file
load Load metadata from a previously dumped JSON file
version Show version
quota Manage directory quotas
heal Heal a replicated volume
restore restore files from trash
INSPECTOR:
status Show status of a volume
stats Show real time performance statistics of JuiceFS
profile Show profiling of operations completed in JuiceFS
info Show internal information of a path or inode
summary Show data and files distribution of a directory
debug, doctor Collect and display system static and runtime information
lsof List open files
SERVICE:
mount Mount a volume
umount Unmount a volume
gateway Start an S3-compatible gateway
webdav Start a WebDAV server
TOOL:
attr Manage attributes for files and directories
bench, benchmark Run benchmarks on a path
objbench Run benchmarks on an object storage
warmup Build cache for target directories/files
clone, snapshot Clone a file/directory without copying data
rmr Remove directories recursively
sync Sync between two storages
import Import existing files from object storage
merge merge files together without copying.
find find files with predicates and actions
grep parallelized file pattern searcher
compact Trigger compaction of chunks
GLOBAL OPTIONS:
--verbose, --debug, -v enable debug log (default: false)
--quiet, -q show warning and errors only (default: false)
--trace enable trace log (default: false)
--trace-file value write runtime trace to a file (use 'go tool trace' to analyze)
--no-agent disable pprof (:6060) agent (default: false)
--pyroscope value pyroscope address
--no-color disable colors (default: false)
--help, -h show help
--version, -V print version only (default: false)
全局选项
| 项 | 说明 |
|---|---|
-q --quiet | 仅显示警告及错误日志。 |
-v --verbose --debug | 开启调试日志。 |
--trace | 开启比 --debug 选项更详细的调试日志。 |
--no-agent | 关闭 pprof 代理。 |
--pyroscope | 配置 Pyroscope 地址,如 http://localhost:4040。 |
--no-color | 关闭日志的颜色。 |
管理
juicefs auth
向 JuiceFS Web 控制台发起认证并获取文件系统的配置。配置文件会保存为 $HOME/.juicefs/$VOL_NAME.conf。该命令的常见使用场景:
- 大量节点需要挂载时,直接运行
juicefs mount会遇到交互式录入,不方便自动化。因此用juicefs auth命令提前认证、获取配置文件。可以参考「自动化部署」; - 如果对象存储的认证信息(Access Key、Secret Key)或者存储桶本身发生变化,也需要重新运行
juicefs auth,更新相关信息。比方说对象存储桶迁移到了其他区域,或者变更了对象存储供应商,客户端都需要更新配置; - 私有部署元数据节点 IP 或者控制台地址发生变更,也需要用
juicefs auth重新认证、获取新的配置。大部分迁移变更操作都是平滑的,因此只需要更新客户端配置文件即可,并不需要重新挂载(需要根据具体执行计划,咨询 Juicedata 工程师); - 对于 CSI 驱动场景,如果元数据服务、对象存储、私有控制台的服务地址发生了变更,则需要更新「文件系统认证信息」,CSI 驱动会自动运行
juicefs auth,更新客户端的配置文件缓存。
概览
juicefs auth NAME [options]
juicefs auth myjfs --token xxx --access-key xxx --secret-key xxx
参数
| 项 | 说明 |
|---|---|
NAME | 文件系统的名字。 |
--token=TOKEN | 文件系统的 Token,在网站控制台的文件系统设置中查看。 |
--bucket=BUCKET | 在文件系统创建之初,对象存储桶已经在控制台设置好了。但如果有需要,可以使用该参数覆盖桶设置,比如因为网络环境不同,某些客户端需要使用特定的对象存储服务地址。 和控制台的文件系统的桶设置一样,该参数既可以填写桶名,也可以填写完整 endpoint(以 https:// 或 http:// 开头),这两种填写方法的区别如下:
|