JuiceFS S3 Gateway
From 4.9 and above, JuiceFS Client provides the
juicefs gateway subcommand to enable an S3 compatible RESTful APIs for file system access. Currently clients like s3cmd, AWS CLI and MinIO Client and S3 SDK for various programming languages are supported for accessing JuiceFS.
Before deploying the S3 gateway, you need to authenticate against the Web Console using the
auth command, this command will fetch the configuration file.
S3 gateway is implemented using the open source MinIO code, so you'll have to provide some MinIO related variables:
Forgetting these variables will result in errors like MINIO_ROOT_USER should be specified as an environment variable with at least 3 characters`.
launch S3 gateway
juicefs gateway myjfs 127.0.0.1:8888
Expect the following output:
2023/03/21 20:15:49.945403 juicefs <INFO>: connected to 188.8.131.52:9308 [client.go:874]
2023/03/21 20:15:49.965411 juicefs <INFO>: Cache: /Users/herald/.juicefs/cache/jfs8 capacity: 102400 MB [disk_cache.go:747]
Object API (Amazon S3 compatible):
Assuming your server's public IP being
184.108.40.206 and you want to open up access to the gateway over the internet and bind to port
9000, you can adjust the startup command like this:
juicefs gateway myjfs 220.127.116.11:9000
Once S3 Gateway is launched, you can directly access the URL you set in your browser, i.e.,
http://127.0.0.1:8888 in the example above. Open the file explorer for web, and enter the corresponding Access Key and Secret Key to login.
In addition, clients like AWS CLI and MinIO Client and S3 SDKs for various programming languages are also available for accessing S3 Gateway.