LoginSignup
4
3

More than 5 years have passed since last update.

IBM Cloud Object Storage (S3 API)をgoofysでマウントする

Posted at

目的

IBM Cloud Object StorageはS3 APIに対応しています。API経由での操作は面倒なので、S3向けのマウントツールを使ってみます。ツールはs3fsより速いと有名なgoofysを使います。

手順

環境

IBM Cloudの仮想サーバでRedHat Enterprise Linux 7を選択。実際のバージョンは7.5。

# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.5 (Maipo)

Object StorageのオーダーとBucketの登録は済んでいる前提とします。

ツールのビルド

# yum -y install git golang fuse
# go get github.com/kahing/goofys
# go install github.com/kahing/goofys

credentialファイルの作成

~/.aws/credentials
aws_access_key_id = <ポータルで確認>
aws_secret_access_key = <ポータルで確認>

AWSではないんですけどね(苦笑)。

マウント

(例)
# 実際はお使いの環境に合わせてください
# ~/go/bin/goofys --endpoint https://s3.jp-tok.objectstorage.service.networklayer.com teruq-backup /mnt

--endpointでIBM Cloud Object Storageのエンドポイントを指定するところがポイントです。エンドポイントはポータルから確認してください。

書き込みテスト

# cd /mnt
# dd if=/dev/zero of=1G.dat bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 96.3054 s, 11.1 MB/s

速度は仕方ないですかね。

以上です。

4
3
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
4
3