s3fs-fuse源码下载安装配置说明

系统及相关软件版本说明:

操作系统:CentOS 7

s3fs-fuse源码:目前在上github上只有一个master分支

查看系统版本:

[root@bogon ~]# uname -a
Linux bogon 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@bogon etc]# cat redhat-release
CentOS Linux release 7.6.1810 (Core)

git下载s3fs源码

[root@bogon repositories]# git clone --recursive https://github.com/s3fs-fuse/s3fs-fuse.git

安装所需的一些工具:

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

编译安装,如果依赖库都安装成功,则一般没问题。

[root@node1 s3fs-fuse]# sh autogen.sh
--- Make commit hash file -------
--- Finished commit hash file ---
--- Start autotools -------------
configure.ac:26: installing './config.guess'
configure.ac:26: installing './config.sub'
configure.ac:27: installing './install-sh'
configure.ac:27: installing './missing'
src/Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
--- Finished autotools ----------
[root@node1 s3fs-fuse]# ls
aclocal.m4  autogen.sh      ChangeLog     config.h.in  configure     COPYING              depcomp  INSTALL     Makefile.am  missing    src   test-driver
AUTHORS     autom4te.cache  config.guess  config.sub   configure.ac  default_commit_hash  doc      install-sh  Makefile.in  README.md  test
[root@node1 s3fs-fuse]# ./config
-bash: ./config: No such file or directory
[root@node1 s3fs-fuse]# ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu

安装完成后,想挂载对象存储bucket还需要有自己的云账户和创建bucket

云账户对象存储服务开通后就拥有了AccessKeyID 和AccessKey,例如:

通过echo指令将自己的KeyID和secretKey写入到名称为passwd-s3fs配置文件中,并更改该文件的权限。

echo ACCESS_KEY_ID:SECRET_ACCESS_KEY > /etc/passwd-s3fs
chmod 600 /etc/passwd-s3fs

挂载自己云账户创建的bucket:mybucket

s3fs mybucket /mnt/test -o passwd_file=/etc/passwd-s3fs -o url=https://oss-cn-beijing.aliyuncs.com -o dbglevel=info -o curldbg

/mnt/test为自己想要挂载bucket的目录,https://oss-cn-beijing.aliyuncs.com为阿里云的地域节点,可以设置成自己的云账户地域节点。

使用mount指令可以看到s3fs已经挂载到/mnt/test目录。

[root@bogon ~]# mount
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=99592k,mode=700,uid=1000,gid=1000)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=99592k,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=48246)
s3fs on /mnt/test type fuse.s3fs (rw,nosuid,nodev,relatime,user_id=0,group_id=0)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)

进入挂载目录查看云账户bucket里的内容:

[root@bogon ~]# cd /mnt/test/
[root@bogon test]# ls
file  image  KuGou.exe  testx  私有云分析调研.docx  线上环境.docx  线上问题分析报告-20190125.xlsx
发布了10 篇原创文章 · 获赞 5 · 访问量 4427

猜你喜欢

转载自blog.csdn.net/u010059204/article/details/89319525
今日推荐