iSCSI設定
2013-10-04 10:01
288 查看
先將帳密keyin到/etc/iscsi/iscsid.conf
node.session.auth.username = <帳號>
node.session.auth.password = <密碼>
discovery.sendtargets.auth.username = <帳號>
discovery.sendtargets.auth.password = <密碼>
掃瞄一下該IP有無iscsi target,列出三個
[root@photo iscsi]# iscsiadm -m discovery -t sendtargets -p 203.64.153.x
203.64.153.x:3260,1 iqn.2004-04.com.qnap:ts-809u:iscsi.qnap.c08871
203.64.153.x:3260,1 iqn.2004-04.com.qnap:ts-809u:iscsi.cdtower.c08871
203.64.153.x:3260,1 iqn.2004-04.com.qnap:ts-809u:iscsi.photo.c08871
重新啟動iscsi 服務
[root@photo iscsi]# service iscsi restart
正在停止 iscsi: [ 確定 ]
正在啟動 iscsi:iscsiadm: Could not login to [iface: default, target: iqn.2004-04.com.qnap:ts-809u:iscsi.photo.c08871, portal: 203.64.153.x,3260].
iscsiadm: initiator reported error (24 – iSCSI login failed due to authorization failure)
iscsiadm: Could not login to [iface: default, target: iqn.2004-04.com.qnap:ts-809u:iscsi.qnap.c08871, portal: 203.64.153.x,3260].
iscsiadm: initiator reported error (24 – iSCSI login failed due to authorization failure)iscsiadm: Could not login to [iface: default, target: iqn.2004-04.com.qnap:ts-809u:iscsi.cdtower.c08871, portal: 203.64.153.x,3260].
iscsiadm: initiator reported error (24 – iSCSI login failed due to authorization failure)iscsiadm: Could not log into all portals [ 確定 ]
先看看該IP有哪些iscsi target
[root@photo iscsi]# iscsiadm -m node
203.64.153.x:3260,1 iqn.2004-04.com.qnap:ts-809u:iscsi.photo.c08871
203.64.153.x:3260,1 iqn.2004-04.com.qnap:ts-809u:iscsi.qnap.c08871
203.64.153.x:3260,1 iqn.2004-04.com.qnap:ts-809u:iscsi.cdtower.c08871
登入iscsi設備
[root@photo iscsi]# iscsiadm –mode node –targetname iqn.2004-04.com.qnap:ts-809u:iscsi.photo.c08871 –login
Logging in to [iface: default, target: iqn.2004-04.com.qnap:ts-809u:iscsi.photo.c08871, portal: 203.64.153.x,3260] (multiple)
Login to [iface: default, target: iqn.2004-04.com.qnap:ts-809u:iscsi.photo.c08871, portal: 203.64.153.x,3260] successful.
[root@photo iscsi]#
下fdisk -l指令看看有無新空間進來,有的,/dev/sdb有539GB
[root@photo iscsi]# fdisk -l
Disk /dev/sda: 17.2 GB, 17179869184 bytes
255 heads, 63 sectors/track, 2088 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00095fee
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 2089 16264192 8e Linux LVM
Disk /dev/mapper/vg_template-lv_root: 12.4 GB, 12423528448 bytes
255 heads, 63 sectors/track, 1510 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0×00000000
Disk /dev/mapper/vg_template-lv_root doesn’t contain a valid partition table
Disk /dev/mapper/vg_template-lv_swap: 4227 MB, 4227858432 bytes
255 heads, 63 sectors/track, 514 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0×00000000
Disk /dev/mapper/vg_template-lv_swap doesn’t contain a valid partition table
Disk /dev/sdb: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0×00000000
Disk /dev/sdb doesn’t contain a valid partition table
現在把不要的iscsi target 刪掉
[root@photo iscsi]# iscsiadm -m node -o delete -T iqn.2004-04.com.qnap:ts-809u:iscsi.qnap.c08871
[root@photo iscsi]# iscsiadm -m node -o delete -T iqn.2004-04.com.qnap:ts-809u:iscsi.cdtower.c08871
[root@photo iscsi]# iscsiadm -m node
203.64.153.x:3260,1 iqn.2004-04.com.qnap:ts-809u:iscsi.photo.c08871
將新空間FDISK(詳細方法先FDISK userguide)
[root@photo iscsi]#fdisk /dev/sdb
[root@photo iscsi]#mkfs.ext4 /dev/sdb1
[root@photo iscsi]#mkdir /mnt/iscsi_photo
[root@photo iscsi]#mount /dev/sdb1 /mnt/iscsi_photo/
[root@photo iscsi]#echo ‘mount /dev/sdb1 /mnt/iscsi_photo/’ >> /etc/rc.local
現在無聊測一下iscsi的I/O速度
[root@photo iscsi_photo]# hdparm -tT /dev/sdb1
/dev/sdb1:
Timing cached reads: 4240 MB in 2.00 seconds = 2120.31 MB/sec
Timing buffered disk reads: 274 MB in 3.00 seconds = 91.23 MB/sec
[root@photo iscsi_photo]#cd /var/www/html/cpg
[root@photo iscsi_photo]#rm -rf albums
[root@photo iscsi_photo]#ln -s /mnt/iscsi_photo albums
完工!
node.session.auth.username = <帳號>
node.session.auth.password = <密碼>
discovery.sendtargets.auth.username = <帳號>
discovery.sendtargets.auth.password = <密碼>
掃瞄一下該IP有無iscsi target,列出三個
[root@photo iscsi]# iscsiadm -m discovery -t sendtargets -p 203.64.153.x
203.64.153.x:3260,1 iqn.2004-04.com.qnap:ts-809u:iscsi.qnap.c08871
203.64.153.x:3260,1 iqn.2004-04.com.qnap:ts-809u:iscsi.cdtower.c08871
203.64.153.x:3260,1 iqn.2004-04.com.qnap:ts-809u:iscsi.photo.c08871
重新啟動iscsi 服務
[root@photo iscsi]# service iscsi restart
正在停止 iscsi: [ 確定 ]
正在啟動 iscsi:iscsiadm: Could not login to [iface: default, target: iqn.2004-04.com.qnap:ts-809u:iscsi.photo.c08871, portal: 203.64.153.x,3260].
iscsiadm: initiator reported error (24 – iSCSI login failed due to authorization failure)
iscsiadm: Could not login to [iface: default, target: iqn.2004-04.com.qnap:ts-809u:iscsi.qnap.c08871, portal: 203.64.153.x,3260].
iscsiadm: initiator reported error (24 – iSCSI login failed due to authorization failure)iscsiadm: Could not login to [iface: default, target: iqn.2004-04.com.qnap:ts-809u:iscsi.cdtower.c08871, portal: 203.64.153.x,3260].
iscsiadm: initiator reported error (24 – iSCSI login failed due to authorization failure)iscsiadm: Could not log into all portals [ 確定 ]
先看看該IP有哪些iscsi target
[root@photo iscsi]# iscsiadm -m node
203.64.153.x:3260,1 iqn.2004-04.com.qnap:ts-809u:iscsi.photo.c08871
203.64.153.x:3260,1 iqn.2004-04.com.qnap:ts-809u:iscsi.qnap.c08871
203.64.153.x:3260,1 iqn.2004-04.com.qnap:ts-809u:iscsi.cdtower.c08871
登入iscsi設備
[root@photo iscsi]# iscsiadm –mode node –targetname iqn.2004-04.com.qnap:ts-809u:iscsi.photo.c08871 –login
Logging in to [iface: default, target: iqn.2004-04.com.qnap:ts-809u:iscsi.photo.c08871, portal: 203.64.153.x,3260] (multiple)
Login to [iface: default, target: iqn.2004-04.com.qnap:ts-809u:iscsi.photo.c08871, portal: 203.64.153.x,3260] successful.
[root@photo iscsi]#
下fdisk -l指令看看有無新空間進來,有的,/dev/sdb有539GB
[root@photo iscsi]# fdisk -l
Disk /dev/sda: 17.2 GB, 17179869184 bytes
255 heads, 63 sectors/track, 2088 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00095fee
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 2089 16264192 8e Linux LVM
Disk /dev/mapper/vg_template-lv_root: 12.4 GB, 12423528448 bytes
255 heads, 63 sectors/track, 1510 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0×00000000
Disk /dev/mapper/vg_template-lv_root doesn’t contain a valid partition table
Disk /dev/mapper/vg_template-lv_swap: 4227 MB, 4227858432 bytes
255 heads, 63 sectors/track, 514 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0×00000000
Disk /dev/mapper/vg_template-lv_swap doesn’t contain a valid partition table
Disk /dev/sdb: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0×00000000
Disk /dev/sdb doesn’t contain a valid partition table
現在把不要的iscsi target 刪掉
[root@photo iscsi]# iscsiadm -m node -o delete -T iqn.2004-04.com.qnap:ts-809u:iscsi.qnap.c08871
[root@photo iscsi]# iscsiadm -m node -o delete -T iqn.2004-04.com.qnap:ts-809u:iscsi.cdtower.c08871
[root@photo iscsi]# iscsiadm -m node
203.64.153.x:3260,1 iqn.2004-04.com.qnap:ts-809u:iscsi.photo.c08871
將新空間FDISK(詳細方法先FDISK userguide)
[root@photo iscsi]#fdisk /dev/sdb
[root@photo iscsi]#mkfs.ext4 /dev/sdb1
[root@photo iscsi]#mkdir /mnt/iscsi_photo
[root@photo iscsi]#mount /dev/sdb1 /mnt/iscsi_photo/
[root@photo iscsi]#echo ‘mount /dev/sdb1 /mnt/iscsi_photo/’ >> /etc/rc.local
現在無聊測一下iscsi的I/O速度
[root@photo iscsi_photo]# hdparm -tT /dev/sdb1
/dev/sdb1:
Timing cached reads: 4240 MB in 2.00 seconds = 2120.31 MB/sec
Timing buffered disk reads: 274 MB in 3.00 seconds = 91.23 MB/sec
[root@photo iscsi_photo]#cd /var/www/html/cpg
[root@photo iscsi_photo]#rm -rf albums
[root@photo iscsi_photo]#ln -s /mnt/iscsi_photo albums
完工!
相关文章推荐
- Practical Common Lisp
- Successful Lisp - Cover
- linux下修改主机名
- 位运算
- (76) Clojure: Why would someone learn Clojure? - Quora
- 根据数组名求数组中元素的个数
- 动态规划入门——Eddy's research II
- Exchange Server 2007迁移Exchange Server 2010 (14)--- 设置POP3和IMAP4
- Android的按钮单击事件及监听器的实现方式
- PB程序中如何测试网络连接是否中断?(实现Ping命令)
- OCP-1Z0-052-V8.02-32题
- 算法:冒泡排序法
- Oracle DB 用户
- 部分排序算法总结
- 为应对假日购物季 亚马逊将雇7万名季节工
- ubuntu 主题美化
- 破坏你仇人的电脑(让他电脑里所有程序无法启动)
- 实用地址分享
- Exchange Server 2007迁移Exchange Server 2010 (13)---设置邮箱配额
- 解决jquery中animate动画积累