Linux-HA + dm-multipath:路径删除导致段错误、内核空指针取消引用和 STONITH

Linux-HA + dm-multipath:路径删除导致段错误、内核空指针取消引用和 STONITH

我正在设置一个运行

*pacemaker-1.1.5

*openais-1.1.4

*多路径工具-0.4.9

*OpenSuSE 11.4,内核 2.6.37

集群配置通过了 LinBit 的健康检查,因此我对它非常有信心。

使用多路径是因为我们有一个 LSI SAS 阵列通过 2 个 HBA 连接到每个主机(每个主机总共 4 条路径)。我现在想做的是通过从多路径设置中删除路径来测试故障转移功能。

多路径路径如下:

pgsql-data (360080e50001b658a000006874e398abe) dm-0 LSI,INF-01-00
size=6.0T features='0' hwhandler='1 rdac' wp=rw
|-+- policy='round-robin 0' prio=0 status=active
| |- 4:0:0:1 sda 8:0   active undef running
| `- 5:0:0:1 sde 8:64  active undef running
`-+- policy='round-robin 0' prio=0 status=enabled
|- 4:0:1:1 sdc 8:32  active undef running
`- 5:0:1:1 sdg 8:96  active undef running

为了模拟丢失路径,我将 1 回显到 /sys/block/{path}/device/state。这会导致路径对多路径出现失败/故障,如下所示:

pgsql-data (360080e50001b658a000006874e398abe) dm-0 LSI,INF-01-00
size=6.0T features='0' hwhandler='1 rdac' wp=rw
|-+- policy='round-robin 0' prio=0 status=active
| |- 4:0:1:1 sdc 8:32  failed faulty offline
| `- 5:0:1:1 sdg 8:96  active undef  running
`-+- policy='round-robin 0' prio=0 status=enabled
|- 4:0:0:1 sda 8:0   active undef  running
`- 5:0:0:1 sde 8:64  active undef  running

然而,通过观察 /var/log/messages 我发现 rdac 检查器表示该路径仍然有效:

multipathd: pgsql-data: sdc - rdac checker reports path is up

另外,让我们回顾一下 multipath -l 输出——注意到失败的路径仍然在活动组中吗?它应该被移动到已启用的组,并且已启用的活动/正在运行的路径应该取代它(处于活动状态)。

现在,如果我们关闭另一条活动启用路径 sdg,则 rdac 不仅会报告路径已启动,而且多路径资源在集群中会进入 FAILED 状态,两条活动/启用路径都不会取代它,结果就是出现段错误(无法取消引用 NULL 点的内核错误),并且集群会对该节点执行 STONITH 操作。

db01-primary:/home/kendall/scripts # crm resource show
db01-secondary-stonith     (stonith:external/ipmi) Started 
db01-primary-stonith       (stonith:external/ipmi) Started 
Master/Slave Set: master_drbd [drbd_pg_xlog]
 Masters: [ db01-primary ]
 Slaves: [ db01-secondary ]
Resource Group: ha-pgsql
 multipathd (lsb:/etc/init.d/multipathd) Started  FAILED
 pgsql_mp_fs        (ocf::heartbeat:Filesystem) Started 
 pg_xlog_fs (ocf::heartbeat:Filesystem) Started 
 ha-DBIP-mgmt       (ocf::heartbeat:IPaddr2) Started 
 ha-DBIP    (ocf::heartbeat:IPaddr2) Started 
 postgresql (ocf::heartbeat:pgsql) Started 
 incron     (lsb:/etc/init.d/incron) Started 
 pgbouncer  (lsb:/etc/init.d/pgbouncer) Stopped 
pager-email    (ocf::heartbeat:MailTo) Stopped 

db01-primary:/home/kendall/scripts # multipath -l
pgsql-data (360080e50001b658a000006874e398abe) dm-0 LSI,INF-01-00
size=6.0T features='0' hwhandler='1 rdac' wp=rw
|-+- policy='round-robin 0' prio=0 status=enabled
| |- 4:0:1:1 sdc 8:32  failed faulty offline
| `- 5:0:1:1 sdg 8:96  failed faulty offline
`-+- policy='round-robin 0' prio=0 status=active
|- 4:0:0:1 sda 8:0   active undef  running
`- 5:0:0:1 sde 8:64  active undef  running

以下是 /var/log/messages 中的一段摘录,显示了内核错误

Aug 17 15:30:40 db01-primary multipathd: 8:96: mark as failed
Aug 17 15:30:40 db01-primary multipathd: pgsql-data: remaining active paths: 2
Aug 17 15:30:40 db01-primary kernel: [ 1833.424180] sd 5:0:1:1: rejecting I/O to    offline device
Aug 17 15:30:40 db01-primary kernel: [ 1833.424281] device-mapper: multipath: Failing path 8:96.
Aug 17 15:30:40 db01-primary kernel: [ 1833.428389] sd 4:0:0:1: rdac: array , ctlr 1, queueing MODE_SELECT command
Aug 17 15:30:40 db01-primary multipathd: dm-0: add map (uevent)
Aug 17 15:30:41 db01-primary kernel: [ 1833.804418] sd 4:0:0:1: rdac: array , ctlr 1, MODE_SELECT completed
Aug 17 15:30:41 db01-primary kernel: [ 1833.804437] sd 5:0:0:1: rdac: array , ctlr 1, queueing MODE_SELECT command
Aug 17 15:30:41 db01-primary kernel: [ 1833.808127] sd 5:0:0:1: rdac: array , ctlr 1, MODE_SELECT completed
Aug 17 15:30:42 db01-primary multipathd: pgsql-data: sda - rdac checker reports path is up
Aug 17 15:30:42 db01-primary multipathd: 8:0: reinstated
Aug 17 15:30:42 db01-primary kernel: [ 1835.639635] device-mapper: multipath: adding disabled device 8:32
Aug 17 15:30:42 db01-primary kernel: [ 1835.639652] device-mapper: multipath: adding disabled device 8:96
Aug 17 15:30:42 db01-primary kernel: [ 1835.640666] BUG: unable to handle kernel NULL pointer dereference at           (null)
Aug 17 15:30:42 db01-primary kernel: [ 1835.640688] IP: [<ffffffffa01408a3>] dm_set_device_limits+0x23/0x140 [dm_mod]

还有一个堆栈跟踪,可从以下位置获取http://pastebin.com/gifMj7gu

multipath.conf 可在以下位置获得: http://pastebin.com/dw9pqF3Z

有谁对此有任何见解,和/或知道如何进行?

我每次都可以重新创建它。

答案1

好的,事实证明,仅在 /sys/block/{dev}/device/state 中设置“离线”不足以使 rdac 报告路径已关闭。昨晚我花了一些时间在设备上,拉动 SAS 电缆并观察系统的行为。这正常工作。不太“符合预期”,因为当活动路径发生故障时,它不会被从启用组中替换,但这是另一个问题。故障转移也按预期工作;一旦最后一条路径丢失,集群就会关闭数据库和相关资源,并将它们转移到辅助节点。

如果您遇到类似情况,可以尝试在 multipath.conf 中将多路径 hwhandler 设置为“0”;您必须在 device{} 部分中设置此项。这基本上会禁用路径检查,因此一旦设备离线,它就真的离线了。

相关内容