ISCSI軟件。
StarWind 是一個獨立於硬件,適合網吧、企業虛擬磁盤數據管理。速度非常的快!
成本效益和可升級的存儲管理解決方案,能夠得到存儲區域網絡的好處,如:增強的災難恢復和提高的調整柔量,不消耗額外的資源在程序服務器上。 StarWind 不需要額外的硬件,它利用現有的以太網和IP網絡基礎和有效利用現有的存儲硬件。
StarWind的快照功允許簡易的預定或要求關鍵數據的快照未備份。如果必需,所有的備份數據可被找回,會只找回需要的個人文件。 StarWind的獨特的能力去virtualize和共享物理的硬件,意味着不需要去擁有一個昂貴的DLT 錄音帶或高容量的藍光(Blu-Ray)或 HD-DVD 刻錄器附屬在每台機器上。
ISCSI使用
1.在服務器上安裝了iSCSI initiator以及iscsiadm。
[root@rhel6-5x64-8-66 ~]# rpm –ivh iscsi-initiator-utils-6.2.0.742-0.5.el5.i386.rpm
2.iscsiadm是基於命令行的iscsi管理工具,提供了對iSCSI節點、會話、連接以及發現記錄的操作。iscsiadm的使用說明可以查看/usr/share/doc/iscsi-initiator-utils-6.2.0.742/README,也可以運行man iscsiadm或iscsiadm --help使用。
3.連接iscsi設備的步驟:
3.1 啟動iscsi守護進程
service iscsi start 默認情況下,系統啟動后此進程會自動運行
3.2 發現有哪些共享盤可以連接
iscsi發起方和目標方之間通過端口3260連接,已知iscsi的目標方IP是10.12.9.1,運行下列命令:
[root@rhel6-5x64-8-66 ~]# chkconfig iscsi on
[root@rhel6-5x64-8-66 ~]# chkconfig iscsi --list (查看ISCSI啟動狀態)
iscsi 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@rhel6-5x64-8-66 ~]# iscsiadm -m discovery -t sendtargets -p 10.12.9.1:3260
10.12.9.1:3260,-1 iqn.2008-08.com.starwindsoftware:pub-9001-gdisk
10.12.9.1:3260,-1 iqn.2008-08.com.starwindsoftware:pub-9001-100g-2
10.12.9.1:3260,-1 iqn.2008-08.com.starwindsoftware:pub-9001-hanjun
10.12.9.1:3260,-1 iqn.2008-08.com.starwindsoftware:pub-9001-100gdisk
此時找到多個共享盤可以連接。
10.12.9.1:3260,-1 iqn.2008-08.com.starwindsoftware:pub-9001-hanjun 就是其中一個,我們等下就連接這個iscsi共享盤。
3.3 連接iscsi共享盤
[root@rhel6-5x64-8-66 ~]# iscsiadm -m node -T iqn.2008-08.com.starwindsoftware:pub-9001-hanjun -p 10.12.9.1 -l
Logging in to [iface: default, target: iqn.2008-08.com.starwindsoftware:pub-9001-hanjun, portal: 10.12.9.1,3260] (multiple)
Login to [iface: default, target: iqn.2008-08.com.starwindsoftware:pub-9001-hanjun, portal: 10.12.9.1,3260] successful.
其中 iqn.2008-08.com.starwindsoftware:pub-9001-hanjun 是iscsi共享盤的名稱。
如果要在系統啟動時自動登入:
# iscsiadm -m node –T iqn.2008-08.com.starwindsoftware:pub-9001-hanjun -p 10.12.9.1:3260 --op update -n node.startup -v automatic
3.4 接着查看一下磁盤信息
[root@rhel6-5x64-8-66 ~]# fdisk -l
Disk /dev/sdc: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe0d5dbd5
Device Boot Start End Blocks Id System
/dev/sdc1 1 10240 10485744 83 Linux
【/dev/sdc即為連接的iscsi存儲設備】
3.5 連接需要需驗證碼的iscsi共享盤的方法
3.5.1 開啟認證
iscsiadm -m node -T [iscsi共享盤] -o update --name node.session.auth.authmethod --value=CHAP *.使用-o同--op
3.5.2 添加用戶
iscsiadm -m node -T [iscsi共享盤] --op update --name node.session.auth.username --value=[用戶名]
3.5.3 添加密碼
iscsiadm –m node –T [iscsi共享盤] -op update –name node.session.auth.password –value=[密碼]
3.6 分區並格式化設備
[root@rhel6-5x64-8-66 ~]# fdisk /dev/sdc
設備需要格式化為,我們格式為ext4文件系統,運行:
[root@rhel6-5x64-8-66 ~]# mkfs.ext4 /dev/sdc1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
655360 inodes, 2621436 blocks
131071 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2684354560
80 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 23 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
【3.4 接着查看一下磁盤信息 這里就是分區並格式化好了的】
3.7 掛載設備mount
[root@rhel6-5x64-8-66 ~]# mkdir /sharedisk
[root@rhel6-5x64-8-66 ~]# mount /dev/sdc1 /sharedisk/
[root@rhel6-5x64-8-66 ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 41284928 16103600 23084176 42% /
tmpfs 4194304 4 4194300 1% /dev/shm
/dev/sdc1 10321192 154108 9642800 2% /sharedisk
iscsi設備被成功掛載,可以當作常規存儲設備使用了。
3.8 如果要在系統啟動時自動掛接
編輯 # vim /etc/fstab
加入一行:/dev/sdc1 /sharedisk ext4 default 0 0
3.9 注銷到共享盤的連接
首先umount,再注銷Logout
[root@rhel6-5x64-8-66 ~]# umount /sharedisk
[root@rhel6-5x64-8-66 ~]# iscsiadm -m node -T iqn.2008-08.com.starwindsoftware:pub-9001-gdisk -p 10.12.9.1 -u
Logging out of session [sid: 2, target: iqn.2008-08.com.starwindsoftware:pub-9001-gdisk, portal: 10.12.9.1,3260]
Logout of [sid: 2, target: iqn.2008-08.com.starwindsoftware:pub-9001-gdisk, portal: 10.12.9.1,3260] successful.
4.相關命令
4.1 查看有哪些共享盤可以連
[root@rhel6-5x64-8-66 ~]# iscsiadm --mode discovery --type sendtargets --portal 10.12.9.1
10.12.9.1:3260,-1 iqn.2008-08.com.starwindsoftware:pub-9001-gdisk
10.12.9.1:3260,-1 iqn.2008-08.com.starwindsoftware:pub-9001-100g-2
10.12.9.1:3260,-1 iqn.2008-08.com.starwindsoftware:pub-9001-hanjun
10.12.9.1:3260,-1 iqn.2008-08.com.starwindsoftware:pub-9001-100gdisk
4.2 查看連上了哪些共享盤
[root@rhel6-5x64-8-66 ~]# iscsiadm -m session –R
tcp: [4] 10.12.9.1:3260,1 iqn.2008-08.com.starwindsoftware:pub-9001-hanjun
4.3 連接到某一個特定的共享盤
[root@rhel6-5x64-8-66 ~]# iscsiadm -m node -T iqn.2008-08.com.starwindsoftware:pub-9001-hanjun -p 10.12.9.1 -l
Logging in to [iface: default, target: iqn.2008-08.com.starwindsoftware:pub-9001-hanjun, portal: 10.12.9.1,3260] (multiple)
Login to [iface: default, target: iqn.2008-08.com.starwindsoftware:pub-9001-hanjun, portal: 10.12.9.1,3260] successful.
4.4 注銷到某一個特定的共享盤的連接
[root@rhel6-5x64-8-66 ~]# iscsiadm -m node -T iqn.2008-08.com.starwindsoftware:pub-9001-gdisk -p 10.12.9.1 -u
Logging out of session [sid: 2, target: iqn.2008-08.com.starwindsoftware:pub-9001-gdisk, portal: 10.12.9.1,3260]
Logout of [sid: 2, target: iqn.2008-08.com.starwindsoftware:pub-9001-gdisk, portal: 10.12.9.1,3260] successful.
4.5 注銷所有連接
[root@rhel6-5x64-8-66 ~]# iscsiadm -m node --logoutall=all
Logging out of session [sid: 1, target: iqn.2008-08.com.starwindsoftware:pub-9001-hanjun, portal: 10.12.9.1,3260]
Logging out of session [sid: 2, target: iqn.2008-08.com.starwindsoftware:pub-9001-gdisk, portal: 10.12.9.1,3260]
Logging out of session [sid: 3, target: iqn.2008-08.com.starwindsoftware:pub-9001-100g-2, portal: 10.12.9.1,3260]
Logout of [sid: 1, target: iqn.2008-08.com.starwindsoftware:pub-9001-hanjun, portal: 10.12.9.1,3260] successful.
Logout of [sid: 2, target: iqn.2008-08.com.starwindsoftware:pub-9001-gdisk, portal: 10.12.9.1,3260] successful.
Logout of [sid: 3, target: iqn.2008-08.com.starwindsoftware:pub-9001-100g-2, portal: 10.12.9.1,3260] successful.
4.6 service iscsi restart重啟iscsi服務
4.7 service iscsi stop停止iscsi服務。