ownCloudでオブジェクトストレージを使う(GMOクラウドの場合)

Powered BLUE上のownCloudからオブジェクト・ストーレジを使う場合の設定です。ownCloudの運用場所はどこでも構いません。

構成例

  • ownCloud サーバー   IP=192.168.1.2 (ローカル)
  • Object Storage         GMOクラウド

Amazon S3ではAmazon のGUIからBucketを生成出来ますが、GUIからBucketを生成できないオブジェクトストレージサービス(GMOクラウドなど)を利用の場合には、コマンドラインからの操作で、事前にObject Storage用のBucketを生成しておく必要があります。

 

GMOクラウドのオブジェクトストレージの場合

S3コマンドのインストール

ownCloudを運用しているPowered BLUEサーバーにS3コマンドをインストールします。S3関連のインストール方法は、GMOクラウド社のHPからの抜粋です

# yum install python-dateutil python-magic

# wget http://downloads.sourceforge.net/project/s3tools/s3cmd/1.5.0-rc1/s3cmd-1.5.0-rc1.tar.gz

# tar xvf s3cmd-1.5.0-rc1.tar.gz

# cd s3cmd-1.5.0-rc1

# python setup.py install

# s3cmd   – –configure

Enter new values or accept defaults in brackets with Enter.
Refer to user manual for detailed description of all options.

Access key and Secret key are your identifiers for Amazon S3. Leave them empty for using the env variables.
Access Key: <- アクセスキーを入力
Secret Key: <- シークレットキーを入力

Encryption password is used to protect your files from reading
by unauthorized persons while in transfer to S3
Encryption password: <-「Enter」
Path to GPG program [/usr/bin/gpg]: <-「Enter」

When using secure HTTPS protocol all communication with Amazon S3
servers is protected from 3rd party eavesdropping. This method is
slower than plain HTTP and can't be used if you're behind a proxy
Use HTTPS protocol [No]: <-「Enter」

On some networks all internet access must go through a HTTP proxy.
Try setting it here if you can't connect to S3 directly
HTTP Proxy server name: <-「Enter」

New settings:
  Access Key: xxx
  Secret Key: xxx
  Encryption password:
  Path to GPG program: /usr/bin/gpg
  Use HTTPS protocol: False
  HTTP Proxy server name:
  HTTP Proxy server port: 0

Test access with supplied credentials? [Y/n] n

Save settings? [y/N] y
Configuration saved to '/root/.s3cfg'

※アクセスキーとシークレットキーはGOMクラウドのポータル画面よりご確認ください。

エンドポイントはコマンドで設定できないため、設定ファイルを書き換えます。

ホームディレクトリに移動します。

# cd

設定ファイルを編集し、「amazonaws.com」をエンドポイントのドメイン名に置き換えます。ここではエンドポイントをst.gmocloudtest.comとします。

# vi .s3cfg

<変更前>
host_base = s3.amazonaws.com
host_bucket = %(bucket)s.s3.amazonaws.com

<変更後>
host_base = st.gmocloudtest.com
host_bucket = %(bucket)s.st.gmocloudtest.com

実際にオブジェクトのリストを取得して、動作確認をします。

# s3cmd  ls

最初は空なので、何も表示されません。エラーが出なければOKです。

ownCloudのGUIからの設定 外部ストレージ(external storage support )を有効にしますowncloud-external-storage-1

Amazon S3 互換ストレージを選択します

  • フォルダ名 (例 gmo-cloud)
  • アクセスキー (指定の値:GMOクラウドのポータル画面で確認)
  • シークレットキー (指定の値:GMOクラウドのポータル画面で確認)
  • パケット名 (st.gmocloud.com)
  • ホスト名 (st.gmocloud.com)

を入力しますowncloud-external-storage-2

 

設定が正しい場合には、外部ストレージフォルダの左側の〇がグリーンに変わりますowncloud-external-storage-3

 

ownCloudのGUIへアクセス

オブジェクトストレージのフォルダ gmo-cloud  が表示されていますowncloud-external-storage-4

オブジェクトストレージのフォルダ gmo-cloud  にファイルをアップロードowncloud-external-storage-5

 

 

※本記事の内容は、活用方法の例を示したものであり、ご利用&設定などに際しては、ご利用者様の責任においてご活用ください。