
本記事の目的
File Storage Service(以下FSS)を作成して、DBaaSからマウントするまでの手順について説明します。
ファイル・ストレージ・サービスの説明
エンタープライズ・グレードのファイル・ストレージ
Oracle Cloud Infrastructure File Storageは、圧倒的な拡張性、可用性、耐久性およびパフォーマンスを備えた、クラウドの永続的な共有ファイル・システムです。Oracle File Storageは、NFSv3、スナップショットおよび暗号化をサポートしています。
https://cloud.oracle.com/ja_JP/storage/file-storage/features
前提/準備
FSSをマウントするインスタンスであるDBaaS(VM)は事前作成済み。
手順
Configuring VCN Security List Rules for File Storage
FSSを所属させたいVCNのセキュリティリストに、マニュアルに記載されている以下のルールを追加します。
File Storage requires stateful ingress to TCP ports 111, 2048, 2049, and 2050 and stateful ingress to UDP ports 111 and 2048.
Creating File Systems
以下の手順でFSSの管理画面を開いて、新規のFFSを作成します。
- Open the navigation menu. Under Core Infrastructure, click File Storage and then click File Systems.
- In the left-hand navigation, in the List Scope section, under Compartment, select a compartment.
- Click Create File System.
Mounting File Systems
・マウントオプション確認
作成したFFSの詳細画面から任意のインスタンスからのマウントオプションを確認できます。
今回は以下のようなコマンドが取得できました。
sudo yum install nfs-utils
sudo mkdir -p /mnt/FileSystem-20190220-0148
sudo mount 10.0.0.15:/FileSystem-20190220-0148 /mnt/FileSystem-20190220-0148
※マウント用のディレクトリ名はFSS作成時に指定可能
・nfs-utilsパッケージのインストール
[root@dbvmee02 yum.repos.d]# yum install nfs-utils Loaded plugins: kernel-update-handler, security, ulninfo Setting up Install Process (中略) Updated: nfs-utils.x86_64 1:1.2.3-78.0.1.el6_10.1 Complete!
NFS (Network File System) を利用すると、 ホストはリモートのシステム上にあるパーティションをマウントし、 ローカルのファイルシステムと同じように使用することができるようになります。 これにより、 管理者側はリソースをネットワーク上の一元的な場所に格納し、 認証ユーザーに安定したリソースアクセスを提供できるようになります。Red Hat Enterprise Linux では、 NFS に完全対応させる場合は nfs-utils が必要になります。
rpm -q nfs-utils
を実行して nfs-utils がインストールされているか確認してください。参考)第6章 ネットワークファイルシステム
https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/6/html/managing_confined_services/chap-managing_confined_services-network_file_system
・マウント先のディレクトリ作成
[root@dbvmee02 yum.repos.d]# mkdir -p /mnt/FileSystem-20190220-0148
※ディレクトリ名は任意でOK
・rpcbindの起動
※DBaaS固有の手順
[root@dbvmee02 yum.repos.d]# service rpcbind status rpcbind is stopped [root@dbvmee02 yum.repos.d]# service rpcbind start Starting rpcbind: [ OK ]
・iptablesの更新
※DBaaS固有の手順
[root@dbvmee02 yum.repos.d]# iptables -A INPUT -p tcp -s 10.0.0.15 -j ACCEPT [root@dbvmee02 yum.repos.d]# iptables -A OUTPUT -p tcp -s 10.0.0.15 -j ACCEPT [root@dbvmee02 yum.repos.d]# service iptables save iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ] [root@dbvmee02 yum.repos.d]# iptables --list | grep 10.0.0.15 ACCEPT tcp -- 10.0.0.15 anywhere ACCEPT tcp -- 10.0.0.15 anywhere
・FFSマウント
[root@dbvmee02 yum.repos.d]# mount 10.0.0.15:/FileSystem-20190220-0148 /mnt/FileSystem-20190220-0148 [root@dbvmee02 yum.repos.d]# df -k Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroupSys-LogVolRoot 35993216 6082768 28059056 18% / tmpfs 15308244 1399120 13909124 10% /dev/shm /dev/sda2 1397440 46436 1261968 4% /boot /dev/sda1 496672 276 496396 1% /boot/efi /dev/sdj 206293688 26637760 169153784 14% /u01 /dev/asm/commonstore-1 5242880 392576 4850304 8% /opt/oracle/dcs/commonstore 10.0.0.15:/FileSystem-20190220-0148 9007199254740992 0 9007199254740992 0% /mnt/FileSystem-20190220-0148★
⇒マウント成功!
・書き込みテスト
[root@dbvmee02 yum.repos.d]# echo "hello!" > /mnt/FileSystem-20190220-0148/test.txt [root@dbvmee02 yum.repos.d]# cat /mnt/FileSystem-20190220-0148/test.txt hello!
参考情報
・マニュアル「Overview of File Storage」
https://docs.cloud.oracle.com/iaas/Content/File/Concepts/filestorageoverview.htm
・OCI Hands-on Labs File Storage Service
https://oracle.github.io/learning-library/oci-library/L100-LAB/File_Storage_Service/FSS_HOL.html
・Oracle Cloud File Storage Service を使ってみる
https://cloudii.atomitech.jp/entry/2018/08/22/191619
Leave a Reply