b) 关于如何为IAM用户创建访问密钥,请参见:
http://docs.aws.amazon.com/zh_cn/IAM/latest/UserGuide/id_credentials_access-keys.html
c) 关于如何为IAM用户设置权限策略,请参见:
http://docs.aws.amazon.com/zh_cn/IAM/latest/UserGuide/access_policies_create.html
https://aws.amazon.com/cn/blogs/security/writing-iam-policies-how-to-grant-access-to-an-amazon-s3-bucket/
./autogen.sh
./configure
make
sudo make install
Usage: s3fs BUCKET:[PATH] MOUNTPOINT [OPTION]…
[ec2-user@ip-172-31-23-148 ~]$ which s3fs
/usr/local/bin/s3fs
devtmpfs 488M 56K 488M 1% /dev
tmpfs 498M 0 498M 0% /dev/shm
/dev/xvda1 7.8G 1.2G 6.6G 15% /
s3fs 256T 0 256T 0% /home/ec2-user/s3mnt
[ec2-user@ip-172-31-23-148 ~]$ cd /home/ec2-user/s3mnt
[ec2-user@ip-172-31-23-148 s3mnt]$ ls -l
总用量 1
-rw-rw-r– 1 ec2-user ec2-user 19 10月 18 07:13 a.txt
[ec2-user@ip-172-31-23-148 s3mnt]$
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 488M 56K 488M 1% /dev
tmpfs 498M 0 498M 0% /dev/shm
/dev/xvda1 7.8G 1.2G 6.6G 15% /
[CRT] s3fs.cpp:set_s3fs_log_level(254): change debug level from [INF] to [DBG]
[INF] s3fs.cpp:set_moutpoint_attribute(4196): PROC(uid=500, gid=500) – MountPoint(uid=500, gid=500, mode=40775)
FUSE library version: 2.9.4
nullpath_ok: 0
nopath: 0
utime_omit_ok: 0
chmod 600 /etc/passwd-s3fs
“Generally S3 cannot offer the same performance or semantics as a local file system. More specifically:
· random writes or appends to files require rewriting the entire file
· metadata operations such as listing directories have poor performance due to network latency
· eventual consistency can temporarily yield stale data
· no atomic renames of files or directories
· no coordination between multiple clients mounting the same bucket
· no hard links
通常S3不能提供与本地文件系统相同的性能或语义。进一步来说:
· 随机写入或追加到文件需要重写整个文件
· 元数据操作比如列出目录会因为网络延迟原因导致性能较差
· 最终一致性设计可能临时导致过期数据
· 没有对文件或目录的原子重命名功能
· 挂载相同存储桶的多个客户端之间没有相互协调机制
· 不支持硬链接
How to instal s3fs-fuse on CentOS 6.8?
In case you have CentOS 6.8 server (or DigitalOcean droplet/vps) and you want to install s3fs-fuse the proposed way you’ll run into a problem: the s3fs-fuse requires fuse library version 2.8.4 or higher, but your yum install fuse fuse-devel will install you fuse 2.8.3. If you are running CentOS 7 you won’t have this problem at all, since by default, yum will install fuse 2.9.2.
To fix this problem you need to remove the fuse and install it manually.
1. Remove fuse installed by yum
yum remove fuse fuse* fuse-devel
2. Install some dependencies (for both fuse and s3fs-fuse)
yum install automake gcc-c++ git libcurl-devel libxml2-devel make openssl-devel
3. Download and install latest fuse library (version 2.9.7)
cd /usr/local/src
wget https://github.com/libfuse/libfuse/releases/download/fuse-2.9.7/fuse-2.9.7.tar.gz
tar -xzvf fuse-2.9.7.tar.gz
rm -f fuse-2.9.7.tar.gz
mv fuse-2.9.7 fuse
cd fuse/
./configure –prefix=/usr
make
make install
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib64/pkgconfig/
ldconfig
4. Test that fuse is installed (should return “2.9.7″)
pkg-config –modversion fuse
5. Install the s3fs-fuse (using the default instructions from github)
git clone https://github.com/s3fs-fuse/s3fs-fuse.git
cd s3fs-fuse
./autogen.sh
./configure
make
sudo make install
6. If there were no errors along the way, this should return the s3fs-fuse version (currently 1.80)
s3fs –version
Hopefully, this will help you successfully install s3fs-fuse on your system. For details on how to use it please refer to documentation at the github page. Please do not hesitate to leave your comments below! Thank you.