1.OSのインストール(省略)
2.componentをインストール
iSCSI initiator install
multipath install
3.関連ファイルを編集
4.Nimbleに接続
5.接続確認
6.切断用コマンド
7.よく使うコマンド
-------------------------
今回の検証環境:
OS:ubuntu 14.04.1(64-bit)
#uname -a
Linux ubuntu01 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
※準備:
root権限に切り替え
ists@ubuntu01:~$ sudo -i
[sudo] password for summer:
2.componentをインストール
2-1.iSCSI initiator install
#sudo apt install open-iscsi
2-2.multipath install
#apt-get install multipath-tools
(install例.....)
root@ubuntu01:~# apt-get install multipath-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
kpartx libaio1
Suggested packages:
multipath-tools-boot
The following NEW packages will be installed:
kpartx libaio1 multipath-tools
0 upgraded, 3 newly installed, 0 to remove and 193 not upgraded.
Need to get 161 kB of archives.
After this operation, 837 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://jp.archive.ubuntu.com/ubuntu/ trusty/main libaio1 amd64 0.3.109-4 [6,364 B]
Get:2 http://jp.archive.ubuntu.com/ubuntu/ trusty-updates/main kpartx amd64 0.4.9-3ubuntu7.13 [22.8 kB]
Get:3 http://jp.archive.ubuntu.com/ubuntu/ trusty-updates/main multipath-tools a md64 0.4.9-3ubuntu7.13 [131 kB]
Fetched 161 kB in 0s (2,121 kB/s)
Selecting previously unselected package libaio1:amd64.
(Reading database ... 55923 files and directories currently installed.)
Preparing to unpack .../libaio1_0.3.109-4_amd64.deb ...
Unpacking libaio1:amd64 (0.3.109-4) ...
Selecting previously unselected package kpartx.
Preparing to unpack .../kpartx_0.4.9-3ubuntu7.13_amd64.deb ...
Unpacking kpartx (0.4.9-3ubuntu7.13) ...
Selecting previously unselected package multipath-tools.
Preparing to unpack .../multipath-tools_0.4.9-3ubuntu7.13_amd64.deb ...
insmod /lib/modules/3.13.0-32-generic/kernel/drivers/scsi/device_handler/scsi_dh.ko
insmod /lib/modules/3.13.0-32-generic/kernel/drivers/md/dm-multipath.ko
Unpacking multipath-tools (0.4.9-3ubuntu7.13) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up libaio1:amd64 (0.3.109-4) ...
Setting up kpartx (0.4.9-3ubuntu7.13) ...
Setting up multipath-tools (0.4.9-3ubuntu7.13) ...
successfully reset wwids
* Starting multipath daemon multipathd [ OK ]
3.関連ファイルを編集
3-1.iSCSI config fileを編集
#vi /etc/iscsi/iscsid.conf
「iscsid.conf」中の設定値を以下のように変更。
node.startup = automatic
# For multipath configurations, you may want more than one session to be
# created on each iface record. If node.session.nr_sessions is greater
# than 1, performing a 'login' for that node will ensure that the
# appropriate number of sessions is created.
node.session.nr_sessions = 1→2
※変更必要ないと思いますけど....
# To specify the length of time to wait for session re-establishment
# before failing SCSI commands back to the application when running
# the Linux SCSI Layer error handler, edit the line.
# The value is in seconds and the default is 120 seconds.
node.session.timeo.replacement_timeout = 120
# Time interval to wait for on connection before sending a ping.
node.conn[0].timeo.noop_out_interval = 5
# To specify the time to wait for a Nop-out response before failing
# the connection, edit this line. Failing the connection will
# cause IO to be failed back to the SCSI layer. If using dm-multipath
# this will cause the IO to be failed to the multipath layer.
node.conn[0].timeo.noop_out_timeout = 5→10
適用するに、再起動
#/etc/init.d/open-iscsi restart
3-2.multipath.conf 編集
最初にmultipath.confファイルがないので、コピーします。(Linuxにより、ファイル場所が異なる場合があります。)
#cp /usr/share/doc/multipath-tools/examples/multipath.conf.synthetic /etc/multipath.conf
#vi /etc/multipath.conf
■Example multipath.conf for Linux kernel 2.6.18.x
device {
vendor "Nimble"
product "Server"
path_selector "round-robin 0"
features "1 queue_if_no_path"
dev_loss_tmo infinity
fast_io_fail_tmo 1
prio_callout "/sbin/mpath_prio_alua /dev/%n"
path_grouping_policy group_by_prio
path_checker tur
hardware_handler "1 alua"
rr_min_io 20
failback 10
rr_weight priorities
}
■Example multipath.conf for Linux kernel 2.6.32.x and above
device {
vendor "Nimble"
product "Server"
rr_weight priorities
path_grouping_policy group_by_prio
rr_min_io_rq 20
failback 10
path_selector "round-robin 0"
path_checker "tur"
hardware_handler "1 alua"
features "1 queue_if_no_path"
prio "alua"
dev_loss_tmo infinity
fast_io_fail_tmo 1
}
・multipath.confの設定値を適用するにservice 再起動
#service multipath-tools stop
#service multipath-tools start
4.Nimbleに接続
4-1.Get iSCSI initiator name
#cat /etc/iscsi/initiatorname.iscsi
※Nimbleにinitiator groupを設定するため
root@ubuntu01:~# cat /etc/iscsi/initiatorname.iscsi
## DO NOT EDIT OR REMOVE THIS FILE!
## If you remove this file, the iSCSI daemon will not start.
## If you change the InitiatorName, existing access control lists
## may reject this initiator. The InitiatorName must be unique
## for each iSCSI initiator. Do NOT duplicate iSCSI InitiatorNames.
InitiatorName=iqn.1993-08.org.debian:01:bf56f1fbbb1d
4-2.discovery nimble volume
#iscsiadm –m discovery –t st –p 10.222.10.88
root@ubuntu01:/usr/share/doc/multipath-tools/examples# iscsiadm -m discovery -t st -p 10.222.10.88
10.100.10.89:3260,2460 iqn.2007-11.com.nimblestorage:gundam-af3000-g6f21144ca7c08357
10.200.10.89:3260,2460 iqn.2007-11.com.nimblestorage:gundam-af3000-g6f21144ca7c08357
10.100.10.88:3260,2460 iqn.2007-11.com.nimblestorage:ubuntu-vol1-v6f21144ca7c08357.00000010.c8e1971b
10.200.10.88:3260,2460 iqn.2007-11.com.nimblestorage:ubuntu-vol1-v6f21144ca7c08357.00000010.c8e1971b
4-3. login nimble
# iscsiadm -m node -T iqn.2007-11.com.nimblestorage:ubuntu-vol1-v6f21144ca7c08357.00000010.c8e1971b 10.100.10.88:3260 --login
Logging in to [iface: default, target: iqn.2007-11.com.nimblestorage:ubuntu-vol1-v6f21144ca7c08357.00000010.c8e1971b, portal: 10.200.10.88,3260] (multiple)
Logging in to [iface: default, target: iqn.2007-11.com.nimblestorage:ubuntu-vol1-v6f21144ca7c08357.00000010.c8e1971b, portal: 10.100.10.88,3260] (multiple)
Login to [iface: default, target: iqn.2007-11.com.nimblestorage:ubuntu-vol1-v6f21144ca7c08357.00000010.c8e1971b, portal: 10.200.10.88,3260] successful.
Login to [iface: default, target: iqn.2007-11.com.nimblestorage:ubuntu-vol1-v6f21144ca7c08357.00000010.c8e1971b, portal: 10.100.10.88,3260] successful.
4-4. iSCSI target login確認
# iscsiadm -m session
tcp: [17] 10.200.10.88:3260,2460 iqn.2007-11.com.nimblestorage:ubuntu-vol1-v6f21144ca7c08357.00000010.c8e1971b
tcp: [18] 10.100.10.88:3260,2460 iqn.2007-11.com.nimblestorage:ubuntu-vol1-v6f21144ca7c08357.00000010.c8e1971b
#iscsiadm -m node
10.200.10.88:3260,2460 iqn.2007-11.com.nimblestorage:ubuntu-vol1-v6f21144ca7c08357.00000010.c8e1971b
10.100.10.88:3260,2460 iqn.2007-11.com.nimblestorage:ubuntu-vol1-v6f21144ca7c08357.00000010.c8e1971b
10.100.10.89:3260,2460 iqn.2007-11.com.nimblestorage:gundam-af3000-g6f21144ca7c08357
10.200.10.89:3260,2460 iqn.2007-11.com.nimblestorage:gundam-af3000-g6f21144ca7c08357
5.接続確認
5-1.multipath 確認
# multipath -ll
20ce2a7a6859813b66c9ce9001b97e1c8 dm-2 Nimble ,Server
size=100G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=130 status=active
|- 19:0:0:0 sdc 8:32 active ready running
`- 20:0:0:0 sdb 8:16 active ready running
6.nimbleのvolumeと切断
# iscsiadm -m node --logout all
Logging out of session [sid: 17, target: iqn.2007-11.com.nimblestorage:ubuntu-vol1-v6f21144ca7c08357.00000010.c8e1971b, portal: 10.200.10.88,3260]
Logging out of session [sid: 18, target: iqn.2007-11.com.nimblestorage:ubuntu-vol1-v6f21144ca7c08357.00000010.c8e1971b, portal: 10.100.10.88,3260]
Logout of [sid: 17, target: iqn.2007-11.com.nimblestorage:ubuntu-vol1-v6f21144ca7c08357.00000010.c8e1971b, portal: 10.200.10.88,3260] successful.
Logout of [sid: 18, target: iqn.2007-11.com.nimblestorage:ubuntu-vol1-v6f21144ca7c08357.00000010.c8e1971b, portal: 10.100.10.88,3260] successful.
7.よく使うコマンド
#fdisk –l
#iscsiadm –m discovery –t st –p <iSCSI discovery IP>
#iscsiadm –m node –T <iSCSI node name> <iscsi discovery IP address>:3260 --login
#iscsiadm –m node
#iscsiadm –m session
#iscsiadm –m node –logout all
#multipath -ll
#multipath -r
----------------------------
・nimbleの設定
Nimble OS $ ip --list
---------------+---------+------+----------+---------------+--------------------
IP Address NIC Status Type Array Controller
---------------+---------+------+----------+---------------+--------------------
10.100.10.88 tg1 up discovery gundam-afa A
10.100.10.89 tg1 up data gundam-afa A
10.200.10.88 tg2 up discovery gundam-afa A
10.200.10.89 tg2 up data gundam-afa A
10.222.10.88 eth1 up management gundam-afa A
10.222.10.89 eth1 up support gundam-afa A
10.222.10.90 eth1 up support gundam-afa B