跑linux主机配置,在 StorSimple Linux 主机上配置 MPIO | Microsoft Docs

您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

在运行 CentOS 的 StorSimple 主机上配置 MPIOConfigure MPIO on a StorSimple host running CentOS

06/12/2019

本文内容

本文说明在 Centos 6.6 主机服务器上配置多路径 IO (MPIO) 所要执行的步骤。This article explains the steps required to configure Multipathing IO (MPIO) on your Centos 6.6 host server. 主机服务器已连接到 Microsoft Azure StorSimple 设备,以通过 iSCSI 发起程序获得高可用性。The host server is connected to your Microsoft Azure StorSimple device for high availability via iSCSI initiators. 本文详细描述多路径设备的自动发现,以及仅适用于 StorSimple 卷的特定设置。It describes in detail the automatic discovery of multipath devices and the specific setup only for StorSimple volumes.

此过程适用于 StorSimple 8000 系列设备的所有型号。This procedure is applicable to all the models of StorSimple 8000 series devices.

备注

此过程不可用于 StorSimple 云设备。This procedure cannot be used for a StorSimple Cloud Appliance. 有关详细信息,请参阅“如何为云设备配置主机服务器”。For more information, see how to configure host servers for your cloud appliance.

关于多路径About multipathing

使用多路径功能可在主机服务器与存储设备之间配置多个 I/O 路径。The multipathing feature allows you to configure multiple I/O paths between a host server and a storage device. 这些 I/O 路径是可以包含不同电缆、交换机、网络接口和控制器的物理 SAN 连接。These I/O paths are physical SAN connections that can include separate cables, switches, network interfaces, and controllers. 多路径聚合了 I/O 路径,可配置与所有聚合路径关联的新设备。Multipathing aggregates the I/O paths, to configure a new device that is associated with all of the aggregated paths.

多路径有双重目的:The purpose of multipathing is two-fold:

高可用性:如果 I/O 路径的任何要素(例如电缆、交换机、网络接口或控制器)发生故障,多路径可提供替代路径。High availability: It provides an alternate path if any element of the I/O path (such as a cable, switch, network interface, or controller) fails.

负载均衡:根据存储设备的配置,多路径可通过检测 I/O 路径上的负载以及动态重新均衡这些负载来改善性能。Load balancing: Depending on the configuration of your storage device, it can improve the performance by detecting loads on the I/O paths and dynamically rebalancing those loads.

关于多路径组件About multipathing components

Linux 中的多路径由内核组件和以下用户空间组件构成。Multipathing in Linux consists of kernel components and user-space components as tabulated below.

内核:主要组件是 device-mapper,可重新路由 I/O,支持路径和路径组的故障转移。Kernel: The main component is the device-mapper that reroutes I/O and supports failover for paths and path groups.

用户空间:这些组件是 multipath-tools,可通过向 device-mapper 多路径模块发出工作指令来管理多路径设备。User-space: These are multipath-tools that manage multipathed devices by instructing the device-mapper multipath module what to do. 这些工具包括:The tools consist of:

Multipath:列出和配置多路径设备。Multipath: lists and configures multipathed devices.

Multipathd:执行多路径和监视路径的后台程序。Multipathd: daemon that executes multipath and monitors the paths.

Devmap-name:为 udev for devmaps 提供有意义的设备名称。Devmap-name: provides a meaningful device-name to udev for devmaps.

Kpartx:将线性 devmaps 映射到设备分区,使多路径映射可分区。Kpartx: maps linear devmaps to device partitions to make multipath maps partitionable.

Multipath.conf:多路径后台程序的配置文件,用于覆盖内置配置表。Multipath.conf: configuration file for multipath daemon that is used to overwrite the built-in configuration table.

关于 multipath.conf 配置文件About the multipath.conf configuration file

配置文件 /etc/multipath.conf 可让用户配置许多多路径功能。The configuration file /etc/multipath.conf makes many of the multipathing features user-configurable. multipath 命令和内核后台程序 multipathd 使用此文件中的信息。The multipath command and the kernel daemon multipathd use information found in this file. 只有在配置多路径设备期间才可查阅此文件。The file is consulted only during the configuration of the multipath devices. 请务必在运行 multipath 命令之前完成所有更改。Make sure that all changes are made before you run the multipath command. 如果以后修改该文件,则必须停止再重新启动 multipathd,才能使更改生效。If you modify the file afterwards, you will need to stop and start multipathd again for the changes to take effect.

multipath.conf 包括五个节:The multipath.conf has five sections:

系统级默认值 (defaults):可以覆盖系统级默认值。System level defaults (defaults): You can override system level defaults.

列入方块列表的设备 (blacklist):可以指定不应受 device-mapper 控制的设备列表。Blacklisted devices (blacklist): You can specify the list of devices that should not be controlled by device-mapper.

“方块列表例外”“(blacklist_exceptions)”:可以识别要被视为多路径设备的特定设备,即使这些设备已列入阻止列表。Blacklist exceptions (blacklist_exceptions): You can identify specific devices to be treated as multipath devices even if listed in the blocklist.

存储控制器特定的设置 (devices):可以指定要应用到设备的配置设置(包含供应商和产品信息)。Storage controller specific settings (devices): You can specify configuration settings that will be applied to devices that have Vendor and Product information.

设备特定的设置 (multipaths):可以使用此节微调单个 LUN 的配置设置。Device specific settings (multipaths): You can use this section to fine-tune the configuration settings for individual LUNs.

在连接到 Linux 主机的 StorSimple 上配置多路径Configure multipathing on StorSimple connected to Linux host

可以配置连接到 Linux 主机的 StorSimple 设备,以实现高可用性和负载均衡。A StorSimple device connected to a Linux host can be configured for high availability and load balancing. 例如,如果 Linux 主机有两个连接到 SAN 的接口,设备有两个连接到 SAN 的接口,并且这些接口位于同一子网中,则有 4 个路径可用。For example, if the Linux host has two interfaces connected to the SAN and the device has two interfaces connected to the SAN such that these interfaces are on the same subnet, then there will be 4 paths available. 但是,如果设备和主机接口上的每个 DATA 接口位于不同的 IP 子网中(且不可路由),则只有 2 个路径可用。However, if each DATA interface on the device and host interface are on a different IP subnet (and not routable), then only 2 paths will be available. 可以配置多路径,以便自动发现所有可用路径、选择这些路径的负载均衡算法、应用仅限 StorSimple 卷的特定配置设置,并启用和验证多路径。You can configure multipathing to automatically discover all the available paths, choose a load-balancing algorithm for those paths, apply specific configuration settings for StorSimple-only volumes, and then enable and verify multipathing.

以下过程描述当有两个网络接口的 StorSimple 设备连接到有两个网络接口的主机时,如何配置多路径。The following procedure describes how to configure multipathing when a StorSimple device with two network interfaces is connected to a host with two network interfaces.

先决条件Prerequisites

本部分详细说明 CentOS 服务器和 StorSimple 设备的配置先决条件。This section details the configuration prerequisites for CentOS server and your StorSimple device.

在 CentOS 主机上On CentOS host

确保 CentOS 主机已启用 2 个网络接口。Make sure that your CentOS host has 2 network interfaces enabled. 类型:Type:

ifconfig

以下示例显示主机上有两个网络接口(eth0 和 eth1)时的输出。The following example shows the output when two network interfaces (eth0 and eth1) are present on the host.

[root@centosSS ~]# ifconfig

eth0 Link encap:Ethernet HWaddr 00:15:5D:A2:33:41

inet addr:10.126.162.65 Bcast:10.126.163.255 Mask:255.255.252.0

inet6 addr: 2001:4898:4010:3012:215:5dff:fea2:3341/64 Scope:Global

inet6 addr: fe80::215:5dff:fea2:3341/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:36536 errors:0 dropped:0 overruns:0 frame:0

TX packets:6312 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:13994127 (13.3 MiB) TX bytes:645654 (630.5 KiB)

eth1 Link encap:Ethernet HWaddr 00:15:5D:A2:33:42

inet addr:10.126.162.66 Bcast:10.126.163.255 Mask:255.255.252.0

inet6 addr: 2001:4898:4010:3012:215:5dff:fea2:3342/64 Scope:Global

inet6 addr: fe80::215:5dff:fea2:3342/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:25962 errors:0 dropped:0 overruns:0 frame:0

TX packets:11 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:2597350 (2.4 MiB) TX bytes:754 (754.0 b)

loLink encap:Local Loopback

inet addr:127.0.0.1 Mask:255.0.0.0

inet6 addr: ::1/128 Scope:Host

UP LOOPBACK RUNNING MTU:65536 Metric:1

RX packets:12 errors:0 dropped:0 overruns:0 frame:0

TX packets:12 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:720 (720.0 b) TX bytes:720 (720.0 b)

在 CentOS 服务器上安装 iSCSI-initiator-utils。Install iSCSI-initiator-utils on your CentOS server. 执行以下步骤安装 iSCSI-initiator-utils。Perform the following steps to install iSCSI-initiator-utils.

以 root 身份登录到 CentOS 主机。Log on as root into your CentOS host.

安装 iSCSI-initiator-utils。Install the iSCSI-initiator-utils. 类型:Type:

yum install iscsi-initiator-utils

成功安装 iSCSI-Initiator-utils 后,启动 iSCSI 服务。After the iSCSI-Initiator-utils is successfully installed, start the iSCSI service. 类型:Type:

service iscsid start

有时 iscsid 无法真正启动,此时可能需要使用 --force 选项On occasions, iscsid may not actually start and the --force option may be needed

为确保在启动期间启用 iSCSI 发起程序,请使用 chkconfig 命令启用该服务。To ensure that your iSCSI initiator is enabled during boot time, use the chkconfig command to enable the service.

chkconfig iscsi on

若要验证是否已正确设置,请运行下面的命令:To verify that it was properly setup, run the command:

chkconfig --list | grep iscsi

下面显示了示例输出。A sample output is shown below.

iscsi 0:off 1:off 2:on3:on4:on5:on6:off

iscsid 0:off 1:off 2:on3:on4:on5:on6:off

从上面的示例可以看到,启动时,iSCSI 环境会在运行级别 2、3、4 和 5 运行。From the above example, you can see that your iSCSI environment will run on boot time on run levels 2, 3, 4, and 5.

安装 device-mapper-multipath。Install device-mapper-multipath. 类型:Type:

yum install device-mapper-multipath

安装随即开始。The installation will start. 系统提示确认时,请键入 Y。Type Y to continue when prompted for confirmation.

在 StorSimple 设备上On StorSimple device

StorSimple 设备应该:Your StorSimple device should have:

至少有两个接口已启用 iSCSI。A minimum of two interfaces enabled for iSCSI. 若要验证 StorSimple 设备上是否有两个接口已启用 iSCSI,请在 StorSimple 设备的 Azure 经典门户中执行以下步骤:To verify that two interfaces are iSCSI-enabled on your StorSimple device, perform the following steps in the Azure classic portal for your StorSimple device:

登录 StorSimple 设备的经典门户。Log into the classic portal for your StorSimple device.

选择 StorSimple Manager 服务,单击“设备”,然后选择特定的 StorSimple 设备。Select your StorSimple Manager service, click Devices and choose the specific StorSimple device. 单击“配置”并验证网络接口设置。Click Configure and verify the network interface settings. 以下屏幕截图显示两个已启用 iSCSI 的网络接口。A screenshot with two iSCSI-enabled network interfaces is shown below. 下面 DATA 2 和 DATA 3 两个 10 GbE 接口都已启用 iSCSI。Here DATA 2 and DATA 3, both 10 GbE interfaces are enabled for iSCSI.

553c82e721479b89c10a7342833f44bb.png

7ad14ec63c7830199212cd698271d196.png

在“配置”页中In the Configure page

确定这两个网络接口都已启用 iSCSI。Ensure that both network interfaces are iSCSI-enabled. “已启用 iSCSI”字段应设置为“是”。The iSCSI enabled field should be set to Yes.

确保网络接口的速度相同,两者都应是 1 GbE 或 10 GbE。Ensure that the network interfaces have the same speed, both should be 1 GbE or 10 GbE.

请记下已启用 iSCSI 的接口的 IPv4 地址,并保存供稍后在主机上使用。Note the IPv4 addresses of the iSCSI-enabled interfaces and save for later use on the host.

应该可以从 CentOS 服务器访问 StorSimple 设备上的 iSCSI 接口。The iSCSI interfaces on your StorSimple device should be reachable from the CentOS server.

若要验证是否可以访问,需要在主机服务器上提供已启用 StorSimple iSCSI 的网络接口的 IP 地址。To verify this, you need to provide the IP addresses of your StorSimple iSCSI-enabled network interfaces on your host server. 使用的命令以及 DATA2 (10.126.162.25) 和 DATA3 (10.126.162.26) 的相应输出如下所示:The commands used and the corresponding output with DATA2 (10.126.162.25) and DATA3 (10.126.162.26) is shown below:

[root@centosSS ~]# iscsiadm -m discovery -t sendtargets -p 10.126.162.25:3260

10.126.162.25:3260,1 iqn.1991-05.com.microsoft:storsimple8100-shx0991003g44mt-target

10.126.162.26:3260,1 iqn.1991-05.com.microsoft:storsimple8100-shx0991003g44mt-target

硬件配置Hardware configuration

建议在不同的路径上连接两个 iSCSI 网络接口,以实现冗余。We recommend that you connect the two iSCSI network interfaces on separate paths for redundancy. 下图显示可实现高可用性以及使 CentOS 服务器与 StorSimple 设备的多路径实现负载均衡的建议硬件配置。The figure below shows the recommended hardware configuration for high availability and load-balancing multipathing for your CentOS server and StorSimple device.

e987910e254db2b0a370e8174f987892.png

如上图所示:As shown in the preceding figure:

StorSimple 设备采用包含两个控制器的主动-被动配置。Your StorSimple device is in an active-passive configuration with two controllers.

两个 SAN 交换机已连接到设备控制器。Two SAN switches are connected to your device controllers.

在 StorSimple 设备上启用了两个 iSCSI 发起程序。Two iSCSI initiators are enabled on your StorSimple device.

CentOS 主机上已启用两个网络接口。Two network interfaces are enabled on your CentOS host.

如果主机和数据接口均可路由,则上述配置会在设备与主机之间生成 4 个不同的路径。The above configuration will yield 4 separate paths between your device and the host if the host and data interfaces are routable.

重要

建议不要对多路径混合使用 1 GbE 与 10 GbE 网络接口。We recommend that you do not mix 1 GbE and 10 GbE network interfaces for multipathing. 使用两个网络接口时,两者的类型应完全相同。When using two network interfaces, both the interfaces should be the identical type.

在 StorSimple 设备上,DATA0、DATA1、DATA4 和 DATA5 为 1 GbE 接口,DATA2 和 DATA3 为 10 GbE 网络接口。|On your StorSimple device, DATA0, DATA1, DATA4 and DATA5 are 1 GbE interfaces whereas DATA2 and DATA3 are 10 GbE network interfaces.|

配置步骤Configuration steps

多路径的配置步骤包括配置可用于自动发现的路径、指定要使用的负载均衡算法、启用多路径以及最终验证配置。The configuration steps for multipathing involve configuring the available paths for automatic discovery, specifying the load-balancing algorithm to use, enabling multipathing and finally verifying the configuration. 以下部分详细介绍了这些步骤。Each of these steps is discussed in detail in the following sections.

步骤 1:为自动发现配置多路径Step 1: Configure multipathing for automatic discovery

系统可以自动发现和配置多路径支持的设备。The multipath-supported devices can be automatically discovered and configured.

初始化 /etc/multipath.conf 文件。Initialize /etc/multipath.conf file. 类型:Type:

mpathconf --enable

上述命令将创建 sample/etc/multipath.conf 文件。The above command will create a sample/etc/multipath.conf file.

启动多路径服务。Start multipath service. 类型:Type:

service multipathd start

将显示以下输出:You will see the following output:

Starting multipathd daemon:

启用多路径自动发现。Enable automatic discovery of multipaths. 类型:Type:

mpathconf --find_multipaths y

此命令将修改 multipath.conf 的 defaults 节,如下所示:This will modify the defaults section of your multipath.conf as shown below:

defaults {

find_multipaths yes

user_friendly_names yes

path_grouping_policy multibus

}

步骤 2:为 StorSimple 卷配置多路径Step 2: Configure multipathing for StorSimple volumes

默认情况下,所有设备都已列入 multipath.conf 文件中的阻止列表,因而会被绕过。By default, all devices are blocklisted in the multipath.conf file and will be bypassed. 必须创建阻止列表例外,允许 StorSimple 设备中的卷启动多路径。You will need to create blocklist exceptions to allow multipathing for volumes from StorSimple devices.

编辑 /etc/mulitpath.conf 文件。Edit the /etc/mulitpath.conf file. 类型:Type:

vi /etc/multipath.conf

在 multipath.conf 文件中找到 blacklist_exceptions 节。Locate the blacklist_exceptions section in the multipath.conf file. 在此节中,需要将 StorSimple 设备列为阻止列表例外。Your StorSimple device needs to be listed as a blocklist exception in this section. 可按如下所示在此文件中取消注释相关行,以修改此文件(仅使用所用设备的特定型号):You can uncomment relevant lines in this file to modify it as shown below (use only the specific model of the device you are using):

blacklist_exceptions {

device {

vendor "MSFT"

product "STORSIMPLE 8100*"

}

device {

vendor "MSFT"

product "STORSIMPLE 8600*"

}

}

步骤 3:配置轮循机制多路径Step 3: Configure round-robin multipathing

此负载均衡算法以均衡的轮循机制方式,使用主动控制器的所有可用多路径。This load-balancing algorithm uses all the available multipaths to the active controller in a balanced, round-robin fashion.

编辑 /etc/multipath.conf 文件。Edit the /etc/multipath.conf file. 类型:Type:

vi /etc/multipath.conf

在 defaults 节下面,将 path_grouping_policy 设置为 multibus。Under the defaults section, set the path_grouping_policy to multibus. path_grouping_policy 指定将默认路径分组策略应用到未指定的多路径。The path_grouping_policy specifies the default path grouping policy to apply to unspecified multipaths. defaults 节如下所示。The defaults section will look as shown below.

defaults {

user_friendly_names yes

path_grouping_policy multibus

}

备注

最常用的 path_grouping_policy 值包括:The most common values of path_grouping_policy include:

failover = 每个优先级组的 1 个路径failover = 1 path per priority group

multibus = 1 个优先级组中的所有有效路径multibus = all valid paths in 1 priority group

步骤 4:启用多路径Step 4: Enable multipathing

重新启动 multipathd 守护程序。Restart the multipathd daemon. 类型:Type:

service multipathd restart

输出如下所示:The output will be as shown below:

[root@centosSS ~]# service multipathd start

Starting multipathd daemon: [OK]

步骤 5:验证多路径Step 5: Verify multipathing

首先确保与 StorSimple 设备建立 iSCSI 连接,如下所示:First make sure that iSCSI connection is established with the StorSimple device as follows:

a.a. 发现 StorSimple 设备。Discover your StorSimple device. 类型:Type:

iscsiadm -m discovery -t sendtargets -p :

如果 DATA0 的 IP 地址为 10.126.162.25,并且在 StorSimple 设备上打开了端口 3260 以便传送出站 iSCSI 流量,则输出如下所示:The output when IP address for DATA0 is 10.126.162.25 and port 3260 is opened on the StorSimple device for outbound iSCSI traffic is as shown below:

10.126.162.25:3260,1 iqn.1991-05.com.microsoft:storsimple8100-shx0991003g00dv-target

10.126.162.26:3260,1 iqn.1991-05.com.microsoft:storsimple8100-shx0991003g00dv-target

复制上述输出中 StorSimple 设备的 IQN,即 iqn.1991-05.com.microsoft:storsimple8100-shx0991003g00dv-target。Copy the IQN of your StorSimple device, iqn.1991-05.com.microsoft:storsimple8100-shx0991003g00dv-target, from the preceding output.

b.b. 使用目标 IQN 连接到该设备。Connect to the device using target IQN. 此处,StorSimple 设备即是 iSCSI 目标。The StorSimple device is the iSCSI target here. 类型:Type:

iscsiadm -m node --login -T

以下示例显示的输出中包含目标 IQN iqn.1991-05.com.microsoft:storsimple8100-shx0991003g00dv-target。The following example shows output with a target IQN of iqn.1991-05.com.microsoft:storsimple8100-shx0991003g00dv-target. 该输出指示已成功连接到设备上的两个已启用 iSCSI 的网络接口。The output indicates that you have successfully connected to the two iSCSI-enabled network interfaces on your device.

Logging in to [iface: eth0, target: iqn.1991-05.com.microsoft:storsimple8100-shx0991003g00dv-target, portal: 10.126.162.25,3260] (multiple)

Logging in to [iface: eth1, target: iqn.1991-05.com.microsoft:storsimple8100-shx0991003g00dv-target, portal: 10.126.162.25,3260] (multiple)

Logging in to [iface: eth0, target: iqn.1991-05.com.microsoft:storsimple8100-shx0991003g00dv-target, portal: 10.126.162.26,3260] (multiple)

Logging in to [iface: eth1, target: iqn.1991-05.com.microsoft:storsimple8100-shx0991003g00dv-target, portal: 10.126.162.26,3260] (multiple)

Login to [iface: eth0, target: iqn.1991-05.com.microsoft:storsimple8100-shx0991003g00dv-target, portal: 10.126.162.25,3260] successful.

Login to [iface: eth1, target: iqn.1991-05.com.microsoft:storsimple8100-shx0991003g00dv-target, portal: 10.126.162.25,3260] successful.

Login to [iface: eth0, target: iqn.1991-05.com.microsoft:storsimple8100-shx0991003g00dv-target, portal: 10.126.162.26,3260] successful.

Login to [iface: eth1, target: iqn.1991-05.com.microsoft:storsimple8100-shx0991003g00dv-target, portal: 10.126.162.26,3260] successful.

如果此处只显示了一个主机接口和两个路径,则需要在主机上为这两个接口启用 iSCSI。If you see only one host interface and two paths here, then you need to enable both the interfaces on host for iSCSI.

卷通过 StorSimple 设备向 CentOS 服务器公开。A volume is exposed to the CentOS server from the StorSimple device. 有关详细信息,请参阅步骤 6:创建卷(通过 StorSimple 设备上的 Azure 门户)。For more information, see Step 6: Create a volume via the Azure portal on your StorSimple device.

验证可用路径。Verify the available paths. 类型:Type:

multipath -l

以下示例显示通过两个可用路径连接到单个主机网络接口的 StorSimple 设备上的两个网络接口的输出。The following example shows the output for two network interfaces on a StorSimple device connected to a single host network interface with two available paths.

mpathb (36486fd20cc081f8dcd3fccb992d45a68) dm-3 MSFT,STORSIMPLE 8100

size=100G features='0' hwhandler='0' wp=rw

`-+- policy='round-robin 0' prio=0 status=active

|- 7:0:0:1 sdc 8:32 active undef running

`- 6:0:0:1 sdd 8:48 active undef running

以下示例显示通过四个可用路径连接到两个主机网络接口的 StorSimple 设备上的两个网络接口的输出。The following example shows the output for two network interfaces on a StorSimple device connected to two host network interfaces with four available paths.

mpathb (36486fd27a23feba1b096226f11420f6b) dm-2 MSFT,STORSIMPLE 8100

size=100G features='0' hwhandler='0' wp=rw

`-+- policy='round-robin 0' prio=0 status=active

|- 17:0:0:0 sdb 8:16 active undef running

|- 15:0:0:0 sdd 8:48 active undef running

|- 14:0:0:0 sdc 8:32 active undef running

`- 16:0:0:0 sde 8:64 active undef running

配置路径后,请参阅有关主机操作系统 (Centos 6.6) 的具体说明来装载和格式化此卷。After the paths are configured, refer to the specific instructions on your host operating system (Centos 6.6) to mount and format this volume.

排查多路径问题Troubleshoot multipathing

如果在配置多路径期间遇到任何问题,请参阅本部分提供的一些有用提示。This section provides some helpful tips if you run into any issues during multipathing configuration.

Q.Q. multipath.conf 文件中的更改未生效。I do not see the changes in multipath.conf file taking effect.

A.A. 对 multipath.conf 文件进行任何更改后,需要重新启动多路径服务。If you have made any changes to the multipath.conf file, you will need to restart the multipathing service. 键入以下命令:Type the following command:

service multipathd restart

Q.Q. 我在 StorSimple 设备上启用了两个网络接口并在主机上启用了两个网络接口。I have enabled two network interfaces on the StorSimple device and two network interfaces on the host. 但列出可用路径时,只看到两个路径。When I list the available paths, I see only two paths. 我原本以为能够看到四个可用路径。I expected to see four available paths.

A.A. 请确保这两个路径位于同一子网且可路由。Make sure that the two paths are on the same subnet and routable. 如果网络接口位于不同的 vLAN 且不可路由,则只会显示两个路径。If the network interfaces are on different vLANs and not routable, you will see only two paths. 验证方法之一是确定是否可从 StorSimple 设备上的网络接口访问这两个主机接口。One way to verify this is to make sure that you can reach both the host interfaces from a network interface on the StorSimple device. 需要联系 Microsoft 支持,因为这种验证只能通过支持会话完成。You will need to contact Microsoft Support as this verification can only be done via a support session.

Q.Q. 列出可用路径时,未看到任何输出。When I list available paths, I do not see any output.

A.A. 通常,看不到任何多路径的路径即表示多路径后台守护程序有问题,其中很有可能是 multipath.conf 文件有问题。Typically, not seeing any multipathed paths suggests a problem with the multipathing daemon, and it's most likely that any problem here lies in the multipath.conf file.

此外,最好是检查在连接到目标后是否确实能够看到一些磁盘,因为多路径列表不包含响应内容也可能意味着没有任何磁盘。It would also be worth checking that you can actually see some disks after connecting to the target, as no response from the multipath listings could also mean you don't have any disks.

使用以下命令重新扫描 SCSI 总线:Use the following command to rescan the SCSI bus:

$ rescan-scsi-bus.sh(sg3_utils 包的一部分)$ rescan-scsi-bus.sh (part of sg3_utils package)

键入以下命令:Type the following commands:

$ dmesg | grep sd*

或Or

$ fdisk -l

这些命令将返回最近添加的磁盘的详细信息。These will return details of recently added disks.

若要确定磁盘是否为 StorSimple 磁盘,请使用以下命令:To determine whether it is a StorSimple disk, use the following commands:

cat /sys/block//device/model

此命令将返回一个字符串,确定它是否为 StorSimple 磁盘。This will return a string, which will determine if it's a StorSimple disk.

有一个不太可能的原因是 iscsid pid 已过时。A less likely but possible cause could also be stale iscsid pid. 使用以下命令从 iSCSI 会话注销:Use the following command to log off from the iSCSI sessions:

iscsiadm -m node --logout -p

针对 iSCSI 目标(即 StorSimple 设备)上所有已连接的网络接口重复此命令。Repeat this command for all the connected network interfaces on the iSCSI target, which is your StorSimple device. 从所有 iSCSI 会话注销后,使用 iSCSI 目标 IQN 重新建立 iSCSI 会话。Once you have logged off from all the iSCSI sessions, use the iSCSI target IQN to reestablish the iSCSI session. 键入以下命令:Type the following command:

iscsiadm -m node --login -T

Q.Q. 我不确定我的设备是否被允许。I am not sure if my device is allowed.

A.A. 若要验证设备是否被允许,请使用以下故障排除交互式命令:To verify whether your device is allowed, use the following troubleshooting interactive command:

multipathd -k

multipathd> show devices

available block devices:

ram0 devnode blacklisted, unmonitored

ram1 devnode blacklisted, unmonitored

ram2 devnode blacklisted, unmonitored

ram3 devnode blacklisted, unmonitored

ram4 devnode blacklisted, unmonitored

ram5 devnode blacklisted, unmonitored

ram6 devnode blacklisted, unmonitored

ram7 devnode blacklisted, unmonitored

ram8 devnode blacklisted, unmonitored

ram9 devnode blacklisted, unmonitored

ram10 devnode blacklisted, unmonitored

ram11 devnode blacklisted, unmonitored

ram12 devnode blacklisted, unmonitored

ram13 devnode blacklisted, unmonitored

ram14 devnode blacklisted, unmonitored

ram15 devnode blacklisted, unmonitored

loop0 devnode blacklisted, unmonitored

loop1 devnode blacklisted, unmonitored

loop2 devnode blacklisted, unmonitored

loop3 devnode blacklisted, unmonitored

loop4 devnode blacklisted, unmonitored

loop5 devnode blacklisted, unmonitored

loop6 devnode blacklisted, unmonitored

loop7 devnode blacklisted, unmonitored

sr0 devnode blacklisted, unmonitored

sda devnode whitelisted, monitored

dm-0 devnode blacklisted, unmonitored

dm-1 devnode blacklisted, unmonitored

dm-2 devnode blacklisted, unmonitored

sdb devnode whitelisted, monitored

sdc devnode whitelisted, monitored

dm-3 devnode blacklisted, unmonitored

有关详细信息,请参阅多路径故障排除。

有用命令列表List of useful commands

类型Type

命令Command

说明Description

iSCSIiSCSI

service iscsid start

启动 iSCSI 服务Start iSCSI service

service iscsid stop

停止 iSCSI 服务Stop iSCSI service

service iscsid restart

重新启动 iSCSI 服务Restart iSCSI service

iscsiadm -m discovery -t sendtargets -p

发现指定地址上的可用目标Discover available targets on the specified address

iscsiadm -m node --login -T

登录到 iSCSI 目标Log in to the iSCSI target

iscsiadm -m node --logout -p

从 iSCSI 目标注销Log out from the iSCSI target

cat /etc/iscsi/initiatorname.iscsi

列显 iSCSI 发起程序名称Print iSCSI initiator name

iscsiadm -m session -s -P 3

检查 iSCSI 会话的状态以及在主机上发现的卷Check the state of the iSCSI session and volume discovered on the host

iscsi -m session

显示在主机与 StorSimple 设备之间建立的所有 iSCSI 会话Shows all the iSCSI sessions established between the host and the StorSimple device

多路径Multipathing

service multipathd start

启动多路径后台程序Start multipath daemon

service multipathd stop

停止多路径后台程序Stop multipath daemon

service multipathd restart

重新启动多路径后台程序Restart multipath daemon

chkconfig multipathd on OROR mpathconf -with_chkconfig y

使多路径后台程序在引导时启动Enable multipath daemon to start at boot time

multipathd -k

启动交互式控制台进行故障排除Start the interactive console for troubleshooting

multipath -l

列出多路径连接和设备List multipath connections and devices

mpathconf --enable

在 /etc/mulitpath.conf 中创建示例 mulitpath.conf 文件Create a sample mulitpath.conf file in /etc/mulitpath.conf

后续步骤Next steps

在 Linux 主机上配置 MPIO 时,可能还需要参考以下 CentoS 6.6 文档:As you are configuring MPIO on Linux host, you may also need to refer to the following CentoS 6.6 documents:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值