Bah humbug!
世間では天皇誕生日の次の日などが執り行われたようですが、
「わあい、
というわけで2012年最後のレシピは、
ストレージ王に、俺はなる!
ioDrive2とは簡単に言ってしまえば、
なおこのモデルはPCIe x8のバスと、
デバイスドライバをインストールする
ioDrive2はSATAのHDDなどとは異なり、
ドライバとユーティリティは、
まず、
ドライバのソースコードは
- iomemory-vsl-3.
2.0-34-generic_ 3. 2.2. 869-1. 0_ amd64. deb - iomemory-vsl-config-3.
2.0-34-generic_ 3. 2.2. 869-1. 0_ amd64. deb - iomemory-vsl-source_
3. 2.2. 869-1. 0_ amd64. deb
パッケージの作成ができたら、
$ sudo apt-get install fakeroot build-essential debhelper $ tar zxvfiomemory-vsl_3.2.2.869-1.0.tar.gz $ cd iomemory-vsl-3.2.2.869 $ dpkg-buildpackage -rfakeroot -b
$ sudo dpkg -i iomemory-vsl-3.2.0-34-generic_3.2.2.869-1.0_amd64.deb fio-util_3.2.2.869-1.0_amd64.deb fio-common_3.2.2.869-1.0_amd64.deb libvsl_3.2.2.869-1.0_amd64.deb
デバイスのチェックとモジュールのロード
インストールが完了したら、
$ sudo fio-pci-check
Root Bridge PCIe 18250 MB/sec needed max
Bridge 00:02.02 (03-07) (8086:3c06)
* Needed 4000 MB/sec Avail 4000 MB/sec
Bridge 03:00.00 (04-07) (1aed:2100)
* Needed 4000 MB/sec Avail 4000 MB/sec
Slot Power limit: 25.0W (25000mw)
clearing corr_err_status_reg (0x2000)
Bridge 04:05.00 (06-06) (1aed:2100)
Needed 2000 MB/sec Avail 2000 MB/sec
clearing corr_err_status_reg (0x2000)
ioDrive 06:00.0 (2001) Firmware 109322
Slot Power limit: 25.0W (25000mw)
Bridge 04:06.00 (07-07) (1aed:2100)
Needed 2000 MB/sec Avail 2000 MB/sec
clearing corr_err_status_reg (0x2000)
ioDrive 07:00.0 (2001) Firmware 109322
Slot Power limit: 25.0W (25000mw)
次に、
$ sudo modprobe iomemory-vsl
$ sudo fio-status
Found 2 ioMemory devices in this system with 1 ioDrive Duo
Driver version: 3.2.2 build 869
Adapter: Dual Controller Adapter
Fusion-io ioDrive2 Duo 2.41TB, Product Number:***-***-****-**-****, SN:*********, FIO SN:*********
PCIe Power limit threshold: 24.75W
Connected ioMemory modules:
fct0: SN:*********-****
fct1: SN:*********-****
fct0 Status unknown: Driver is in MINIMAL MODE:
The firmware on this device is not compatible with the currently installed version of the driver
SN:*********-****
!! ---> There are active errors or warnings on this device! Read below for details.
Located in slot 1 Lower of ioDrive2 Adapter Controller SN:*********
PCI:06:00.0, Slot Number:43
Firmware v7.0.2, rev 108609 Public
Geometry and capacity information not available.
Internal temperature: 46.26 degC, max 46.26 degC
ACTIVE WARNINGS:
The ioMemory is currently running in a minimal state.
fct1 Status unknown: Driver is in MINIMAL MODE:
The firmware on this device is not compatible with the currently installed version of the driver
SN:*********-****
!! ---> There are active errors or warnings on this device! Read below for details.
Located in slot 0 Upper of ioDrive2 Adapter Controller SN:*********
PCI:07:00.0, Slot Number:43
Firmware v7.0.2, rev 108609 Public
Geometry and capacity information not available.
Internal temperature: 48.23 degC, max 48.72 degC
ACTIVE WARNINGS:
The ioMemory is currently running in a minimal state.
ファームウェアのアップデート
前節のように、
モジュールをロードした段階で、
ファームウェアは拡張子が
またファームウェアのアップデートには、
$ sudo fio-detach /dev/fct0 $ sudo fio-detach /dev/fct1 $ sudo fio-update-iodrive fusion_3.2.2-20121025.fff
ioDrive2のフォーマット
使用を開始する前に、
$ sudo fio-format /dev/fct0 /dev/fct0: Creating block device. Block device of size 1205.00GBytes (1122.24GiBytes). Using default block (sector) size of 512 bytes. WARNING: Formatting will destroy any existing data on the device! Do you wish to continue [y/n]? y Formatting: [====================] (100%) - /dev/fct0 - format successful. $ sudo fio-format /dev/fct1 (...略...)
フォーマットの際には、
ここで問題になるのが、
工場出荷時のioDrive2は、
| ブロックサイズ | 1GBあたりの消費メモリ |
|---|---|
| 8192 | 1. |
| 4096 | 2. |
| 2048 | 5. |
| 1024 | 11MB |
| 512 | 22MB |
$ sudo fio-format -b 4K /dev/fct0
筆者はioDriveの消費メモリと累積読み書きバイト数を計測するmuninプラグインを自作して、
①は、
②は、
③は、
④は、
アタッチとRAIDの構成
フォーマットが完了したら、
$ sudo fio-attach /dev/fct0 $ sudo fio-attach /dev/fct1 $ sudo fio-status (...略...) fct0 Attached (...略...) fioa State: Online, Type: block device (...略...) fct1 Attached (...略...) fiob State: Online, Type: block device
標準ではシステムの起動時に、
options iomemory-vsl auto_attach=0
ioDrive2のセッティングはこれで完了ですが、
$ sudo apt-get install mdadm
$ sudo mdadm --create /dev/md0 --chunk=256 --level=0 --raid-devices=2 /dev/fioa /dev/fiob
mdadm: /dev/fioa1 appears to be part of a raid array:
level=raid0 devices=2 ctime=Fri Dec 14 16:07:01 2012
mdadm: /dev/fiob1 appears to be part of a raid array:
level=raid0 devices=2 ctime=Fri Dec 14 16:07:01 2012
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
作成したアレイのベンチマークを取ってみました。書き込みベンチマークはドライブがまっさらな状態でないと取れないため、
読み書きともに2500MB/
このアレイは2TBを越えているので、
ioDrive2をSwapにする
「ioDriveを積むくらいなら、
そう思う人もいるかもしれません。たしかに一度メモリ上にデータが乗ってしまえば、
前述の通り、
まずスワップとして使用するioDriveデバイスのシリアルナンバーを調べます。その値を、
複数のデバイスをスワップとして使いたい場合は、
$ sudo fio-status -Fiom.serial_number /dev/fct1 *********-1111
options iomemory-vsl preallocate_memory=*********-1111
サーバーを再起動したあとは、
$ sudo fdisk /dev/fiob
$ sudo mkswap /dev/fiob1
$ sudo swapon /dev/fiob1
$ free
total used free shared buffers cached
Mem: 41155412 34542800 6612612 0 40040 190532
-/+ buffers/cache: 34312228 6843184
Swap: 1176756784 0 1176756784
preallocate_
たとえば512バイト/ブロックでフォーマットされた1.
①は、
②は、
スワップを作る際のioDriveのブロックサイズに制限はないため、
さて、来年のレシピは?
このように、
さて、
お気づきかと思いますが、
それではみなさま、