1.ossfs安装
1.1 Centos和ubuntu可以直接用包安装ossfs
详见:https://help.aliyun.com/document_detail/153892.html
1.2 Suse只能编译安装OSSFS
git clone https://github.com/aliyun/ossfs.git
cd ossfs
./autogen.sh
./configure
make
make install
2.ossfs挂载
2.1 bucket name
既是下面例子中的my-bucket
2.2 获得AK
这样就获得了AK和秘钥.既是下面例子中的 faint:123
2.3 生成配置文件并挂载ossfs
echo my-bucket:faint:123 > /etc/passwd-ossfs
chmod 640 /etc/passwd-ossfs
mkdir /tmp/ossfs
ossfs my-bucket /tmp/ossfs -ourl=http://oss-cn-hangzhou.aliyuncs.com
3.ossfs卸载
umount /tmp/ossfs
4.错误
ossfs: unable to connect url 'http://XXXXXXX.oss-cn-shanghai-internal.aliyuncs.com'
原因:由于使用内网挂载oss,同时刚才github下载时又配置了代理,将代理去除后故障排除.