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

DRBD with external meta disk

· 52CE 我爱测

I am attempting to create a failover with DRBD and I have two partitions. Partition 1) /dev/sda4 is setup for the KVMs I will be creating. Partition 2) /dev/sda5 is for the DRBD metadata My config file is below resource r0 { prot…

问题原文

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

I am attempting to create a failover with DRBD and I have two partitions.

Partition 1) /dev/sda4 is setup for the KVMs I will be creating. Partition 2) /dev/sda5 is for the DRBD metadata

My config file is below

resource r0 {
    protocol C;
    startup {
            wfc-timeout  15;
            degr-wfc-timeout 60;
    }
    net {
            cram-hmac-alg sha1;
            shared-secret "SECRET_KEY";
    }
    on Server1{
            device /dev/drbd0;
            disk /dev/sda4;
            address IP:7788;
            meta-disk /dev/sda5;
    }
    on Server2{
            device /dev/drbd0;
            disk /dev/sda4;
            address IP:7788;
            meta-disk /dev/sda5;
    }

}

When I run drbdadm create-md r0 it runs successfully but it creates /dev/drbd0 on both partitions.

    ├─sda4      8:4    0  7.2T  0 part
    │ └─drbd0 147:0    0  7.2T  1 disk
    └─sda5      8:5    0  399M  0 part
      └─drbd0 147:0    0  7.2T  1 disk

It's my understanding that it should only create it on the meta disk which is /dev/sda5. The reason I setup the meta disk is to avoid any writing to sda4. Am I correct in that reasoning or am I missing something.

已采纳解答

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

Finally figured this out. By putting the volume group on top of DRBD0 everything is now working.

I did run into a problem when creating a volume group on the device and had to add filter to lvm.conf

I got an error that said

Cannot use device /dev/drbd/ with duplicates

I just added the this to the devices section

filter = [ "r|/dev/sda4|", "r|/dev/disk/|", "r|/dev/block/|", "a/.*/" ]

Everything works great now

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

资料来源与适用范围

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

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

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