大网数据广告活动
服务器运维问答

GFS2: How rename clustername / lockspace / fsid / locktable name in Ubuntu 18.04

· 52CE 我爱测

Some time ago I created my first GFS2 to do tests: mkfs.gfs2 -t cluster-test:gfs-vol1 -p lock_dlm -j 3 /dev/vg2/gfs-vol1 From mkfs.gfs2(8) man : -t clustername:lockspace The "lock table" pair used to uniquely identify this filesy…

问题原文

原帖链接 · ggrandes · CC BY-SA 4.0

Some time ago I created my first GFS2 to do tests:

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

From mkfs.gfs2(8) man:

-t clustername:lockspace

The "lock table" pair used to uniquely identify this filesystem in a cluster. The cluster name segment (maximum 32 characters) must match the name given to your cluster in its configuration; only members of this cluster are permitted to use this file system. The lockspace segment (maximum 30 characters) is a unique file system name used distinguish this gfs2 file system. Valid clusternames and lockspaces may only contain alphanumeric characters, hyphens (-) and underscores (_).

After testing I want to change the name of the cluster from cluster-test to cluster-prod. First I changed the configuration of totem (cluster_name) in corosync.conf, but after that mount failed.

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

In 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

How to change the GFS2 clustername in filesystem to match dlm/corosync?

已采纳解答

原帖链接 · ggrandes · CC BY-SA 4.0

The change is easy (if you already know where to look; not was my case). Two different ways:

Hardway (my first guess):

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

Easyway (although not very obvious/intuitive if you don't know tunegfs2 command and relation between "locktable name" and "filesystem label"):

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

This is also useful if you want to change the "lockproto"

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-02-07)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。