ZFS 概要およびガイドDon Turnbull、2007 年 3 月 (2009年 3 月に更新)
ZFS は、Solaris 10 オペレーティングシステムのストレージ管理における、Sun Microsystems のもっとも新しい手法です。ZFSは、POSIX準拠ファイルシステムおよび複数の管理ツールセットをボリューム管理システムとともに組み合わせます。アプリケーション自体を考えれば、従来のファイルシステムの動作とはまったく変わりませんが、大幅に改善されたパフォーマンスおよび処理能力を提供します。最後に、ZFSは、システム管理者に最良のボリューム管理およびバックアップ解決策に匹敵する広範囲のツールを提供します。 このガイドの目的は、初めてZFSを設定する場合に有用な概要を提供することです。ZFSは、このガイドで言及されないほかの機能およびオプションを多く組み込みます。これらの機能は特定の状況に役立ちますが、この一般的な概要に記載するものではありません。詳細な情報については、 一般的な概念ストレージプール ZFS は物理デバイスを「ストレージプール」と呼ばれる論理的なプールへ編成します。オペレーティングシステムの可視な各ディスクおよび配列論理ユニット番号 (LUN) はいずれも、ZFS プールに含まれます。ZFS は、従来のストレージ構造とは多少異なるベースにありますが、これらの機能はこのガイドでは言及していません。 ストレージプールは、冗長性がないストライプ化ディスク (RAID 0)、ミラー化ディスク (RAID 1)、ストライプ化ミラーセット (RAID、1+0)、またはパリティーによるストライプ化ディスク (RAID Z) の組み合わせになります。追加ディスクは、いつでもプールに追加できますが、同じ RAID レベルで追加する必要があります。たとえば、プールが RAID 1 で設定される場合、ディスクは、プールが作成されたときに使用された同じレベル数のミラー化セットとしてのみプールに追加することができます。ディスクがプールに追加されたときに、追加ストレージが自動的にその時点から使用されます。 注: プールにディスクを追加すると、データの書き込みがプール上で行われるときに、新しいディスクへ書き込まれます。既存データは自動的に再分配されませんが、変更された時に再分配されます。 プールへディスクを編成する場合、次の問題を考慮します。
注: RAID-Z は、より高いパフォーマンスと有用性でストライプセットをより容易に拡張できる、ZFS 用の特有の RAID-5 実装です。 ヒント 1:
より多くのディスクが含まれるほど、ストレージプールの性能が向上します。各プールにできるだけ多くのディスクを含むようにし、各プール上に複数のファイルシステムを構築してください。
ZFSファイルシステム ZFSはオペレーティングシステムにPOSIX準拠のファイルシステムインターフェースを提供します。まとめると、ZFS ファイルシステムは、UFS ファイルシステムのように見えて動作しますが、ZFSファイルははるかに大きく、ZFS ファイルシステムもはるかに大きくなり、適切に設定されると ZFSの性能はさらによくなる点で異なります。 注: ファイルシステムを作成するために、どのくらいの大きさが必要かを知る必要はありません。 ZFSファイルシステムは、ストレージプールのサイズまで自動的に拡大します。ZFS ファイルシステムはただ 1 つだけのストレージプールに構築する必要がありますが、1 つのストレージプールには複数の定義されたファイルシステムを持つことができます。ストレージプール中の各ファイルシステムは、それぞれストレージプール中ですべての未使用スペースへのアクセスを持ちます。ある 1 つのファイルシステムがスペースを使用すると、スペースを占領するファイルの削除によってそのスペースがプールに解放されるまで、スペースはそのファイルシステムのために予約されます。この間、同じプールをベースとするすべてのファイルシステム上の利用可能な空きスペースは減少します。 ZFSファイルシステムは、 最後に、ZFSファイルシステムのデフォルトマウントポイントは、プールの名前およびファイルシステムの名前に基づきます。たとえば、プール コマンド行インタフェースコマンド行インタフェースは主に たとえば、 ZFS の計画 ヒント 2:
format コマンドを使用して、利用可能なデバイスのリストを決定し、それらのデバイス構成の問題を解決します。
次の手順は新しいシステム上で ZFS を設定する前に行なってください。すべてのコマンドは、root ユーザーまたは root 権限を持つユーザーによって実行してください。
その他の計画情報は docs.sun.com (英語) で見つけることができます。 実行例では、JBOD (ただのディスクの束) あるいは非 RAID 管理されたストレージの 2 つのボディが、サーバーに付けられています。ZFSを使用する場合にハードウェアRAIDシステムを回避する理由はありませんが、この例はハードウェアRAIDシステムがなくより明確です。次のテーブルリストは、接続したストレージデバイスの中にある物理デバイスを示します。
データからインデックスを分ける必要に基づいて、 ストレージプールの作成 ストレージプールは # zpool create <pool_name> [<configuration>] <device_files> コマンドは、新規プールの名前およびパスのないディスクデバイスファイル名 (たとえば、 ヒント 3:
特定のマウントポイントを定義する
-m オプション、またはデフォルトのマウントポイントへの相対ルートパスを再定義する -R オプションをチェックアウトします。
引き続く例では 、それぞれに最低限のコントローラ競合がある 8 枚のディスクの 2 つの RAID-Z ストレージプールを構築するための # zpool create indexes raidz c2t0d0 c2t1d0 c2t2d0 \ c2t3d0 c4t0d0 c4t1d0 c4t2d0 c4t3d0 # zpool create tables raidz c3t0d0 c3t1d0 c3t2d0 \ c3t3d0 c5t0d0 c5t1d0 c5t2d0 c5t3d0 これらのコマンドの影響は ファイルシステムの作成 作成されたデフォルトのファイルシステムがシステムのニーズを十分に満たしていない場合、 たとえば実行例では、2 つのデータベースは新しいストレージ上で構成され、管理の目的で # zfs create indexes/db1 # zfs create indexes/db2 # zfs create tables/db1 # zfs create tables/db2 注: ファイルシステムを命名する場合、注意してください。異なるプール中の異なるファイルシステムが同じ名前を再使用することは可能ですが、混乱させる可能性があります。 結果は各
ヒント 4:
zfs コマンドのset オプションを使用して、各ファイルシステムのマウントポイントおよびその他のプロパティーを処理します。
情報の表示 プールとファイルシステムについての詳細情報は、 # zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT indexes 240M 110K 240M 0% ONLINE - tables 240M 110K 240M 0% ONLINE - # zfs list NAME USED AVAIL REFER MOUNTPOINT indexes 107K 208M 25.5K /indexes indexes/db1 24.5K 208M 24.5K /indexes/db1 indexes/db2 24.5K 208M 24.5K /indexes/db2 tables 107K 208M 25.5K /tables tables/db1 24.5K 208M 24.5K /indexes/db1 tables/db2 24.5K 208M 24.5K /indexes/db2 監視 監視についての詳細ディスカッションはこのドキュメントにはありませんが、ZFS 組み込みの監視機能の説明がないとこの概要の記述は完全ではありません。管理と同じ、システムを監視するコマンドが簡単です: # zpool iostat <pool_name> <interval> <count> このコマンドの作業は、オペレーティングシステムにある コマンド出力は以下のとおりです:
# zpool iostat test_pool 5 10
capacity operations bandwidth
pool used avail read write read write
---------- ----- ----- ----- ----- ----- -----
test_pool 80K 1.52G 0 7 0 153K
test_pool 80K 1.52G 0 0 0 0
test_pool 80K 1.52G 0 0 0 0
test_pool 80K 1.52G 0 0 0 0
test_pool 80K 1.52G 0 0 0 0
test_pool 80K 1.52G 0 0 0 0
test_pool 80K 1.52G 0 0 0 0
test_pool 80K 1.52G 0 0 0 0
test_pool 80K 1.52G 0 0 0 0
test_pool 80K 1.52G 0 0 0 0
その他のコマンドは、実行中の ZFS プールおよびファイルシステムのステータス、パフォーマンス、オプションおよび構成を管理者が確認するために使用できます。詳細については、 まとめ
ディスクがコントローラによって分離されているか、スタンドアロンのドライブであるか、内部または外部であるか、ハードウェア RAID コントローラによって管理されるか、あるいは特定の技術を使用して接続されるかなどの要件は、ZFS にはありません。ZFS は、Solaris OS 内のデバイスファイルとしてそれ自体のすべてまたは一部を表すすべてのストレージデバイスを管理します。例では、このガイドの情報についての状況の提供を目的としています。ZFS 機能の完全なデモンストレーションを提供するものではありません。 サンプルスクリプト以下は、カットとペースト操作によって、実例を実行できるサンプルスクリプトです。ローカル要件に合うように、太字で示されるスクリプトの内容をすべて変更してください: #!/bin/sh # This script must be run as root or as a user with appropriate # role-based access control (RBAC) privileges. ################################################################## # # Create pools # # Creating pools also creates mount points. If you do not need # more mount points than pools and the pool names are acceptable # for mount points, you need not do more than create the pools. # # Create as many pools as you want. Pools define the groups of # disks under management. All disks in a pool must be managed # in the same way (RAID-Z, mirrored, and so on), but each pool # may have a different raid level. Use pools in the same way # traditional RAID manager LUNs are used. # # Create first pool. Change the pool name (indexes), the raid flag # (raidz), and the disk names (c#t#d#) to suite your local # requirements. Read the zpool man page to determine the available # options for the raid flag. zpool create indexes raidz c2t0d0 c2t1d0 c2t2d0 c2t3d0 c4t0d0 c4t1d0 c4t2d0 c4t3d0 # Create second pool. Change the pool name (tables), the raid flag # (raidz), and the disk names (c#t#d#) to suite your local # requirements. Read the zpool man page to determine the available # options for the raid flag. zpool create tables raidz c3t0d0 c3t1d0 c3t2d0 c3t3d0 c5t0d0 c5t1d0 c5t2d0 c5t3d0 ################################################################## # # Create mounts # # Creating mounts may not be necessary as each pool forms a mount # by default. However, if you need more than one mount point per # pool, use the following commands to provide distinct mount # points based on the pools created above. All mount points have # access to the full amount of free space in the mount point's # designated pool. As any one mount point uses space, available # space for all mount points decreases. # # Create the first mount point. The mount will be in the path # shown from root unless changed later. Be sure to change the # pool name (indexes) to suit the pools created previously and the # file system name (db1) to suit your local needs. Please see # the zfs man page for information on options and settings. zfs create indexes/db1 # Create the first mount point. The mount will be in the path # shown from root unless changed later. Be sure to change the # pool name (indexes) to suit the pools created previously and the # file system name (db2) to suit your local needs. Please # see the zfs man page for information on options and settings. zfs create indexes/db2 # Create the first mount point. The mount will be in the path # shown from root unless changed later. Be sure to change # the pool name (tables) to suit the pools created previously # and the file system name (db1) to suit your local needs. # Please see the zfs man page for information on options and # settings. zfs create tables/db1 # Create the first mount point. The mount will be in the path # shown from root unless changed later. Be sure to change the # pool name (tables) to suit the pools created previously and # the file system name (db2) to suit your local needs. Please # see the zfs man page for information on options and settings. zfs create tables/db2 追加情報
2009 年 3 月:
Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License. |
BigAdmin SubscriptionsBigAdmin Areas
BigAdmin Sun Center
BigAdmin Topics | ||||||||||||||||||||