JuiceFs

地址:https://juicefs.com/
免费提供1T的挂载需求,其实还是放在oss上,但是非常非常方便。

image.png

卸载:
参考:https://juicefs.com/docs/zh/getting_started.html

  1. # 普通卸载,如果被占用会卸载失败
  2. sudo umount /jfs
  3. # 强制卸载
  4. sudo umount /jfs -l

ossfs

参考:http://blog.ahbxl.cn/2020/01/12/oss-docker-nextcloud%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E4%BA%91%E7%9B%98/

安装工具

  1. wget http://gosspublic.alicdn.com/ossfs/ossfs_1.80.6_centos7.0_x86_64.rpm
  2. yum localinstall -y ossfs_1.80.6_centos7.0_x86_64.rpm

设置秘钥

  1. echo bucket-name:access-key-id:access-key-secret > /etc/passwd-ossfs
  2. chmod 640 /etc/passwd-ossfs

挂载

ourl网址获取在阿里云控制台—>对象存储OSS—->选择自己创建bucket—>概览—>访问域名(然后根据自己ECS的网络类型选择经典网络/专有网络)—EndPoint(选择内网的地址)

  1. ossfs tianyunperfect /www/wwwroot/kedaoyun/data/User/alvin/home/oss -ourl=oss-cn-hongkong-internal.aliyuncs.com -o allow_other

查看oss是否挂载成功

  1. df -lh

卸载

  1. fusermount -u /data/nextcloud/data

开机启动

vim /etc/init.d/ossfs

  1. #! /bin/bash
  2. #
  3. # ossfs Automount Aliyun OSS Bucket in the specified direcotry.
  4. #
  5. # chkconfig: 2345 90 10
  6. # description: Activates/Deactivates ossfs configured to start at boot time.
  7. ossfs tianyunperfect /www/wwwroot/kedaoyun/data/User/alvin/home/oss -ourl=oss-cn-hongkong-internal.aliyuncs.com -o allow_other

可执行权限

  1. chmod +x ossfs