GlusterFS

まえおき

  • iSCSI+ZFSで組んだNASは規模の縮小ができなかった
  • それ、オブジェクトストレージで良くない・・・

GlusterFS

  • Storage Pool
    • 所謂クラスタ
    • 全てのサーバはこのStorage Poolに属さなければならない
  • Brick
  • Volume
    • 仮想なVolumeで、クライアントがマウントするもの
    • 3タイプあるらしい
    • Distributed
      • 所謂JBOD。ただBrickを順に使っていく
    • Striped
      • 所謂RAID0。一つのファイルを分散書き込み
    • Replicated
      • 所謂RAID1。ただし、レプリカ数(複製数)を指定出来る

一般的な話

  • 名前を引けるようにDNS or hostsに登録しておきましょう
192.168.251.1 pc0252
192.168.251.2 pc0253
192.168.251.3 pc0257
  • 公開用のディレクトリ(Brick)を準備しておきましょう
    • 「XFS(オススメ)とext4以降が使える」らしい
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

記事編集中に見つけた面白いバグ

f:id:nmfproducer:20150323044514p:plain
ブログ編集画面のタイトル欄、"F"が先頭の時、その文字が消えている。
試した限りでは、その他の英大文字が先頭の時は正しく表示される。
しかし例えば先頭が"aF"等の場合でも、Fの文字は表示されない。
CSSでフォントサイズを16ptから15ptに変更すると表示されたので、レンダリングの都合かもしれない。
なお、環境は(ちょっと古い) SRWare Iron 38.0.2050.0 (295000) で起こり、(新しめの)Chrome 41.0.2272.89 では起こらなかったことを確認した。

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を実際に用いた感想やベンチマーク結果から、その効果について定性的に述べる。

続きを読む

SSG5を使おう


はじめに

SSGとは

Juniper社が販売しているSecure Service Gatewayという箱。ファイアーウォールやVPNルーターとしても使用できる便利なやつです。中身はScreenOSで、基本的にWebブラウザを用いた設定画面でポチポチやるだけで設定ができ、初心者も安心である。

SSG5は、小規模支店、在宅勤務環境、社内配備に適したセキュリティ専用ポート固定型プラットフォームです。ステートフル・ファイアウォールトラフィック160Mbps、IPsec VPNスループット40Mbpsを実現します。

SSGシリーズ セキュア・サービス・ゲートウェイ - Juniper Networks
続きを読む