大张小站

  1. @八角石

    欢迎关注我的新浪微博 @八角石 !

    [ 更多详情 ]

  2. 人生

    自歌自舞自开怀,且喜无拘无碍。

  3. 心境

    若得心净如明月,长空万里了无尘。

  4. 情渊

    他生莫做有情痴,人间无地著相思。

  • 1
  • 2
  • 3
  • 4
1,025

使用s3fs-fuse在AWS EC2/Lightsail实例上挂载S3存储桶(转)

AWS
分类 网站技术/村民张先生 发布于 2020-03-14 01:17
0

一、安装s3fs-fuse以及依赖包

1) 安装依赖包

On CentOS7 or AMI Linux 7:

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

On Ubuntu 14.04 or later:

$ sudo apt-get install automake autotools-dev fuse g++ git libcurl4-openssl-dev libfuse-dev libssl-dev libxml2-dev make pkg-config

2) 安装s3fs-fuse

# cd /usr/local/; git clone https://github.com/s3fs-fuse/s3fs-fuse.git; cd s3fs-fuse; ./autogen.sh; ./configure; make; make install;

二、导入IAM用户身份凭证

# echo MYIDENTITY:MYCREDENTIAL >  ~/.passwd-s3fs; chmod 600  ~/.passwd-s3fs;

三、挂载S3存储桶到本地

1) 手动挂载

# mkdir /mnt/s3
# s3fs -o passwd_file=~/.passwd-s3fs -o endpoint=us-east-2 -o allow_other mybucket_name /mnt/s3

2) 写入/etc/fstab开机自动挂载

# vim /etc/fstab
mybucket_name /mnt/s3 fuse.s3fs _netdev,allow_other 0 0

来源:https://blog.51cto.com/daibaiyang119/2146818
更多参考:https://aws.amazon.com/cn/blogs/china/s3fs-amazon-ec2-linux/

欢迎转载分享,转载请注明 来源:大张小站 https://www.vdazhang.com/wenzhang-2350.html
若您喜欢这篇文章,欢迎订阅大张小站以获得最新内容。 / 欢迎交流探讨,请发电子邮件至 mail[at]vdazhang.com 。


欢迎谈谈你的看法(无须登录) *正文中请勿包含"http://"否则将被拦截