s3fs 1.86使用教程

参考文档:.

背景说明:aws s3挂载到nextcloud的data文件夹,然后这样所有的数据都是通过nextcloud数据(除了数据库数据)存放的。

由于本人使用的是centos 8,虽然为最新的8,但是centos上的软件源码版本一般比较老,所以教程找的话,和官方教程不一样,只能自己摸索
直接挂载命令最新使用命令为
自己使用的版本为1.86
直接挂载命令
s3fs nextcloudfile.yeniugo.com /usr/share/nginx/amazons3 -o uid=0,gid=0 -o passwd_file=${HOME}/.passwd-s3fs -o use_path_request_style -o url=https://s3-us-west-1.amazonaws.com -o endpoint=us-west-1 -d -d -f -o f2 -o curldbg


创建密码文件
echo AKIAIOEO4E2VOHLxxxxx:2LXBboddEpRLmWl48i3+b4ziwPL3bJ4vxxxxxxxx > /etc/passwd-s3fs
chmod 600 /etc/passwd-s3fs
/etc/fstab文件
/usr/bin/s3fs#webdavfile.yeniugo.com /usr/share/nginx/nextcloud/data fuse _netdev,nonempty,uid=995,gid=992,allow_other,umask=007,use_path_request_style,url=https://s3.amazonaws.com,endpoint=us-east-1 0 1
参数说明
webdavfile.yeniugo.com: aws s3
/usr/share/nginx/nextcloud/data: 挂载点
nonempty: 因为nginx启动的时候,文件点的识别导致挂载点非空
uid=995,gid=992: nginx用户信息
allow_other: 允许其他所有用户
umask=007: 仅允许用户有权限,其他用户没有权限
url=https://s3.amazonaws.com: 挂载点,这个地址通过传文件到s3上后看到的文件域名就是这个参数
endpoint=us-east-1: 挂载区域
最后的1为挂载的顺序
备注:
allow_other,umask=007如果不配置会导致权限问题。
只有allow_other权限是其他用户可读可写,只有umask=007,nginx识别不到挂载点的权限,但是root用户可以。

问题
df -h卡死
1.可以使用df -lh
2.先执行systemctl restart proc-sys-fs-binfmt_misc.automount,再执行df -h,就好了



评论

此博客中的热门博文

certbot cloudflare申请通用域名证书

Centos7 安装 PHP7

在centos 7上用postfix,dovecot,mariaDB配置邮箱