前回の、DragonDisk編と同じですが、今回はs3fsを利用して、IDCF分散型ストレージを利用してみたいと思います。
s3fsをダウンロードし、解凍、コンパイルします。
1 2 3 4 |
#wget https://s3fs.googlecode.com/files/s3fs-1.63.tar.gz #tar -zxvf s3fs-1.63.tar.gz #cd s3fs-1.63 #./configure --prefix=/usr |
下記エラーが表示されてしまいました。
1 2 3 4 5 6 7 8 9 10 |
checking for DEPS... configure: error: Package requirements (fuse >= 2.8.4 libcurl >= 7.0 libxml-2.0 >= 2.6 libcrypto >= 0.9) were not met: Requested 'fuse >= 2.8.4' but version of fuse is 2.8.3 Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DEPS_CFLAGS and DEPS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. |
fuseのバージョンが古いよと。
しかしepelリポジトリにも2.8.3までしか無いようなので、パッケージを一度削除し、ソースからインストールします。
1 2 3 4 5 6 7 |
#yum remove fuse #yum remove fuse-devel #wget http://downloads.sourceforge.net/project/fuse/fuse-2.X/2.9.2/fuse-2.9.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Ffuse%2Ffiles%2Ffuse-2.X%2F&ts=1363162605&use_mirror=jaist #tar -zxvf fuse-2.9.2.tar.gz #cd fuse-2.9.2 #./configure prefix=/usr #make && make install |
環境変数の設定
1 |
#export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib64/pkgconfig/ |
fuseを有効にします。
1 2 3 |
#ldconfig #modprobe fuse #pkg-config --modversion fuse |
s3fsを再度コンパイルします。
1 2 3 |
#cd /usr/local/src/s3fs-1.63 #./configure prefix=/usr #make && make install |
アクセスキー、シークレットキーを登録します。
s3fsを利用して、マウントしてみます
1 2 |
#s3fs https://bucketname.cs-ap-e1.ycloud.jp/ /mnt/idcfstorage #s3fs: credentials file /etc/passwd-s3fs should not have others permissions |
passwd-s3fsファイルのパーミッションを640にします。
1 |
#chmod 640 /etc/passwd-s3fs |
もう一度マウント
1 2 |
#s3fs https://bucketname.cs-ap-e1.ycloud.jp/ /mnt/idcfstorage s3fs: invalid credentials |
あれ?
使い方が違うようです。
1 2 |
# s3fs bucketname /mnt/idcfstorage -o allow_other -o -url=https://cs-ap-e1.ycloud.jp/ fuse: warning: library too old, some operations may not not work |
URL最後に/(スラッシュ)をつけてしまったのが原因のようです。
1 2 |
#s3fs bucketname /mnt/idcfstorage -o allow_other -o -url=https://cs-ap-e1.ycloud.jp fuse: bad mount point `/mnt/idcfstorage': Transport endpoint is not connected |
dfしてみたら、下記のようなメッセージがでました。
1 2 3 4 5 6 |
# df -h Filesystem Size Used Avail Use% マウント位置 /dev/sda1 15G 2.4G 12G 17% / tmpfs 939M 0 939M 0% /dev/shm /dev/sdb1 40G 518M 37G 2% /var df: `/mnt/idcfstorage': 通信端点が接続されていません |
アンマウントしていなかったのが原因のようです。
1 |
#umount /mnt/idcstorage |
再実行!
1 |
#s3fs bucketname /mnt/idcfstorage -o allow_other -o -url=https://cs-ap-e1.ycloud.jp |
dfで確認します。
1 2 3 4 5 6 |
# df -h Filesystem Size Used Avail Use% マウント位置 /dev/sda1 15G 2.4G 12G 17% / tmpfs 939M 0 939M 0% /dev/shm /dev/sdb1 40G 518M 37G 2% /var s3fs 256T 0 256T 0% /mnt/idcfstorage |
S3と同様に、256Tでマウントされました。