ossfs的使用

阿里云的oss对象存储是公司常用的文件服务,也是和cdn配合的最好的方式。oss的同步可以通过java 和php客户端来执行,也可以通过ossutil这样的用go写的客户端来进行,但是最无缝的方式是将oss mout成linux下的一个目录,从而对应用程序无感,这就是fues技术。

用户空间文件系统(Filesystem in Userspace,简称FUSE)是一个面向类Unix计算机操作系统的软件接口,它使无特权的用户能够无需编辑内核代码而创建自己的文件系统。目前Linux通过内核模块对此进行支持。一些文件系统如ZFS、glusterfs和lustre使用FUSE实现。

Linux用于支持用户空间文件系统的内核模块名叫FUSE,FUSE一词有时特指Linux下的用户空间文件系统。

文件系统是一个通用操作系统重要的组成部分。传统上操作系统在内核层面上对文件系统提供支持。而通常内核态的代码难以调试,生产率较低。

Linux从2.6.14版本开始通过FUSE模块支持在用户空间实现文件系统。

看下ossfs怎么用
源码:https://github.com/aliyun/ossfs
安装:

centos 6.5
yum localinstall your_ossfs_package

install by source code
If you fail to find the corresponding installer package, you can also install the tool by compiling the code on your own. First install the following dependency libraries before compilation:

Ubuntu 14.04:

sudo apt-get install automake autotools-dev g++ git libcurl4-gnutls-dev \
                 libfuse-dev libssl-dev libxml2-dev make pkg-config

CentOS 7.0:

sudo yum install automake gcc-c++ git libcurl-devel libxml2-devel \
             fuse-devel make openssl-devel

Then you can download the source code from GitHub and compile the code for installing the tool:

git clone https://github.com/aliyun/ossfs.git
cd ossfs
./autogen.sh
./configure
make
sudo make install

挂载:

ossfs name-of-bullet /gitlabnew/data/backups/ -ourl=oss0url
-opasswd_file=/etc/passwd-ossf -oumask=000 -oallow_other

卸载:

umount /gitlabnew/data/backups/

Lokie博客
请先登录后发表评论
  • 最新评论
  • 总共0条评论
  • 本博客使用免费开源的 laravel-bjyblog v5.5.1.1 搭建 © 2014-2018 lokie.wang 版权所有 ICP证:沪ICP备18016993号
  • 联系邮箱:kitche1985@hotmail.com