1、下载依赖环境
yum install automake gcc-c++ git libcurl-devel libxml2-devel fuse-devel make openssl-devel -y
2、git下载ossfs代码
git clone https://github.com/aliyun/ossfs.git
编译安装
cd ossfs
./autogen.sh
./configure
make && make install #默认应该是安装在/usr/local/bin/
3、查看安装成功
[root@localhost /]# whereis ossfs
ossfs: /usr/local/bin/ossfs
4、配置阿里云OSS秘钥
例如:
echo 5xxx:LTAxxxxxxPU:IRxxxx8kExxxxxxf715iF > /etc/passwd-ossfs
chmod 640 /etc/passwd-ossfs #此步不做会报错permission denied
5、将oss空间mount挂载到ossfs目录下
mkdir your_dir
ossfs 5xxx your_dir -ourl=http://oss-cn-beijing-internal.aliyuncs.com -ouid=your_uid -ogid=your_gid
#不同地区对应不同的网址ourl
6、问题总结
1.fuse: failed to exec fusermount: No such file or directory
yum install fuse -y
卸载命令:fusermount -u /aliyun_ossfs