drbd 설치

yum install drbd82 kmod-drbd82


modprobe drbd


/etc/hosts

119.207.76.23   node1

119.207.76.24   node2


fdisk 로 +500G 잡아서 파티션하고 리붓


vi /etc/drbd.conf   ( node1, node2 )

global {

        usage-count yes;

}


common {

        syncer { rate 50M; }

}


resource "r0" {

        protocol C;

                syncer {

                }


        on node1 {

                address 119.207.76.23:7791;

                device          /dev/drbd0;

                disk            /dev/cciss/c0d0p6;

                meta-disk       internal;

        }

        on node2 {

                address 119.207.76.24:7791;

                device          /dev/drbd0;

                disk            /dev/xvdb1;

                meta-disk       internal;

        }

}


drbdadm create-md all ( node1, node2 ) 

(dd if=/dev/zero of=/dev/sda9 bs=1M count=128)

 

/etc/rc.d/init.d/drbd start (node1, node2 )


drbdadm -- --overwrite-data-of-peer primary all (node1)


mkfs.ext3 /dev/drbd0 (node1)

mount /dev/drbd0 /data/ (node1)


# check

cat /proc/drbd


• cs — connection state

• st — node state (local/remote)

• ld — local data consistency

• ds — data consistency

• ns — network send

• nr — network receive

• dw — disk write

• dr — disk read

• pe — pending (waiting for ack)

• ua — unack'd (still need to send ack)

• al — access log write count


# 마스터장애시 수동 전환

umount /data (node1)

drbdadm secondary all (node1)

cat /proc/drbd (node1)


drbdadm primary all (node2)

mount /dev/drbd0 /data (node2)

'리눅스ETC' 카테고리의 다른 글

yum 속도 개선  (0) 2016.03.30
rsync 에러  (0) 2016.03.30
오라클 redo/archive 이중화  (0) 2016.03.30
오라클 커넥션 에러  (0) 2016.03.30
오라클 리스너 로그 로테이트 시키기  (0) 2016.03.30

to Top