免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 8531 | 回复: 14
打印 上一主题 下一主题

[RAID与磁盘阵列] 关于磁盘阵列共享存储的一些疑问 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-22 10:59 |只看该作者 |倒序浏览
现在我手头上有这几台设备:ibm ds4300磁盘阵列存储(配有4块scsi硬盘,每块300g),ibm x3650服务器(每台配两块73g scsi硬盘,做raid1):test1、test2,安装redhat-as4.0-u4操作系统,用光纤将两台服务器同存储相连接
用ds4300的管理软件将存储设置为raid5,显示可使用容量为830g
连接好之后将两台服务器重启,检测存储空间。
奇怪的是:如果单机启动,不连接存储,我fdisk -l显示本机的磁盘设备均为/dev/sda

连接存储之后,test1服务器检查本机磁盘为/dev/sda,存储设备为/dev/sdb,而test2检查出的存储设备依然为/dev/sda,把本机的两块scsi磁盘认为/dev/sdb,
状态如下:

test1:

[root@test1 home]# fdisk -l

Disk /dev/sda: 73.2 GB, 73283928064 bytes
255 heads, 63 sectors/track, 8909 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          65      522081   83  Linux
/dev/sda2              66        6439    51199155   83  Linux
/dev/sda3            6440        6566     1020127+  82  Linux swap

Disk /dev/sdb: 898.3 GB, 898387972608 bytes
255 heads, 63 sectors/track, 109222 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1400    11245468+  83  Linux
/dev/sdb2            1401        2800    11245500   83  Linux
[root@test1 home]#


test2:

[root@test2 ~]# fdisk -l

Disk /dev/sda: 898.3 GB, 898387972608 bytes
255 heads, 63 sectors/track, 109222 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1400    11245468+  83  Linux
/dev/sda2            1401        2800    11245500   83  Linux

Disk /dev/sdb: 73.2 GB, 73283928064 bytes
255 heads, 63 sectors/track, 8909 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          65      522081   83  Linux
/dev/sdb2              66        6439    51199155   83  Linux
/dev/sdb3            6440        6694     2048287+  82  Linux swap

这之后,我把test1,光纤拔掉,只让test2连接存储设备,重启后依然是这样
请问一下这种情况是正常的么?

问题2:
按照我的理解,存储是共享磁盘空间,对于存储中一个共享的分区(例如:在我这环境中对于test1为/dev/sdb1,对于test2为/dev/sda1),在其中一个节点上向里面写数据,对于另外一个节点上查看应该是可见的,于是我按下列步骤做了如下操作:

在test1上:
[root@test1 ~]#
[root@test1 ~]# mkfs -t ext3 /dev/sdb1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
100576 inodes, 200804 blocks
10040 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=209715200
7 block groups
32768 blocks per group, 32768 fragments per group
14368 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840

Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@test1 ~]# mount /dev/sdb1 /home/test
[root@test1 ~]# df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              49G  7.9G   38G  18% /
/dev/sda1             494M   26M  444M   6% /boot
none                  2.0G     0  2.0G   0% /dev/shm
/dev/sdb1             773M   17M  716M   3% /home/test
[root@test1 ~]# cd /home/test
[root@test1 test]# ls
lost+found
[root@test1 test]# vi 1.txt
[root@test1 test]# ls
1.txt  lost+found
[root@test1 test]# ls -l
total 20
-rw-r--r--  1 root root    24 Apr 22 10:39 1.txt
drwx------  2 root root 16384 Apr 22 10:37 lost+found
[root@test1 test]#

在test2上:
[root@test2 home]# mount /dev/sda1 /home/test
[root@test2 home]# df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb2              49G  7.4G   39G  17% /
/dev/sdb1             494M   29M  441M   7% /boot
none                  2.0G     0  2.0G   0% /dev/shm
/dev/sda1             773M   17M  716M   3% /home/test
[root@test2 home]# cd /home/test
[root@test2 test]# ls
1.txt  lost+found
[root@test2 test]# vi 2.txt
[root@test2 test]#
[root@test2 test]# ls -l
total 24
-rw-r--r--  1 root root    24 Apr 22 10:39 1.txt
-rw-r--r--  1 root root  1118 Apr 22 10:39 2.txt
drwx------  2 root root 16384 Apr 22 10:37 lost+found
[root@test2 test]# cd ..
[root@test2 home]# du test
16      test/lost+found
28      test
[root@test2 home]# cd /test
bash: cd: /test: No such file or directory
[root@test2 home]# cd test
[root@test2 test]# ls
1.txt  2.txt  lost+found
[root@test2 test]# cat 1.txt
dadf  dfasdfasdfadfasd

[root@test2 test]# cat 2.txt


回到test1上:
[root@test1 test]# ls
1.txt  lost+found
[root@test1 test]# du *
4       1.txt
16      lost+found
[root@test1 test]# cd ..
[root@test1 home]# umount /dev/sdb1 /home/test
umount: /dev/sdb1: not mounted
umount: /dev/sdb1: not mounted
[root@test1 home]# mount /dev/sdb1 /home/test
[root@test1 home]# cd test
[root@test1 test]# ls
1.txt  2.txt  lost+found
[root@test1 test]# ls -l
total 20
-rw-r--r--  1 root root    24 Apr 22 10:39 1.txt
?---------  ? ?    ?        ?            ? 2.txt
drwx------  2 root root 16384 Apr 22 10:37 lost+found
[root@test1 test]# cat 2.txt
cat: 2.txt: Input/output error
[root@test1 test]# vi 3
[root@test1 test]#
[root@test1 test]#
[root@test1 test]# ls
1.txt  2.txt  3  lost+found


在转入test2:
[root@test2 test]# ls
1.txt  2.txt  lost+found
[root@test2 test]# cd ..
[root@test2 home]# umount /dev/sda1 /home/test
umount: /dev/sda1: not mounted
umount: /dev/sda1: not mounted
[root@test2 home]# cd test
[root@test2 test]# ls
[root@test2 test]# cd ..
[root@test2 home]# mount /dev/sda1 /home/test
[root@test2 home]# cd test/
[root@test2 test]# ls
1.txt  2.txt  3  lost+found
[root@test2 test]# cat 3
ddfasdfasdfasdfasdfasdfasdfasdfasdf


这个测试也就是说对于存储磁盘上的共享的存储空间,如果其中一个节点写入数据,另外一个节点需要从新挂载这个共享空间才能访问到新的数据,而且我刚做的这个实验对于.txt文件是报i/o错误的。
请帮忙分析一下原因。

[ 本帖最后由 lizisor 于 2008-4-22 11:10 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2008-04-22 12:39 |只看该作者
没人帮帮忙么?

论坛徽章:
0
3 [报告]
发表于 2008-04-22 13:56 |只看该作者
如果你想两个主机共享存储,需要有光纤共享控制软件,而不能单纯的这样直接挂载。

论坛徽章:
0
4 [报告]
发表于 2008-04-22 14:40 |只看该作者
楼上说的光纤共享控制软件是rdac么?

论坛徽章:
0
5 [报告]
发表于 2008-04-23 10:00 |只看该作者
这个一般要根据不同的硬件HBA卡来定,最好询硬件供应商

论坛徽章:
0
6 [报告]
发表于 2008-04-23 10:47 |只看该作者
这是最基本的问题,至于到底是SDA 还是SDB 这是跟连接的主机有关系,应用没有问题,只要启动盘不是阵列就可以了。两台主机共享一个存储空间没有共享软件是不行的。搜搜这方面的资料就知道了

论坛徽章:
0
7 [报告]
发表于 2008-04-23 22:54 |只看该作者
原帖由 lizisor 于 2008-4-22 14:40 发表
楼上说的光纤共享控制软件是rdac么?


不是RDAC。RDAC是多路径软件。要用Cluster File System类的软件,例如VERITAS CFS、GFS之类。

不能简单地两边同时mount,这样用的话数据会出问题的。

论坛徽章:
0
8 [报告]
发表于 2008-04-24 23:15 |只看该作者
IBM的Sanergy、GPFS,还有ADIC的StoreNext都是可以干这个事情的。一个LUN想同时map给2个机器是不行的

论坛徽章:
0
9 [报告]
发表于 2008-04-28 18:24 |只看该作者
你这个问题和共享软件没有关系,造成这个问题的原因是你的test2上HBA卡的scan值优于本地的SCSI卡,因此起机的时候就先scan HBA下的设备。两个解决办法:

1、把你的HBA卡换个槽位,让它处于slot值较高的位置,比如,你现在是slot2,就换到slot3\4或更高
2、关闭HBA卡Scan你功能,让起机时不去扫描硬件。
用这两种方法的一个就可以解决你上面说的问题。

论坛徽章:
0
10 [报告]
发表于 2008-04-30 09:38 |只看该作者
路过,到底解决了没有啊?楼主没说了?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP