Download - GlusterFS 技術と動向 1of2
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 1
2011/12/8(株)NTTPCコミュニケーションズ
第4回クラウドストレージ研究会
GlusterFS 技術と動向1of2
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 2
発表者の紹介
高橋 敬祐 (TAKAHASHI Keisuke)
(個人用)Twitter ID : @keithseahus
• NTTPCコミュニケーションズ在籍 (2006年〜)
– Webマイニング系開発
– 分散FS特にGlusterFSの調査,研究,それを利用した開発及びOSS活動
– 宇宙航空関連実証実験及び開発
– その他先端技術調査 • 出入りしている勉強会
– VIOPS
– クラウドネットワーク研究会
– クラウドストレージ研究会
– Tokyo Erlang Workshop
– その他
• この界隈で特に関係の深い人
– 伊藤氏 ( @thatsdone )
– STEC 伊藤氏 ( @HarrisonIto )
– NTTPC 中冨 ( @nakacya )
– NTTPC 高田 ( @mikiT_T )
Google Groups: http://groups.google.com/group/gluster-ja
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 3
1. GlusterFSの概要と動向2. GlusterFSの技術
1. ストレージの階層構造2. 分散アルゴリズム
1. 分散アルゴリズム2. Elasticなレイアウト変更3. 特殊なケース
3. メタデータ構造4. レプリケーション
1. レプリケーション2. レプリケーションのデータフロー3. レプリカ障害とその対応
5. 運用面での注意点
3. FAQ4. まとめ
GlusterFS 技術と動向 1of2
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 4
GlusterFSの概要と動向
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 5
GlusterFSの概要と動向
@doryokujin
さんの もオススメ!
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 6
ストレージの階層構造
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 7
ストレージの階層構造
block device
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 8
ストレージの階層構造
block device
file system
GlusterFSはblock deviceを直接管理することはできません。(カーネル空間のファイルシステムではありません。)
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 9
ストレージの階層構造
block device
file system
VFS
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 10
ストレージの階層構造
block device
file system
VFS
glusterfsd
GlusterFSはカーネル空間ファイルシステムの上で動作します。下位のファイルシステムへの操作はglusterfsdが行います。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 11
ストレージの階層構造
block device
file system
VFS
glusterfsd
glusterfs
glusterfsがglusterfsdへの命令を実行します。glusterfs-glusterfsd間はデフォルトではTCP/IPで接続されます。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 12
ストレージの階層構造
block device
file system
VFS
glusterfsd
glusterfs
FUSE
glusterfsにはFUSEとのI/Fがあります。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 13
ストレージの階層構造
block device
file system
VFS
glusterfsd
glusterfs
FUSE
VFS
そのため、POSIX準拠のファイルシステムとしてマウントすることができます。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 14
ストレージの階層構造
block device
file system
VFS
glusterfsd
glusterfs
FUSE
VFS
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 15
分散アルゴリズム
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 16
分散アルゴリズム
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 17
分散アルゴリズム
①0〜399
②400〜799
③800〜1199
注)ハッシュ値及びbrick名は説明のために簡略化してあります。以下同じ。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 18
分散アルゴリズム
①0〜399
②400〜799
③800〜1199/path/to/fileA
768
A
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 19
分散アルゴリズム
①0〜399
②400〜799
③800〜1199/path/to/fileA
768
A
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 20
Elasticなレイアウト変更
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 21
Elasticなレイアウト変更
①0〜399
②400〜799
③800〜1199
①0〜299
②300〜599
③600〜899
④900〜1199
古いハッシュテーブル(3 bricks)
新しいハッシュテーブル(4 bricks)
A
brick追加直後の状態(gluster volume add-brick ④)
既存データの読み書きは 古いハッシュテーブルに基づき
実行される。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 22
Elasticなレイアウト変更
①0〜399
②400〜799
③800〜1199
①0〜299
②300〜599
③600〜899
④900〜1199
古いハッシュテーブル(3 bricks)
新しいハッシュテーブル(4 bricks)
/path/to/fileB 1024
A
B
新規ファイルの作成には新しいハッシュテーブルを使う
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 23
Elasticなレイアウト変更
①0〜399
②400〜799
③800〜1199
①0〜299
②300〜599
③600〜899
④900〜1199
古いハッシュテーブル(3 bricks)
新しいハッシュテーブル(4 bricks)
/path/to/fileB 1024
A
BB
新規ファイルの作成には新しいハッシュテーブルを使う
リンク先brickの書かれた スパースファイル
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 24
Elasticなレイアウト変更
①0〜399
②400〜799
③800〜1199
①0〜299
②300〜599
③600〜899
④900〜1199
古いハッシュテーブル(3 bricks)
新しいハッシュテーブル(4 bricks)
A
BB
rebalanceを実行(gluster volume rebalance <volume> start)
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 25
Elasticなレイアウト変更
①0〜399
②400〜799
③800〜1199
①0〜299
②300〜599
③600〜899
④900〜1199
古いハッシュテーブル(3 bricks)
新しいハッシュテーブル(4 bricks)
A
BB
rebalanceを実行(gluster volume rebalance <volume> start)
A
リンク先brickの書かれた スパースファイル
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 26
Elasticなレイアウト変更
①0〜399
②400〜799
③800〜1199
①0〜299
②300〜599
③600〜899
④900〜1199
古いハッシュテーブル(3 bricks)
新しいハッシュテーブル(4 bricks)
A
BB
A
リンク先brickの書かれた スパースファイル
rebalanceを実行中...
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 27
Elasticなレイアウト変更
①0〜399
②400〜799
③800〜1199
①0〜299
②300〜599
③600〜899
④900〜1199
古いハッシュテーブル(3 bricks)
新しいハッシュテーブル(4 bricks)
A
BB
rebalanceを実行中...
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 28
Elasticなレイアウト変更
①0〜399
②400〜799
③800〜1199
①0〜299
②300〜599
③600〜899
④900〜1199
古いハッシュテーブル(3 bricks)
新しいハッシュテーブル(4 bricks)
A
BB
rebalanceを実行中...
/path/to/fileC 384C
rebalance中のファイル生成処理は...
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 29
Elasticなレイアウト変更
①0〜399
②400〜799
③800〜1199
①0〜299
②300〜599
③600〜899
④900〜1199
古いハッシュテーブル(3 bricks)
新しいハッシュテーブル(4 bricks)
A
BB
rebalanceを実行中...
/path/to/fileC 384
C
C
rebalance実行前と同様
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 30
Elasticなレイアウト変更
①0〜399
②400〜799
③800〜1199
①0〜299
②300〜599
③600〜899
④900〜1199
古いハッシュテーブル(3 bricks)
新しいハッシュテーブル(4 bricks)
A
BB
C
C
rebalance完了
古いハッシュテーブルを破棄
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 31
Elasticなレイアウト変更
①0〜299
②300〜599
③600〜899
④900〜1199
C
B
BA
C
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 32
特殊なケース
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 33
特殊なケース
①0〜399
②400〜799
③800〜1199
一部brickがdisk full!!
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 34
特殊なケース
①0〜399
②400〜799
③800〜1199/path/to/fileA
768
A そこへ新規ファイル作成
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 35
特殊なケース
①0〜399
②400〜799
③800〜1199/path/to/fileA
768
A
A
リンク付きスパースファイル
実体は書き込み可能な brickへ
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 36
メタデータ構造
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 37
メタデータ構造
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 38
メタデータ構造
メタデータ (xattr)
(実)データ
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 39
メタデータ構造
block device
file system
VFS
glusterfsd
glusterfs
FUSE
VFS
A
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 40
メタデータ構造
block device
file system
VFS
glusterfsd
glusterfs
FUSE
VFS
A
glusterfsがxattrを記述 (するようにglusterfsdに命令)
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 41
メタデータ構造
block device
file system
VFS
glusterfsd
glusterfs
FUSE
VFS
A
glusterfsdがfile system上にxattrを記述
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 42
メタデータ構造
block device
file system
VFS
glusterfsd
glusterfs
FUSE
VFS
A B
glusterfsを 経由しないと xattrが付与 されない!
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 43
メタデータ構造
block device
file system
VFS
glusterfsd
glusterfs
FUSE
VFS
A B
原則、GlusterFS経由では アクセスできない。
但し、ディレクトリエントリとして 見えてしまう場合もある。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 44
メタデータ構造
ディレクトリに付与されるxattr trusted.gfid
trusted.glusterfs.dht trusted.glusterfs.test
ファイルに付与されるxattr trusted.gfid
trusted.afr.<volume>-client-<number> trusted.afr.<volume>-client-<number++>
trusted.<volume>-stripe-<number>.stripe-count trusted.<volume>-stripe-<number>.stripe-index