s3fs使用

安装命令

yum install epel-release
yum install s3fs-fuse

密钥处理

echo youaccessid:youaccesskey > ${HOME}/.passwd-s3fs
# 或
echo youaccessid:youaccesskey > /etc/passwd-s3fs

chmod 600 ${HOME}/.passwd-s3fs
# 或
chmod 600 /etc/passwd-s3fs

高权限777挂载

s3fs testmountbucket /mys3fs -o passwd_file=${HOME}/.passwd-s3fs -o url=http://127.0.0.1:9000 -o use_path_request_style -o allow_other -o nonempty -o no_check_certificate -o umask=000

其他demo

# 启用调试输出
s3fs mybucket /path/to/mountpoint -o passwd_file=${HOME}/.passwd-s3fs -o dbglevel=info -f -o curldbg
# 如果您将 s3fs 与非 Amazon S3 实施结合使用,请指定 URL 和路径样式请求
s3fs mybucket /path/to/mountpoint -o passwd_file=${HOME}/.passwd-s3fs -o url=https://url.to.s3/ -o use_path_request_style

自动挂载

# demo1
mybucket /path/to/mountpoint fuse.s3fs _netdev,allow_other 0 0
demo2
mybucket /path/to/mountpoint fuse.s3fs _netdev,allow_other,use_path_request_style,url=https://url.to.s3/ 0 0