install (/home/hoge配下にインストール)
$ sudo yum -y install golang fuse
$ export GOPATH=$HOME/go
$ go get github.com/kahing/goofys
$ go install github.com/kahing/goofys
- mount
$ mkdir mount-point
$ $GOPATH/bin/goofys bucket-name:prefix1/prefix2 mount-point
- 確認
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 99G 12G 87G 13% /
devtmpfs 991M 56K 991M 1% /dev
tmpfs 1002M 0 1002M 0% /dev/shm
bucket-name:prefix1/prefix2 1.0P 0 1.0P 0% mount-point
$ aws s3 ls s3://bucket-name:prefix1/prefix2/
2017-03-31 21:25:17 0 upload-test.log
- オプションにunmountがない
$ $GOPATH/bin/goofys -h
Error: goofys takes exactly two arguments.
NAME:
goofys - Mount an S3 bucket locally
USAGE:
goofys [global options] bucket[:prefix] mountpoint
VERSION:
0.0.10
GLOBAL OPTIONS:
--help, -h Print this help text and exit successfully.
-o value Additional system-specific mount options. Be careful!
--dir-mode value Permission bits for directories. (default: 0755) (default: 493)
--file-mode value Permission bits for files. (default: 0644) (default: 420)
--uid value UID owner of all inodes. (default: 501)
--gid value GID owner of all inodes. (default: 501)
--endpoint value The non-AWS endpoint to connect to. Possible values: http://127.0.0.1:8081/
--profile value Use a named profile from $HOME/.aws/credentials instead of "default"
--use-content-type Set Content-Type according to file extension and /etc/mime.types (default: off)
--debug_fuse Enable fuse-related debugging output.
--debug_s3 Enable S3-related debugging output.
-f Run goofys in foreground.
--version, -v print the version
TUNING OPTIONS:
--cheap Reduce S3 operation costs at the expense of some performance (default: off)
--stat-cache-ttl value How long to cache StatObject results and inode attributes. (default: 1m0s)
--type-cache-ttl value How long to cache name -> file/dir mappings in directory inodes. (default: 1m0s)
AWS S3 OPTIONS:
--region value The region to connect to. Usually this is auto-detected. Possible values: us-east-1, us-west-1, us-west-2, eu-west-1, eu-central-1, ap-southeast-1, ap-southeast-2, ap-northeast-1, sa-east-1, cn-north-1 (default: "us-east-1")
--storage-class value The type of storage to use when writing objects. Possible values: REDUCED_REDUNDANCY, STANDARD, STANDARD_IA. (default: "STANDARD")
--sse Enable basic server-side encryption at rest (SSE-S3) in S3 for all writes (default: off)
--sse-kms key-id Enable KMS encryption (SSE-KMS) for all writes using this particular KMS key-id. Leave blank to Use the account's CMK - customer master key (default: off)
--acl value The canned ACL to apply to the object. Possible values: private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control (default: off)
- killした
$ ps aux | grep goofys
501 6767 0.0 0.7 206712 14392 ? Ssl 21:12 0:00 /home/hoge/go/bin/goofys bucket-name:prefix1/prefix2 mount-point
501 7447 0.0 0.1 110460 2068 pts/1 S+ 21:27 0:00 grep --color=auto goofys
$ kill -9 6767
$ df -h
df: ‘/home/hoge/mount-point’: Transport endpoint is not connected
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 99G 12G 87G 13% /
devtmpfs 991M 56K 991M 1% /dev
tmpfs 1002M 0 1002M 0% /dev/shm
- oh... 接続ポイント消失により、rootでも
Permission denied
になってしまった
$ ll
ls: cannot access mount-point: Transport endpoint is not connected
(snip)
d????????? ? ? ? ? ? mount-point
(snip)
- 正しくは
fusermount
を使う
$ fusermount -u mount-point
$ ll
drwxr-xr-x 6 hoge hoge 4096 Mar 31 12:31 mount-point
結局、速度改善されたs3fsを使うことにした。まだバージョン0.0.10なので今後に期待。(EFS、東京リージョン早く!)