redhat as 3.0 共享分区疑惑?
我已经建立好了REHAT AS 3.0自带的CLUSTER,运行正常,可是我发现当集群启动后,没有运行服务的那个NODE通过手动的方法一样可以MOUNT上集群的共享分区,这让我很困惑,不知道这是不是正常现象。
听说REDHAT 自带的CLUTER上对于共享分区是SCSI reservation机制,但为什么其他节点一样可以手工MOUNT上共享分区呢?
SCSI reservation
The other primary approach to limiting access to shared storage is SCSI reservation. SCSI Layers 2 and 3 support a protocol that issues locks for disks. When a disk is locked, a key is issued to one machine, which has sole access to the corresponding disk. Other machines that try to access the disk receive a reservation conflict message and are denied access. If a machine is unreachable, the active members of the cluster can remove it from the cluster by breaking its reservations. The remaining members then have the opportunity to reserve the disks. SCSI reservation requires proper device and device-driver support—limiting the hardware and OS configurations that support this method
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
vmware做的虚拟盘也可以认为是标准共享存贮设备支持的SCSI Reservation的特性,这一点WMWARE说明的应该比较清楚.
现在问题是,出现这样的情况是属于BUG还是属于我使用上的错误呢,此问题仅限于RH自带的HA CLUSTER软件,其他HA软件目前没有测试所以没有考虑.
在进行切换前,为了保证共享存贮数据的完整性,必须确保有故障的集群节点不会向共享存贮设备写入数据,TurboHA 6通过自动地利用被所有标准共享存贮设备支持的SCSI Reservation的特性以确保这一点。所以我们强烈建议您使用标准的共享存贮设备。TurboHA 6 手册中介绍了如何确定您的共享存贮设备是否支持SCSI Reservation特性。
我是用的VMWARE3.20做了三个虚拟硬盘:
1.安装系统
2.分成裸分区
3.做共享分区
打开共享分区SCSI Reservation 的方法依据(摘自vmware官网):
Enabling SCSI Reservation
SCSI reservation must be enabled in a virtual machine before you can share its disks. VMware recommends you set up any shared disks on the same SCSI bus, which is a different bus than the one the guest operating system uses. For example, if your guest operating system is on the scsi0 bus, you should set up disks to share on the next available bus, typically the scsi1 bus.
To enable SCSI reservation, make sure the virtual machine is powered off. Open the configuration file (.vmx) in a text editor and add the line:
scsi<x>.sharedBus = "virtual"
anywhere in the file, where <x> is the SCSI bus being shared.
For example, to enable SCSI reservation for devices on the scsi1 bus, add the following line to the virtual machine's configuration file:
scsi1.sharedBus = "virtual"
This allows the whole bus to be shared and is quicker than specifying each disk separately. However, if you do not want to share the whole bus, you can selectively enable SCSI reservation for a specific SCSI disk on the shared bus. For example, if you want to share a SCSI disk located at scsi1:1, add the following line to the configuration file:
scsi1:1.shared = "true"
You must specify the same SCSI target (that is, scsi<x>:1) in the configuration file for each virtual machine that is going to share the disk.
If SCSI reservation is enabled for the whole bus (that is, scsi1.sharedBus is set to "virtual"), then this setting is ignored.
In addition to enabling SCSI reservation on the bus, you need to allow virtual machines to access the shared disk concurrently. Add the following line to the virtual machine's configuration file:
disk.locking = "false"
This prevents the locking of that disk, which permits multiple virtual machines to access a disk concurrently. Be careful though: if any virtual machine not configured for SCSI reservation tries to access this disk concurrently, then the shared disk is vulnerable to corruption or data loss.
Caution: This setting applies to all disks in the virtual machine.
When SCSI reservation is enabled, the system creates a reservation lock file that contains the shared state of the reservation for the given disk. The name of this file consists of the filename of the SCSI disk appended with .RESLCK.
For example, if the disk scsi1:0.filename is defined in the configuration file as
scsi1:0.fileName = "/<path_to_config>/vmSCSI.vmdk"
then the reservation lock file for this disk has the default name
/<path_to_config>/vmSCSI.vmdk.RESLCK
You can provide your own lock filename. Add a definition for scsi1:0.reslckname to the configuration file. For example, if you add
scsi1:0.reslckname = "/tmp/scsi1-0.reslock"
to the configuration file, this name overrides the default lock filename.
Caution: Use the same lock filename (for example, "/tmp/scsi1-0.reslock") for each virtual machine in the cluster. You must also use the same SCSI target for each virtual machine when you define scsi1:0.reslckname. However, the SCSI bus (scsi1 in this case) does not need to be the same.
Once SCSI reservation is enabled for a disk — that is, the scsi<x>.sharedBus = "virtual" and disk.locking = "false" settings are added to the configuration file for each virtual machine wanting to share this disk — you need to point each virtual machine to this disk.
[ 本帖最后由 yangze_tj 于 2006-1-26 20:43 编辑 ]
是可以这样的,我也碰到过。而且2边服务都能起来的,数据嘛就毁了。
楼主的设备这么高级. 介绍一下是什么产品?
你的共享设备是什么?
尝试了,能读和写都可以,跟没有SCSI reservation 的感觉一样,不管哪个节点都可以写进去读出来,只不过一个节点写过了想在另外的节点上可见需要重新MOUNT一次。
另外又一个问题产生了:启动集群后运行服务的节点可以把共享分区UMOUNT掉,而且服务是不会转移的。
注:我的裸设备和共享分区不在同一个物理设备上,也就是说虽然卸载了共享分区但裸分区还是能访问的。
也许是 ro 吧?
mount上去后,你尝试过read/write么?