原文地址:
在使用 cman + gfs2 方案时,无法挂载文件系统,日志如下:
dlm_controld.log 日志信息
10:22:49 dlm_controld fenced_domain_info error -1
message 日志信息
10:11:08 h4-61 kernel: GFS2: fsid=: Trying to join cluster "lock_dlm", "cluster:fs" 10:11:08 h4-61 kernel: dlm: Using TCP for communications
fenced.log 日志信息
10:25:26 fenced fencing node node3 10:25:26 fenced fence node3 dev 0.0 agent none result: error no method
用strace 查看 dlm_controld 的系统调用,发现一直循环出现下面的信息
socket(PF_FILE, SOCK_STREAM, 0) = 22 connect(22, {sa_family=AF_FILE, path=@"fenced_query_sock"}, 20) = 0 write(22, "\355\34\341\17\1\0\1\0\6\0\0\0\0\0\0\0 \0\) = 32 read(22, "\355\34\341\17\1\0\1\0\6\0\0\0\0\0\0\0008) = 56 close(22) = 0 poll([{fd=5, events=POLLIN}, {fd=8, events=POLLIN}, ) = 0 (Timeout)
查阅了相关资料后,最终才发现是 分布式锁 dlm 的问题,加入下面参数到 cluster.conf中,问题解决
原来dlm_controld一直在等待fencing,而目前集群中没有配置fencing设备,所以导致了文件系统无法挂载
修改后,最终结果如下:
message 日志信息
10:23:32 kernel: GFS2: fsid=: Trying to join cluster "lock_dlm", "cluster:fs" 10:23:32 kernel: dlm: Using TCP for communications 10:23:32 kernel: GFS2: fsid=cluster:fs.0: Joined cluster. Now mounting FS... 10:23:32 kernel: GFS2: fsid=cluster:fs.0: jid=0, already locked for use 10:23:32 kernel: GFS2: fsid=cluster:fs.0: jid=0: Looking at journal... 10:23:32 kernel: GFS2: fsid=cluster:fs.0: jid=0: Done 10:23:32 kernel: GFS2: fsid=cluster:fs.0: jid=1: Trying to acquire journal lock... 10:23:32 kernel: GFS2: fsid=cluster:fs.0: jid=1: Looking at journal... 10:23:32 kernel: GFS2: fsid=cluster:fs.0: jid=1: Done 10:23:32 kernel: GFS2: fsid=cluster:fs.0: jid=2: Trying to acquire journal lock... 10:23:32 kernel: GFS2: fsid=cluster:fs.0: jid=2: Looking at journal... 10:23:32 kernel: GFS2: fsid=cluster:fs.0: jid=2: Done
dlm_controld.log 日志信息
10:11:08 dlm_controld uevent: add@/kernel/dlm/fs 10:11:08 dlm_controld kernel: add@ fs 10:11:08 dlm_controld uevent: online@/kernel/dlm/fs 10:11:08 dlm_controld kernel: online@ fs 10:11:08 dlm_controld dlm:ls:fs conf 1 1 0 memb 1 join 1 left 10:11:08 dlm_controld fs add_change cg 1 joined nodeid 1 10:11:08 dlm_controld fs add_change cg 1 we joined 10:11:08 dlm_controld fs add_change cg 1 counts member 1 joined 1 remove 0 failed 0
ok, 问题顺利解决
附: 其他有用的 dlm 相关参数
protocol
通信协议可以为:tcp, sctp, detect which
协议的选择和 rrp_mode 相关,如果为none,则使用tcp
默认值 detect
enable_fencing
encing恢复依赖性开关,默认开启
enable_quorum
quorum恢复依赖性开关,默认关闭
enable_deadlk
死锁检测开关,默认关闭
参考资料