ossfs 使用挂在到ecs -centos 6.8

# 帮助文档

```
oss 的所有文档都在这个链接上
https://promotion.aliyun.com/ntms/act/ossdoclist.html?spm=5176.7933691.744462.c2.5a286a56LYEfeu
```

## 安装文档

```
https://help.aliyun.com/document_detail/32196.html?spm=5176.87240.400427.68.qoHeGz
```

## 安装包

```
由于低版本的Linux发行版本内核版本比较低,ossfs进程在运行过程中容易出现掉线或者其他问题,因此建议用户将操作系统升级到CentOS 7.0或者Ubuntu 14.04以及以上版本。
```


## 对于CentOS6.5及以上, 比如6.8 系统
安装的时候会遇到依赖包的问题,解决办法卸载所有fuse-2.8.3

```
yum localinstall ossfs_1.80.5_centos6.5_x86_64.rpm
Running Transaction Test


Transaction Check Error:
file /sbin/mount.fuse from install of ossfs-1.80.5-1.x86_64 conflicts with file from package fuse-2.8.3-5.el6.x86_64
file /usr/bin/fusermount from install of ossfs-1.80.5-1.x86_64 conflicts with file from package fuse-2.8.3-5.el6.x86_64
file /usr/bin/ulockmgr_server from install of ossfs-1.80.5-1.x86_64 conflicts with file from package fuse-2.8.3-5.el6.x86_64

Error Summary
-------------
```
## 解决问题

```

# rpm -qa | grep fuse
# fuse-2.8.3-5.el6.x86_64
# fuse-libs-2.8.3-5.el6.x86_64

# yum remove fuse
移除 fuse cloudera-manager-agent 大胆移除不会出错的
fuse x86_64 2.8.3-5.el6 @anaconda-CentOS-201605220104.x86_64/6.8 192 k
cloudera-manager-agent x86_64 5.9.1-1.cm591.p0.8.el6 @cloudera-manager 107 M

```
## 挂在

```
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
问题1:
bash: ossfs: command not found
解决:
# rpm -ql ossfs
# ln -sf /usr/local/bin/ossfs /usr/bin/ossfs
问题2:
fuse: warning: library too old, some operations may not not work
解决:
是因为fuse-libs库太老了,安装ossfs_1.80.5的时候自带了fuse-libs
rpm -ql ossfs | grep fuse
找到库文件所在路径
# LD_LIBRARY_PATH=/usr/lib ossfs soyoungoss /backup/ossfs -ourl=http://oss-cn-beijing-internal.aliyuncs.com

```
## OK 挂在成功

```
df -Th
ossfs fuse.ossfs 256T 0 256T 0% /backup/ossfs
```
## 参考文档

1. https://bbs.aliyun.com/read/294547.html 解决:library too old
2. https://bbs.aliyun.com/simple/t310950.html 解决: fuse 冲突
3. https://blog.csdn.net/sinat_27595165/article/details/45822975 解决: ossfs: MOUNTPOINT directory /backup/ossfs is not empty. if you are sure this is safe, can use the 'nonempty' mount option.

猜你喜欢

转载自www.cnblogs.com/lize3379/p/9317353.html