JuiceFs
地址:https://juicefs.com/
免费提供1T的挂载需求,其实还是放在oss上,但是非常非常方便。
卸载:
参考:https://juicefs.com/docs/zh/getting_started.html
# 普通卸载,如果被占用会卸载失败
sudo umount /jfs
# 强制卸载
sudo umount /jfs -l
ossfs
安装工具
wget http://gosspublic.alicdn.com/ossfs/ossfs_1.80.6_centos7.0_x86_64.rpm
yum localinstall -y ossfs_1.80.6_centos7.0_x86_64.rpm
设置秘钥
echo bucket-name:access-key-id:access-key-secret > /etc/passwd-ossfs
chmod 640 /etc/passwd-ossfs
挂载
ourl网址获取在阿里云控制台—>对象存储OSS—->选择自己创建bucket—>概览—>访问域名(然后根据自己ECS的网络类型选择经典网络/专有网络)—EndPoint(选择内网的地址)
ossfs tianyunperfect /www/wwwroot/kedaoyun/data/User/alvin/home/oss -ourl=oss-cn-hongkong-internal.aliyuncs.com -o allow_other
查看oss是否挂载成功
df -lh
卸载
fusermount -u /data/nextcloud/data
开机启动
vim /etc/init.d/ossfs
#! /bin/bash
#
# ossfs Automount Aliyun OSS Bucket in the specified direcotry.
#
# chkconfig: 2345 90 10
# description: Activates/Deactivates ossfs configured to start at boot time.
ossfs tianyunperfect /www/wwwroot/kedaoyun/data/User/alvin/home/oss -ourl=oss-cn-hongkong-internal.aliyuncs.com -o allow_other
可执行权限
chmod +x ossfs