在Windows平台的话, 提供Microsoft Multipath I/O (MPIO) framework 框架 (www.Microsoft.com/MPIO)
自己可以写 Device Specific Module (DSM) 驱动,然后微软上层驱动会自动在适当的调用你驱动里的回调函数,比如是不是几个磁盘是同一个盘啦,那个路径的状态是不是正常了,负载均衡选路的回调函数啊等等。反正各个路径的维护微软应该是搞了一个框架了,自己些DSM驱动的时候应该可以省去很多事情。比如某条路是不是通的如果自己维护的话还是要做很多事情的。 摘录自“Windows Server High Availability with Microsoft MPIO”文档的错误状态处理的说明:
Error Handling, Failover and Recovery
The MPIO driver, in combination with the DSM, supports end-to-end path failover. The process of detecting failed paths and recovering from the failure, like load balancing, is automatic, usually fast, and completely transparent to the IT organization. The data ideally remains available at all times.
Not all errors result in failover to a new path. Some errors are temporary and can be recovered using a recovery routine in the DSM; if recovery is successful, MPIO is notified and path validity checked to verify that it can be used again to transmit I/O requests.
When a fatal error occurs, the path is invalidated and a new path is selected. The I/O is resubmitted on this new path without requiring the Application layer to resubmit the data.
微软的DDK里面应该是提供了一个MPIO的DSM驱动的例子的,在那个基础上应该容易很多吧。具体可以去看官方文档。
==============================================================
Linux上面也有类似的东西 Device mapping multipath IO
按照文档,他会把同样的序列号的磁盘映射为同一个,然后那些路径的的错误装题的维护由“multipath-tools userspace package”的用户态应用程序来管理。
摘录自http://www.softpanorama.org/Commercial_linuxes/Devices/multipath.shtml 的说明:
Linux multipathing provides IO failover and path load sharing for multipathed block devices. The multipath IO support is based on two components
* the Device Mapper multipath module of the Linux kernel. Device mapping multipath IO features automatic configuration of the subsystem for a large variety of setups. Active/passive or active/active (with round-robin load balancing) configurations of up to eight paths to each device are supported.
* the multipath-tools userspace package. multipath-tools take care of automatic path discovery and grouping as well as automated path retesting, so that a previously failed path is automatically reinstated when it becomes healthy again. This minimizes the need for administrator attention in a production environment.
To determine which SCSI devices/paths correspond to the same LUN, the DM initiates a SCSI Inquiry. The inquiry response, among other things, carries the LUN serial number. Regardless of the number paths a LUN is associated with, the serial number for the LUN will always be the same. This is how multipathing SW determines which and how many paths are associated with each LUN.
The connection from the server through the Host Bus Adapter (HBA) to the storage controller is referred as a path. Multipath connectivity refers to a system configuration where multiple connection paths exist between a server and a storage unit (Logical Unit (LUN)) within a storage subsystem. This configuration can be used to provide redundancy or increased bandwidth. Multipath connectivity provides redundant access to the storage devices, for example, to have access to the storage device when one or more of the components in a path fail. Another advantage of using multipath connectivity is the increased throughput by way of load balancing.
=================================================================
自己可以写 Device Specific Module (DSM) 驱动,然后微软上层驱动会自动在适当的调用你驱动里的回调函数,比如是不是几个磁盘是同一个盘啦,那个路径的状态是不是正常了,负载均衡选路的回调函数啊等等。反正各个路径的维护微软应该是搞了一个框架了,自己些DSM驱动的时候应该可以省去很多事情。比如某条路是不是通的如果自己维护的话还是要做很多事情的。 摘录自“Windows Server High Availability with Microsoft MPIO”文档的错误状态处理的说明:
Error Handling, Failover and Recovery
The MPIO driver, in combination with the DSM, supports end-to-end path failover. The process of detecting failed paths and recovering from the failure, like load balancing, is automatic, usually fast, and completely transparent to the IT organization. The data ideally remains available at all times.
Not all errors result in failover to a new path. Some errors are temporary and can be recovered using a recovery routine in the DSM; if recovery is successful, MPIO is notified and path validity checked to verify that it can be used again to transmit I/O requests.
When a fatal error occurs, the path is invalidated and a new path is selected. The I/O is resubmitted on this new path without requiring the Application layer to resubmit the data.
微软的DDK里面应该是提供了一个MPIO的DSM驱动的例子的,在那个基础上应该容易很多吧。具体可以去看官方文档。
==============================================================
Linux上面也有类似的东西 Device mapping multipath IO
按照文档,他会把同样的序列号的磁盘映射为同一个,然后那些路径的的错误装题的维护由“multipath-tools userspace package”的用户态应用程序来管理。
摘录自http://www.softpanorama.org/Commercial_linuxes/Devices/multipath.shtml 的说明:
Linux multipathing provides IO failover and path load sharing for multipathed block devices. The multipath IO support is based on two components
* the Device Mapper multipath module of the Linux kernel. Device mapping multipath IO features automatic configuration of the subsystem for a large variety of setups. Active/passive or active/active (with round-robin load balancing) configurations of up to eight paths to each device are supported.
* the multipath-tools userspace package. multipath-tools take care of automatic path discovery and grouping as well as automated path retesting, so that a previously failed path is automatically reinstated when it becomes healthy again. This minimizes the need for administrator attention in a production environment.
To determine which SCSI devices/paths correspond to the same LUN, the DM initiates a SCSI Inquiry. The inquiry response, among other things, carries the LUN serial number. Regardless of the number paths a LUN is associated with, the serial number for the LUN will always be the same. This is how multipathing SW determines which and how many paths are associated with each LUN.
The connection from the server through the Host Bus Adapter (HBA) to the storage controller is referred as a path. Multipath connectivity refers to a system configuration where multiple connection paths exist between a server and a storage unit (Logical Unit (LUN)) within a storage subsystem. This configuration can be used to provide redundancy or increased bandwidth. Multipath connectivity provides redundant access to the storage devices, for example, to have access to the storage device when one or more of the components in a path fail. Another advantage of using multipath connectivity is the increased throughput by way of load balancing.
=================================================================