November 15, 2005
支持公益宣传,请更换您的msn头像
作者:eygle
出处:http://blog.eygle.com
今天跟fenng在MSN上聊天,看到他的logo
于是进这个网站看了看
即使您不愿意跑路,不愿意多背那一公斤,那么至少可以做到这个最简单的参与方式
Posted by eygle at 5:03 PM | Comments (0)
iSCSI节点名称定义及其他
作者:eygle
出处:http://blog.eygle.com
iSCSI节点名称有两种格式,即 iqn-type 格式和 eui-type 格式。iqn-type的格式为:
iqn.yyyy-mm.backward_naming_authority:unique_device_name
在Linux上的格式为:
iqn.1987-05.com.cisco:RandomNumber
通常我们可以把RandomNumber更改为具有意义的名称如主机名称等。
缺省的,生成的节点名称可以在/etc/initiatorname.iscsi 得到.
InitiatorName=iqn.1987-05.com.cisco:01.ed671bf29e
我们可以修改为:
InitiatorName=iqn.1987-05.com.cisco:test2
重新启动iscsi服务后,Netapp端就能够正确识别initiator.
此时可以从主机上获得相关SCSI设备信息:
iscsi-sfnet: Loading iscsi_sfnet version 4:0.1.11-1 iscsi-sfnet: Control device major number 254 iscsi-sfnet:host3: Session established scsi3 : SFNet iSCSI driver scsi: unknown device type 31 Vendor: NETAPP Model: LUN Rev: 0.2 Type: Unknown ANSI SCSI revision: 04 Vendor: NETAPP Model: LUN Rev: 0.2 Type: Direct-Access ANSI SCSI revision: 04 SCSI device sda: 41943040 512-byte hdwr sectors (21475 MB) SCSI device sda: drive cache: write through sda: sda1 sda2 Attached scsi disk sda at scsi3, channel 0, id 0, lun 1 |
可以通过fdisk来分区使用iscsi设备:
[root@test2 ~]# fdisk /dev/sda The number of cylinders for this disk is set to 20480. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): p Disk /dev/sda: 21.4 GB, 21474836480 bytes 64 heads, 32 sectors/track, 20480 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Device Boot Start End Blocks Id System /dev/sda1 1 3907 4000752 83 Linux /dev/sda2 3908 20480 16970752 83 Linux Command (m for help): q |
使用iscsi-ls命令可以看到更为详细的磁盘信息:
[root@test2 ~]# iscsi-ls -l ******************************************************************************* SFNet iSCSI Driver Version ...4:0.1.11(12-Jan-2005) ******************************************************************************* TARGET NAME : iqn.1992-08.com.netapp:sn.84192734 TARGET ALIAS : HOST ID : 3 BUS ID : 0 TARGET ID : 0 TARGET ADDRESS : 172.16.35.228:3260,1 SESSION STATUS : ESTABLISHED AT Tue Nov 15 09:46:27 CST 2005 SESSION ID : ISID 00023d000001 TSIH 113 DEVICE DETAILS: --------------- LUN ID : 0 Vendor: NETAPP Model: LUN Rev: 0.2 Type: ANSI SCSI revision: 04 LUN ID : 1 Vendor: NETAPP Model: LUN Rev: 0.2 Type: Direct-Access ANSI SCSI revision: 04 page83 type3: 60a98000686f6c504f34314e45774239 page80: 686f6c504f34314e457742390a Device: /dev/sda ******************************************************************************* |
Posted by eygle at 10:14 AM | Comments (0)
NetAPP iSCSI性能测试
作者:eygle
出处:http://blog.eygle.com
使用Bonnie++测试了一下NetApp iSCSI的性能:测试结果如下:
[root@dell2650 bonnie++-1.03a]# ./bonnie++ -d /data1 -u root -s 2048 -m dell2650
Using uid:0, gid:0.
Writing with putc()...done
Writing intelligently...done
Rewriting...done
Reading with getc()...done
Reading intelligently...done
start 'em...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...done.
Create files in random order...done.
Stat files in random order...done.
Delete files in random order...done.
Version 1.03 ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
dell2650 2G 12085 49 12846 5 4986 2 6788 25 9008 3 594.1 3
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 3072 99 +++++ +++ +++++ +++ 3192 99 +++++ +++ 8494 100
dell2650,2G,12085,49,12846,5,4986,2,6788,25,9008,3,594.1,3,16,3072,99,+,+,+,+,3192,99,+,+,8494,100
|
我们看到测试结果,Block写的速度大约在12M/Sec,Chr写的速度大约在7M/Sec。
这基本已经是100M网络的最大速度,瓶颈其实在网络上。
此时通过sar观察,iowati已经达到88.49%,IO出现等待。
[root@dell2650 /]# sar 2 30 Linux 2.4.21-27.ELsmp (dell2650) 11/14/2005 08:47:06 PM CPU %user %nice %system %iowait %idle 08:47:08 PM all 0.00 0.00 7.00 93.00 0.00 08:47:10 PM all 0.25 0.00 10.00 88.25 1.50 08:47:12 PM all 0.00 0.00 12.25 86.75 1.00 08:47:14 PM all 0.00 0.00 9.00 90.00 1.00 08:47:16 PM all 0.00 0.00 11.50 88.00 0.50 08:47:18 PM all 0.00 0.00 11.75 88.00 0.25 08:47:20 PM all 0.25 0.00 11.75 87.25 0.75 08:47:22 PM all 0.00 0.00 13.00 86.50 0.50 08:47:24 PM all 0.00 0.00 11.25 88.75 0.00 08:47:26 PM all 0.00 0.00 12.75 86.75 0.50 08:47:28 PM all 0.00 0.00 8.75 91.25 0.00 08:47:30 PM all 0.00 0.00 11.50 88.25 0.25 08:47:32 PM all 0.00 0.00 10.50 88.75 0.75 ..... Average: all 0.07 0.00 10.59 88.49 0.85 |
通过iostat观察,可以看到,Block写的速度大约是也是10M左右。
和Bonnie++测试的结果相符合。
[root@dell2650 /]# iostat 2|grep sdb1 Linux 2.4.21-27.ELsmp (dell2650) 11/14/2005 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn .... sdb1 138.50 2304.00 21268.00 4608 42536 sdb1 62.00 1024.00 8196.00 2048 16392 sdb1 134.00 2304.00 19248.00 4608 38496 sdb1 143.00 2048.00 28892.00 4096 57784 sdb1 78.50 14848.00 71044.00 29696 142088 .... sdb1 74.50 18304.00 25216.00 36608 50432 sdb1 76.50 19072.00 5888.00 38144 11776 sdb1 92.50 2176.00 43392.00 4352 86784 sdb1 81.00 10368.00 24704.00 20736 49408 sdb1 82.50 12032.00 29568.00 24064 59136 sdb1 93.00 3968.00 46208.00 7936 92416 sdb1 85.50 7296.00 41856.00 14592 83712 sdb1 85.00 13332.00 13056.00 26664 26112 .... sdb1 79.00 5504.00 27648.00 11008 55296 sdb1 61.50 12288.00 36992.00 24576 73984 sdb1 76.50 5632.00 37248.00 11264 74496 sdb1 62.00 12672.00 35584.00 25344 71168 sdb1 75.00 6656.00 15328.00 13312 30656 |
Linux上Bonnie++的编译过程如下供参考:
[root@dell2650 data1]# wget http://www.eygle.com/unix/bonnie/bonnie++-1.03a.tgz
--20:18:51-- http://www.eygle.com/unix/bonnie/bonnie++-1.03a.tgz
=> `bonnie++-1.03a.tgz'
Resolving www.eygle.com... done.
Connecting to www.eygle.com[211.99.197.16]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 76,207 [application/x-gzip]
100%[===========================================================>] 76,207 610.01K/s ETA 00:00
20:18:51 (610.01 KB/s) - `bonnie++-1.03a.tgz' saved [76207/76207]
[root@dell2650 data1]# ls
bonnie++-1.03a.tgz lost+found
[root@dell2650 data1]# gzip -d bonnie++-1.03a.tgz
[root@dell2650 data1]# ls
bonnie++-1.03a.tar lost+found
[root@dell2650 data1]# tar -xvf bonnie++-1.03a.tar
bonnie++-1.03a/
bonnie++-1.03a/sun/
bonnie++-1.03a/sun/Makefile
bonnie++-1.03a/sun/pkginfo.in
bonnie++-1.03a/sun/pkginfo
bonnie++-1.03a/sun/prototype
bonnie++-1.03a/semaphore.cpp
bonnie++-1.03a/bon_suid.cpp
bonnie++-1.03a/Makefile
bonnie++-1.03a/bon_csv2html.1
bonnie++-1.03a/bon_file.h
bonnie++-1.03a/bon_csv2html.in
bonnie++-1.03a/conf.h.in
bonnie++-1.03a/bon_io.cpp
bonnie++-1.03a/bonnie++.spec
bonnie++-1.03a/configure
bonnie++-1.03a/bon_csv2html
bonnie++-1.03a/bon_csv2txt.in
bonnie++-1.03a/bon_time.h
bonnie++-1.03a/semaphore.h
bonnie++-1.03a/configure.in
bonnie++-1.03a/bonnie++.8
bonnie++-1.03a/forkit.h
bonnie++-1.03a/credits.txt
bonnie++-1.03a/bonnie++.spec.in
bonnie++-1.03a/install.sh
bonnie++-1.03a/changelog.txt
bonnie++-1.03a/bonnie++.cpp
bonnie++-1.03a/forkit.cpp
bonnie++-1.03a/zcav.cpp
bonnie++-1.03a/port.h.in
bonnie++-1.03a/debian/
bonnie++-1.03a/debian/dirs
bonnie++-1.03a/debian/docs
bonnie++-1.03a/debian/control
bonnie++-1.03a/debian/rules
bonnie++-1.03a/debian/changelog
bonnie++-1.03a/debian/copyright
bonnie++-1.03a/conf.h
bonnie++-1.03a/bon_file.cpp
bonnie++-1.03a/Makefile.in
bonnie++-1.03a/bon_csv2txt.1
bonnie++-1.03a/bonnie.h.in
bonnie++-1.03a/port.h
bonnie++-1.03a/zcav.8
bonnie++-1.03a/copyright.txt
bonnie++-1.03a/sh.common
bonnie++-1.03a/bon_io.h
bonnie++-1.03a/bonnie.8
bonnie++-1.03a/bonnie.h
bonnie++-1.03a/bon_csv2txt
bonnie++-1.03a/bon_time.cpp
bonnie++-1.03a/readme.html
[root@dell2650 data1]# cd bonnie++-1.03a
[root@dell2650 bonnie++-1.03a]# ./configure
checking for g++... g++
checking for C++ compiler default output... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for a BSD-compatible install... /usr/bin/install -c
checking for an ANSI C-conforming const... yes
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for size_t... yes
checking vector.h usability... yes
checking vector.h presence... yes
checking for vector.h... yes
checking vector usability... yes
checking vector presence... yes
checking for vector... yes
checking algorithm usability... yes
checking algorithm presence... yes
checking for algorithm... yes
checking algo.h usability... yes
checking algo.h presence... yes
checking for algo.h... yes
checking algo usability... no
checking algo presence... no
checking for algo... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating bonnie.h
config.status: creating port.h
config.status: creating bonnie++.spec
config.status: creating bon_csv2html
config.status: creating bon_csv2txt
config.status: creating sun/pkginfo
config.status: creating conf.h
config.status: conf.h is unchanged
[root@dell2650 bonnie++-1.03a]# make
g++ -O2 -DNDEBUG -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -c bon_io.cpp
g++ -O2 -DNDEBUG -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -c bon_file.cpp
g++ -O2 -DNDEBUG -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -c bon_time.cpp
g++ -O2 -DNDEBUG -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -c semaphore.cpp
g++ -O2 -DNDEBUG -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -c forkit.cpp
g++ -O2 -DNDEBUG -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -c bon_suid.cpp
g++ -O2 -DNDEBUG -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope bonnie++.cpp
-o bonnie++ bon_io.o bon_file.o bon_time.o semaphore.o forkit.o bon_suid.o
bonnie++.cpp: In function `void ctrl_c_handler(int, siginfo_t*, void*)':
bonnie++.cpp:142: warning: unused parameter `int sig'
bonnie++.cpp:142: warning: unused parameter `void*unused'
g++ -O2 -DNDEBUG -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope
zcav.cpp -o zcav bon_suid.o
|
Posted by eygle at 12:32 AM | Comments (3)
