LoginSignup
13
13

More than 5 years have passed since last update.

EC2からS3をマウントする

Last updated at Posted at 2014-10-28

はじめに

ここではEC2からS3をマウントする手順を紹介します。
が、、これは本来のオブジェクトストレージの使い方とはずれた使い方なのであんまりおすすめしません。

設定手順

1.download

wget https://code.google.com/p/s3fs/downloads/list

2.足りないものをインストールする(READMEに書いてあります)


gcc
libstdc++-devel
gcc-c++
fuse
fuse-devel
curl-devel
libxml2-devel
openssl-devel

3. configure,make,make install
4. s3fs --helpでヘルプが出てくることを確認する。
5. s3fsはroot以外では利用できないので他のユーザで利用できるように変更する。

sudo vi /etc/fuse.conf
user_allow_otherのコメントアウトを解除する。

6. ManagementConsole - ユーザ名 - SecurityConfidentialsを開く
7. AccessKeys - [Create new Access Keys]でAccessKeyとSecretAccessKeyを控えておく。
8. /etc/passwd-s3fsに下記の形式で記載し、Permissionを640へ。

AccessKey:SecretAccessKey

9. マウントする

sudo /usr/local/bin/s3fs [backet name] /var/www/html -o allow_other

10. 確認する。

[ec2-user@ip-172-31-11-90 html]$ ls -lrt /var/www/html
total 1
d--------- 1 root root  0 Jan  1  1970 test
---------- 1 root root 14 Oct 28 01:03 error.html
---------- 1 root root 10 Oct 28 01:53 hoge.html

気になる点/追加確認点

  1. curlでアクセスしてるだけでプロトコル的にはhttp。同一リージョン/AZであっても速くはない。
  2. 自動マウント設定
13
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
13