GlusterFS
GlusterFS
一般的な話
- 名前を引けるようにDNS or hostsに登録しておきましょう
192.168.251.1 pc0252 192.168.251.2 pc0253 192.168.251.3 pc0257
sudo mkfs.xfs -f /dev/sdb1 sudo bash -c "echo '/dev/sdb1 /data xfs defaults 0 0' >> /etc/fstab" sudo mkdir /data sudo mount /data
-
- マウントポイント直下だと(利便性から?lost+foundができるから?)Brick指定出来ないので(forceをつければ別)適当にフォルダ作っておきましょう
sudo mkdir /data/brick
volume create: v1: failed: Staging failed on pc0257. Error: The brick pc0257:/data is a mount point. Please create a sub-directory under the mount point and use that as the brick directory. Or use 'force' at the end of the command if you want to override this behavior.
Staging failed on pc0253. Error: The brick pc0253:/data is a mount point. Please create a sub-directory under the mount point and use that as the brick directory. Or use 'force' at the end of the command if you want to override this behavior.
CentOSでGlusterFS作成
サーバ側:パッケージインストール~Storage Pool作成
- GlusterFSのレポジトリ入れるために2回に分けて。
sudo yum install centos-release-gluster sudo yum install glusterfs-server
- サービス起動&自動起動
sudo systemctl start glusterd sudo systemctl enable glusterd
- ピア追加 (1つのサーバから。この例はpc0252から)
sudo gluster peer probe pc0253 sudo gluster peer probe pc0257
それぞれ
peer probe: success.
と出ればOK
- ステータス確認
$ sudo gluster peer status Number of Peers: 2 Hostname: pc0253 Uuid: 42c2b6ec-07f1-4ecb-bb86-d8174c12e46f State: Peer in Cluster (Connected) Hostname: pc0257 Uuid: 3aeb496e-2055-47fa-9ed7-8091e7b8f07a State: Peer in Cluster (Connected)
volumeの作成
- 各サーバのbrickを指定
sudo gluster volume create v1 pc0253:/data/brick pc0257:/data/brick
- volumeを開始
sudo gluster volume start v1
- status
$ sudo gluster volume status Status of volume: v1 Gluster process TCP Port RDMA Port Online Pid ------------------------------------------------------------------------------ Brick pc0253:/data/brick 49152 0 Y 36542 Brick pc0257:/data/brick 49152 0 Y 44440 Task Status of Volume v1 ------------------------------------------------------------------------------ There are no active volume tasks
クライアントからの接続
- glusterfs(Native)で接続する時は[Storage Poolの誰か]:/[Volume名]でOK
sudo mkdir -p /glusterfs/v1 sudo mount -t glusterfs pc0252:/v1 /glusterfs/v1
- Nativeの時は全てのStorage Poolと通信する
- NFSv3の時は特定サーバが中継を行う
オペレーション
fioで適当にファイルを書き込む
$ cat glusterfs.fio [Sequential-Read] rw=read directory=/glusterfs/v1/ size=1g [Sequential-Write] rw=write directory=/glusterfs/v1/ size=1g [Random-Read] rw=randread directory=/glusterfs/v1/ size=100m [Random-Write] rw=randwrite directory=/glusterfs/v1/ size=100m $ sudo /usr/local/bin/fio --loops 10 glusterfs.fio (snip) Run status group 0 (all jobs): READ: bw=54.8MiB/s (57.5MB/s), 4996KiB/s-307MiB/s (5116kB/s-322MB/s), io=10.0GiB (11.8GB), run=33378-204949msec WRITE: bw=50.6MiB/s (53.0MB/s), 38.6MiB/s-46.1MiB/s (40.4MB/s-48.3MB/s), io=10.0GiB (11.8GB), run=25931-222187msec
brickの削除
- remove-brickはtransactionになっている。削除したいvolume/brickを書いてstart
$ sudo gluster volume remove-brick v1 pc0257:/data/brick start volume remove-brick start: success ID: 6c25702e-71b9-49e7-be85-293cd46d89ac
- statusを見て、completedになっている事を確認
$ sudo gluster volume remove-brick v1 pc0257:/data/brick status Node Rebalanced-files size scanned failures skipped status run time in h:m:s --------- ----------- ----------- ----------- ----------- ----------- ------------ -------------- pc0257 2 200.0MB 2 0 0 completed 0:00:01
- commit
$ sudo gluster volume remove-brick v1 pc0257:/data/brick commit Removing brick(s) can result in data loss. Do you want to Continue? (y/n) y volume remove-brick commit: success Check the removed bricks to ensure all files are migrated. If files with data are found on the brick path, copy them via a gluster mount point before re-purposing the removed brick.
brickの追加
- add-brickするのみ
$ sudo gluster volume add-brick v1 pc0257:/data/brick volume add-brick: success
- brickに既に関連ファイルがある場合エラーになる
volume add-brick: failed: Pre Validation failed on pc0257. /data/brick is already part of a volume
オブジェクト再配置
$ sudo gluster volume rebalance v1 start volume rebalance: v1: success: Rebalance on v1 has been started successfully. Use rebalance status command to check status of the rebalance process. ID: 3af74639-7171-4c10-bfb5-15254924caa1 $ sudo gluster volume status Status of volume: v1 Gluster process TCP Port RDMA Port Online Pid ------------------------------------------------------------------------------ Brick pc0253:/data/brick 49152 0 Y 36542 Brick pc0257:/data/brick 49152 0 Y 44729 Task Status of Volume v1 ------------------------------------------------------------------------------ Task : Rebalance ID : 3af74639-7171-4c10-bfb5-15254924caa1 Status : completed
Ref
CacheCade の効果
はじめに
CacheCade とは
LSI社のRAIDカード MegaRAID のオプショナルライセンスとして提供される、SSDをHDDアレイのキャッシュとして用いる技術である。データをキャッシュすることでIOPSの向上とレイテンシ減少の効果があるとうたっている。
When IT pushes hard disk drives (HDD) arrays to reach their I/O potential, data “hot spots” become inevitable. Utilizing a small solid state drive (SSD) investment as a front-side flash cache for the much larger disk array, LSI® MegaRAID® CacheCade® Pro 2.0 software dynamically keeps the “hottest” data in flash memory. This can dramatically improve read/write speeds and drop latency.
http://www.lsi.com/products/raid-controllers/pages/megaraid-cachecade-pro-software.aspx
このエントリの目標
CacheCadeを実際に用いた感想やベンチマーク結果から、その効果について定性的に述べる。