Post on 24-May-2015
description
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 1
2011/12/8(株)NTTPCコミュニケーションズ
第4回クラウドストレージ研究会
GlusterFS 技術と動向2of2
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 技術と動向 2of2
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 4
レプリケーション
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 5
block device
file system
VFS
glusterfsd
レプリケーション
block device
file system
VFS
glusterfsd
glusterfs
FUSE
VFS
A
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 6
block device
file system
VFS
glusterfsd
レプリケーション
block device
file system
VFS
glusterfsd
glusterfs
FUSE
VFS
A
glusterfsが...
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 7
block device
file system
VFS
glusterfsd
レプリケーション
block device
file system
VFS
glusterfsd
glusterfs
FUSE
VFS
A A
レプリケーションを行う
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 8
レプリケーション
brick1-2
brick2-2
brick3-2
brick4-2
レプリカ2/2
A
B
レプリカのペアはbrick単位で固定
C
brick1-1
brick2-1
brick3-1
brick4-1
レプリカ1/2
A
B
C
上記ボリューム作成例:# gluster volume create <volume> replica 2 brick1-1 brick1-2brick2-1 brick2-2 brick3-1 brick3-2 brick4-1 brick4-2
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 9
レプリケーションのデータフロー
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 10
レプリケーションのデータフロー
glusterfsdglusterfsd
glusterfs
FUSE
VFS
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 11
レプリケーションのデータフロー
glusterfsdglusterfsd
glusterfs
FUSE
VFS
A
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 12
レプリケーションのデータフロー
glusterfsdglusterfsd
glusterfs
FUSE
VFS
A
FUSEでマウントしたクライアントによるデータの入力
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 13
レプリケーションのデータフロー
glusterfsdglusterfsd
glusterfs
FUSE
VFS
A A
glusterfsプロセスがデータをレプリケーション
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 14
レプリケーションのデータフロー
glusterfsdglusterfsd
glusterfs
FUSE
VFS
A A
すべてのレプリカを同時に転送
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 15
レプリケーションのデータフロー
glusterfsdglusterfsd
glusterfs
FUSE
VFS
A
A
ネットワークの速度や遅延の影響を受ける
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 16
レプリケーションのデータフロー
glusterfsdglusterfsd
glusterfs
FUSE
VFS
A A
すべてのレプリカの転送が完了したら処理を終了
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 17
レプリケーションのデータフロー
glusterfsdglusterfsd
glusterfs
FUSE
VFS
A A
読み込み時は、 も早く応答したbrickから転送される。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 18
レプリケーションのデータフロー
glusterfsdglusterfsd
glusterfs
FUSE
VFS
A A
読み込み時は、 も早く応答したbrickから転送される。
A
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 19
レプリケーションのデータフロー
glusterfsdglusterfsd
glusterfs
FUSE
VFS
A A
A
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 20
レプリケーションのデータフロー
glusterfsdglusterfsd
glusterfs (NFSv3 サーバ)
VFS (NFSv3 クライアント)
NFSでマウントした場合
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 21
レプリケーションのデータフロー
glusterfsdglusterfsd
glusterfs (NFSv3 サーバ)
VFS (NFSv3 クライアント)
NFSでマウントした場合A
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 22
レプリケーションのデータフロー
glusterfsdglusterfsd
glusterfs (NFSv3 サーバ)
VFS (NFSv3 クライアント)
A
クライアントから転送されるデータ量はレプリカ数の影響を受けない
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 23
レプリケーションのデータフロー
glusterfsdglusterfsd
glusterfs (NFSv3 サーバ)
VFS (NFSv3 クライアント)
A A
glusterfsより先の処理についてはFUSEと同様
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 24
レプリカ障害とその対応
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 25
レプリカ障害とその対応
glusterfsd
glusterfs
glusterfsd
(a)経路断によるbrick切断
glusterfsd
glusterfs
glusterfsd
(b)glusterfsdプロセスダウンによるbrick切断
glusterfsd
glusterfs
glusterfsd
(c)サーバダウンによるbrick切断
glusterfsd
glusterfs
glusterfsd
(d)brick切断中のレプリカ不整合
想定される主な障害
……。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 26
レプリカ障害とその対応
• brick切断への対応– 42秒でのタイムアウト
• プロセスダウンのみwait無しでの切り離し
– 切断状態の記憶• 以後同一glusterfsの別セッションは待たされない
– 継続的なkeepaliveと再接続要求
• レプリカ不整合への対応– self-heal
• open(), stat(), write(), truncate(), readdir(), lookup()などがトリガ
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 27
運用面での注意点
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 28
運用面での注意点
block device
file system
VFS
glusterfsd
glusterfs
FUSE
VFS
OSやハードウェアの監視を怠らないで下さい。
glusterfsからは glusterfsdの状態しか見えない。
ファイルシステム以下で異常が起きても、glusterfsdはケアしない。
例えばread-only file systemや input-output errorは ユーザに返ってしまう。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 29
運用面での注意点
①0〜399
②400〜799
③800〜1199/path/to/fileA
768
A
A
A
A
volumeがfullになる前にadd-brickとrebalanceを。……。
ファイル生成がエラーになります。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 30
volγ
volβvolβ
volα
fsd A1 fsd A2
運用面での注意点
fsd A1
fs A1
fsd A2
クラスタA
fsd B1
fs B2
fsd B2
クラスタB
クラスタをまたがってノードを転用する場合は転用対象ノードの
/etc/glusterd/{peers,vols} 配下を削除して下さい。
ある一定の条件下で特定の操作をすると、転用先のクラスタの構成情報が汚染されます。
(転用元の構成情報が追加されてしまう)
fs A2 fs B1
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 31
FAQ
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 32
FAQ
Q. レプリカの数を変更できますか?
A. できません。どうしても、という場合は、
レプリカ数を変更したボリュームを別途作成し、データ移行を行うことになります。
他にももっと良い方法があるかもしれません。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 33
FAQ
Q. NFSマウントした場合にfcntl()やflock()が
効かないのですが。
A. 効きません。RFC 1813 のAnnexで規定するNLM (Network Lock Manager)を、
GlusterFSのNFSサーバが実装していないためです。FUSEではこれらのロックが有効です。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 34
FAQ
Q. レプリカ障害中に、レプリカ数は保たれますか?
A. 保たれません。レプリケーションを構成するノードがアクセス不能となった場合に
そのノードの代替を他のノードが務めることはありません。replace-brickを用いれば、ノードの入れ替えは可能です。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 35
FAQ
Q. マルチテナンシーを実現するには?
A. 他の手段との組み合わせが必要です。
サーバ仮想化やVLAN等を組み合わせれば、異なるユーザ同士を隔離できます。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 36
FAQ
Q. rebalanceってコスト高いですよね?
A. はい。現在上手くやる方法を考えています。
現状だと、rebalanceのstart/stopを利用して、例えば深夜帯などトラフィックの少ない時間帯のみ実行する等
運用による解決を考えています。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 37
FAQ
Q. 大の導入実績(台数)は?
A. Gluster社の公式発表には、某商用サービスPのケースで「3データセンタに6台ずつ」
とあります。…古くからある情報です。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 38
FAQ
Q. 向き不向きを教えて下さい。
A. 汎用的な用途に向いていると思います。
シンプルでイージー、それでいてPOSIX準拠のI/Fを持っているためです。
反面、ある特定用途専用の分散FSには敵いません。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 39
FAQ
Q. 「スケールアウトNAS」とどっちがいいの?
A. ノーコメントです。私自身はプログラマなので、ハードウェアプロダクトには詳しくありません。ただ「スケールアウトNAS」の機能性は
魅力的だと思っています。分散FSならハードウェアを選べるので、ベンダロックインのリスクがありません。
これをどう評価するか次第だと思います。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 40
FAQ
Q. 某分散FSとどっちがいいの?
A. ノーコメントです。用途次第だと思います。
また、SwiftやZFSのように、組み合わせて使える相性の良い分散FSもあります。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 41
まとめ
GlusterFSの技術について、一歩踏み込んでご紹介しました。
SPoFを抱えないために、レプリケーションへの対応は当然のこと、アルゴリズムによる分散やxattrによるメタデータ管理を行っています。
皆様には既にGlusterFSを導入するための十分な知識があります。ぜひ試してみて下さい。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 42
1. GlusterFSの概要と動向2. GlusterFSの技術
1. ストレージの階層構造2. 分散アルゴリズム
1. 分散アルゴリズム2. Elasticなレイアウト変更3. 特殊なケース
3. メタデータ構造4. レプリケーション
1. レプリケーション2. レプリケーションのデータフロー3. レプリカ障害とその対応
5. 運用面での注意点
3. FAQ4. まとめ
GlusterFS 技術と動向
ありがとうございました
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 43
参考
• Gluster Support
– Red Hat Networkによるサポートへ移行。
• NTTPC Gluster Support
– Glusterの正式な代理店。
– ライセンスの販売取り次ぎ。
– 日本語でのサポート。
– 日本語での構築支援。
– ご用命は storage-contact @ nttpc.co.jp まで。
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 44
参考
• 過去の活動– 第一回GlusterFS座談会
• 2011/09/14 於 株式会社プリファードインフラストラクチャー様• スライド公開中(プログラマ/ソフトウェア技術者向け)。• Ustream(録画)公開中。 -> http://www.ustream.tv/channel/glusterfs• Togetterあり。 -> http://togetter.com/li/188183
– 第?回社内Lightning Talk Nite• 2011/11/2 於 (株)NTTPCコミュニケーションズ(クローズド+招待者only)• スライド公開中(Web系プログラマ向け)。
– Internet Week 2011 仮想化DAY 「 新動向GlusterFS」• 2011/12/1 於 秋葉原• スライド公開中(インターネット/仮想化/クラウド関係者向け)。
– サービス開発者・運用者のためのGlusterFSガイド• 2011/12/5 於 (株)NTTPCコミュニケーションズ(クローズド)• スライド公開検討中。
• 今後の活動(検討・調整中)– 第二回GlusterFS座談会
• 日程未定
Copyright (C) 2011, NTTPC Communications, Inc. All Rights Reserved. 45
参考
• クリスピー・クリーム・ドーナツはクリスピー・クリーム・ドーナツ・ジャパン株式会社の登録商標です。
• 十万石まんじゅうは株式会社十万石ふくさやの登録商標です。
• Charlie and the Chocolate Factory, 2005, Warner Bros. All rights reserved.
• ビアード・パパは株式会社 麦の穂の登録商標です。