/dev/drbd0 /data ---挂载 4、查看状态 [root@server1 ~]# drbd-overview 0:mysql Connected Primary/Secondary UpToDate.../UpToDate C r---- /data ext3 950M 18M 885M 2% [root@server2 ~]# drbd-overview 0:mysql Connected Secondary.../Primary UpToDate/UpToDate C r---- ---server1为主server2为辅 三 NFS配置 [root@server1 ~]# vim /etc/exports...上可以看到是主节点如下: image.png [root@server1 heartbeat]# drbd-overview 0:mysql Connected Primary/Secondary UpToDate.../UpToDate C r---- /data ext3 950M 18M 885M 2% 建立新挂载点,并挂载 mkdir /mnt/my mount 192.168.2.100:/data /mnt
/UpToDate C r----- ns:10484380 nr:0 dw:0 dr:10485292 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:.../UpToDate C r----- ns:0 nr:10484380 dw:10484380 dr:0 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:.../UpToDate C r----- ns:10783940 nr:0 dw:299560 dr:10486289 al:81 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:.../UpToDate C r----- ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0 大功告成,可以正常使用drbd存储.../UpToDate C r----- ns:0 nr:5238400 dw:5238400 dr:0 al:0 bm:320 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos
/UpToDate #本地同步状态/对端盘同步状态 /data/test #挂载点(盘被挂载才会显示) xfs #文件系统(盘被挂载才会显示).../UpToDate A r----- ns:0 nr:438102284 dw:2129640104 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0...Consistent #一个没有连接的节点数据一致,当建立连接时,它决定数据是UpToDate或是Outdated。 UpToDate #一致的最新的数据状态,这个状态为正常状态。.../DUnknown /data/test xfs 4.1T 322G 3.8T 8% 1:test02/0 Connected Secondary/Primary UpToDate/UpToDate...root@test02:~# drbd-overview 0:test02/0 Connected Primary/Secondary UpToDate/UpToDate /data/test
cstate all Connected ###查看资源角色 # drbdadm role all Primary/Secondary ###查看磁盘状态 # drbdadm dstate all UpToDate.../UpToDate 更多有关状态值,角色值等详细描述: http://drbd.linbit.com/users-guide-8.4/ ###资源的启用 # drbdadm up <resource.../UpToDate C /data ext3 2、命令drbd-overview # /usr/local/drbd/sbin/drbd-overview 0:redisk Connected...Primary/Secondary UpToDate/UpToDate C r----- /data ext3 1004M 18M 936M 2% 3、/proc/drbd文件查看 # cat /proc.../UpToDate C r----- I/O状态包括6种: 1).
/UpToDate C r----- ns:10484380 nr:0 dw:0 dr:10485292 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:.../UpToDate C r----- ns:0 nr:10484380 dw:10484380 dr:0 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:.../UpToDate C r----- ns:10783940 nr:0 dw:299560 dr:10486289 al:81 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:...DRBD UpToDate/DUnknown 故障恢复 1, 节点状态查看 (1) 主节点状态 [root@zhdy05 ~]# cat /proc/drbd version: 8.4.3 (api:1.../UpToDate C r----- ns:0 nr:5238400 dw:5238400 dr:0 al:0 bm:320 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos
dev,block))) panic("bread: getblk returned NULL\n"); // 之前已经读取过并且有效,则直接返回 if (bh->b_uptodate...当然操作系统会对数据的有效性进行维护(b_uptodate字段等于1说明有效)。 2 如果缓存失效,则调用ll_rw_block函数进行硬盘读取。 3 因为硬盘读取非常慢,所以这时候进程会阻塞。...等到进程被唤醒的时候再次通过b_uptodate字段判断是否读取成功。...b_uptodate字段会在数据读取成功的时候设置为1. static inline void wait_on_buffer(struct buffer_head * bh) { cli();...// 读写数据成功,数据有效位置1 CURRENT->bh->b_uptodate = uptodate; unlock_buffer(CURRENT->bh); 看一下unlock_buffer
Primary Node drbdadm primary --force r0 查看drbd状态: cat /proc/drbd 1:cs:SyncSource ro:Primary/Secondary ds:UpToDate.../UpToDate C r---- ns:2144476 nr:0 dw:36468 dr:2115769 al:14 bm:129 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos.../UpToDate C r---- ns:0 nr:2141684 dw:2141684 dr:0 al:0 bm:130 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0 2,drbd1...(api:88/proto:86-94) srcversion: 299AFE04D7AFD98B3CA0AF9 0: cs:WFConnection ro:Secondary/Unknown ds:UpToDate.../UpToDate C r---- ns:0 nr:20592 dw:20592 dr:0 al:0 bm:4 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0
2947 build by root@g105-2, 2007-07-28 07:13:14 1: cs:SyncTarget st:Secondary/Primary ds:Inconsistent/UpToDate.../UpToDate C r--- ns:305152 nr:0 dw:0 dr:305152 al:0 bm:19 lo:0 pe:0 ua:0 ap:0 resync: used:0/31 hits:...Revision: 2947 build by root@g105-1, 2007-07-28 07:13:14 1: cs:Connected st:Secondary/Secondary ds:UpToDate.../UpToDate C r--- ns:0 nr:5 dw:5 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 resync: used:0/31 hits:0 misses:0.../UpToDate C r--- ns:0 nr:5 dw:5 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 resync: used:0/31 hits:0 misses:0
/UpToDate C r----- # ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0 2.在两个节点上启动...peer role:Secondary replication:Established peer-disk:UpToDate [root@data2 heartbeat]$drbdadm...status data role:Secondary disk:UpToDate peer role:Primary replication:Established peer-disk...:UpToDate 4..../UpToDate C r----- /dev/drbd0 262M 166M 76M 69% /data/3306 #主从同步状态 data1 - 3306 -
) 以下操作仅在节点1(orasrv1)执行 # drbdadm primary --force redisk 0: State change failed: (-2) Need access to UpToDate...0ce4d235fc02b5c53c1c52c53433d11a694eab8c build by root@orasrv1.xlk.com, 2015-10-31 10:58:13 0: cs:Connected ro:Secondary/Secondary ds:UpToDate.../UpToDate C r----- ns:1044700 nr:0 dw:33780 dr:1045517 al:3 bm:64 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos...0ce4d235fc02b5c53c1c52c53433d11a694eab8c build by root@orasrv2.xlk.com, 2015-10-31 10:59:26 0: cs:Connected ro:Primary/Secondary ds:UpToDate.../UpToDate C r----- ns:0 nr:1044700 dw:1044700 dr:672 al:0 bm:64 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos
资源目前为次,正常接收对等节点的更新 Unknown 未知:资源角色目前未知,本地的资源不会出现这种状态 3硬盘状态 [root@chy database]# drbdadm dstate r0 //r0资源 UpToDate.../UpToDate 本地和对等节点的硬盘有可能为下列状态之一: Diskless 无盘:本地没有块设备分配给DRBD使用,这表示没有可用的设备,或者使用drbdadm命令手工分离或是底层的I/O错误导致自动分离...在一个节点上出现这种状态 Outdated:数据资源是一致的,但是已经过时 DUnknown:当对等节点网络连接不可用时出现这种状态 Consistent:一个没有连接的节点数据一致,当建立连接时,它决定数据是UpToDate...或是Outdated UpToDate:一致的最新的数据状态,这个状态为正常状态 4.启用/升级资源手动启用资源 手动启用资源 drbdadm up 手动禁用资源 drbdadm
dev,block))) panic("bread: getblk returned NULL\n"); // 之前已经读取过并且有效,则直接返回 if (bh->b_uptodate...bh->b_dirt) || (rw == READ && bh->b_uptodate)) { unlock_buffer(bh); return; } repeat...{ DEVICE_OFF(CURRENT->dev); // 读写数据成功,数据有效位置1 if (CURRENT->bh) { CURRENT->bh->b_uptodate...= uptodate; // 唤醒进程 unlock_buffer(CURRENT->bh); } if (!...uptodate) { printk(DEVICE_NAME " I/O error\n\r"); printk("dev %04x, block %d\n\r",CURRENT
awk '{print $2}') declare current=$(echo "${row}"|awk '{print $3}') declare uptodate...|awk '{print $5}') echo "deployment: ${name}, desired: ${desired}, current: ${current}, uptodate...: ${uptodate}, available: ${available}" if [ $((${desired})) == $((${current})) -a $((${current...})) == $((${uptodate})) -a $((${uptodate})) == $((${available})) ]; then echo "${name
; /* block number */ unsigned short b_dev; /* device (0 = free) */ unsigned char b_uptodate...panic("bread: getblk returned NULL\n"); // 之前已经读取过并且有效,则直接返回 if (bh->b_uptodate...= uptodate; // 唤醒进程 unlock_buffer(CURRENT->bh); } if...uptodate) { printk(DEVICE_NAME " I/O error\n\r"); printk("dev %04x, block %d\...bh[i]->b_uptodate) ll_rw_block(READ,bh[i]); } else bh[i] = NULL
检索当前主机名. build-helper:cpu-count 检索可用 CPU 的数量. build-helper:timestamp-property 根据当前日期和时间设置属性. build-helper:uptodate-property...根据文件集的输出相对于其输入是否是最新的来设置属性. build-helper:uptodate-properties 根据多个文件集的输出相对于它们的输入是否是最新的来设置多个属性. build-helper
4、 同步完成之后,通知follower成为uptodate状态。 5、 follower收到uptodate消息后,开始接受client请求服务。...uptodate消息:表明同步完成。
在一个节点上出现这种状态 #Outdated:数据资源是一致的,但是已经过时 #DUnknown:当对等节点网络连接不可用时出现这种状态 #Consistent:一个没有连接的节点数据一致,当建立连接时,它决定数据是UpToDate...或是Outdated #UpToDate:一致的最新的数据状态,这个状态为正常状态 格式化drbd磁盘 [root@node3 ~]# mkfs.xfs /dev/drbd1 ......Please consider using drbdtop. 1:mysql/0 Connected Secondary/Secondary UpToDate/UpToDate ## [root@node4...Please consider using drbdtop. 1:mysql/0 Connected Primary/Secondary UpToDate/UpToDate ##然后我们挂载试一下
node1 ~]# drbdadm primary --force test [root@node1 ~]# drbdadm status test test role:Primary disk:UpToDate...等待一段时间,完成98.96% [root@node1 ~]# drbdadm status test test role:Primary disk:UpToDate peer role:Secondary...Inconsistent done:98.96 # 再等待一段时间,完成同步 [root@node1 ~]# drbdadm status test test role:Primary disk:UpToDate...peer role:Secondary replication:Established peer-disk:UpToDate [root@node1 ~]# mkfs -t ext4 /dev
C ro在主从服务器上分别显示 Primary/Secondary和Secondary/Primary ds显示UpToDate/UpToDate 表示主从配置成功 -------------.../UpToDate C 注意:这里实际生产环境若Primary主节点宕机,在Secondary状态信息中ro的值会显示为Secondary/Unknown,只需要进行DRBD提权操作即可。.../UpToDate C 然后挂载DRBD [root@Secondary ~]# mkdir /data [root@Secondary ~]# mount /dev/drbd0 /data [.../UpToDate C r----- /data ext4 9.8G 23M 9.2G 1% [root@Secondary ~]# drbd-overview 0:r0 Connected...Secondary/Primary UpToDate/UpToDate C r-----
server连接; 2 .Follower连接leader,将最大的zxid发送给leader; 3 .Leader根据follower的zxid确定同步点; 4 .完成同步后通知follower 已经成为uptodate...状态; 5 .Follower收到uptodate消息后,又可以重新接受client的请求进行服务了。...的消息循环处理如下几种来自Leader的消息: 1 .PING消息: 心跳消息; 2 .PROPOSAL消息:Leader发起的提案,要求Follower投票; 3 .COMMIT消息:服务器端最新一次提案的信息; 4 .UPTODATE
领取专属 10元无门槛券
手把手带您无忧上云