最新消息:本站所有跳转向bbs.ykit.cn的附件将全面停止,附件已转移到https://www.qingsj.com

阿里云ECS挂载oss

Linux 有客 2333浏览

sudo yum localinstall ossfs_1.80.0_centos7.0_x86_64.rpm  #上传安装包到root目录

点我下载  #此版本适应于Cent OS 7.0/7.2

echo 空间名:ID:KEY > /etc/passwd-ossfs
chmod 640 /etc/passwd-ossfs


/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 空间名 挂载路径 -ourl=http://oss-cn-hangzhou-internal.aliyuncs.com -o allow_other   #这里是杭州1内网地址
//设定权限
 chmod a+x /etc/init.d/ossfs

//自启动

chkconfig ossfs on

cent os7.2通过Ossfs挂载了目录后,没有找到updatedb.con这个文件 解决方法

使用ossfs上传到OSS的文件Content-Type全是”application/octet-stream”是怎么回事?

centos可以通过
sudo yum install mailcap
来添加

 

使用ECS挂载ossfs,如何避免因后台程序扫描文件而产生费用?

程序扫描ossfs挂载的目录,会转换成向OSS的请求,如果请求次数很多,会产生费用(1分钱/1万次)。如果是updatedb,可以通过修改/etc/updatedb.conf让它跳过。具体做法是:

 1. 在`PRUNEFS = `后面加上`fuse.ossfs`
 2. 在`PRUNEPATHS = `后面加上挂载的目录

转载请注明:有客帮 » 阿里云ECS挂载oss