GFS2:如何在 Ubuntu 18.04 中重命名 clustername/lockspace/fsid/locktable 名称

GFS2:如何在 Ubuntu 18.04 中重命名 clustername/lockspace/fsid/locktable 名称

前段时间,我创建了我的第一个 GFS2 来进行测试:

mkfs.gfs2 -t cluster-test:gfs-vol1 -p lock_dlm -j 3 /dev/vg2/gfs-vol1

mkfs.gfs2(8) man

-t 集群名称:锁空间

“锁定表”对用于在集群中唯一标识此文件系统。集群名称段(最多 32 个字符)必须与集群配置中指定的名称相匹配;只有此集群的成员才允许使用此文件系统。锁定空间段(最多 30 个字符)是用于区分此 gfs2 文件系统的唯一文件系统名称。有效的集群名称和锁定空间只能包含字母数字字符、连字符 (-) 和下划线 (_)。

经过测试我想将集群的名称从 cluster-test 更改为 cluster-prod。首先我在 corosync.conf 中更改了 totem (cluster_name) 的配置,但之后挂载失败。

mount: /gfs/gfs-vol1: mount(2) system call failed: Invalid request descriptor.

在 dmesg 中:

kernel: gfs2: fsid=cluster-test:gfs-vol1: Trying to join cluster "lock_dlm", "cluster-test:gfs-vol1"
kernel: dlm: Using TCP for communications
kernel: dlm: dlm cluster name 'cluster-prod' does not match the application cluster name 'cluster-test'
kernel: gfs2: fsid=cluster-test:gfs-vol1: dlm_new_lockspace error -53

如何更改文件系统中的 GFS2 集群名称以匹配 dlm/corosync?

答案1

更改很容易(如果您已经知道在哪里查找;我的情况不是这样)。两种不同的方法:

艰辛的道路(我的第一个猜测):

gfs2_edit -p sb field sb_locktable cluster-prod:gfs-vol1 /dev/vg2/gfs-vol1

简单的方法(尽管如果您不知道 tunegfs2 命令以及“锁表名称”与“文件系统标签”之间的关系,那么这不是很明显/直观):

tunegfs2 -L cluster-prod:gfs-vol1 /dev/vg2/gfs-vol1

如果你想更改“lockproto”,这也很有用

相关内容