Konfigurasi DRBD

Konfigurasi DRBD

Berikut langkah-langkah konfigurasi DRBD

  • Lakukan konfigurasi file global_common.conf dengan perintah “nano /etc/drbd.d/global_common.conf”. Isikan script seperti di bawah ini.

global {   usage-count yes; }

common {

   handlers {

      pri-on-incon-degr “/usr/lib/drbd/notify-pri-on-incon-degr.sh; /usr/lib/drbd/notify- emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f”;

      pri-lost-after-sb “/usr/lib/drbd/notify-pri-lost-after-sb.sh; /usr/lib/drbd/notify-emergency- reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f”;

     local-io-error “/usr/lib/drbd/notify-io-error.sh; /usr/lib/drbd/notify-emergency- shutdown.sh; echo o > /proc/sysrq-trigger ; halt -f”;

}

        startup {

                   wfc-timeout 8;

                   degr-wfc-timeout 5;

                   outdated-wfc-timeout 2;

}

               options { cpu-mask 0; }

           disk {

                     on-io-error detach;

                     resync-rate 90M;

                     al-extents 3389;

}

net {

          protocol C;

          sndbuf-size 0;

           rcvbuf-size 0;

          after-sb-0pri disconnect;

          after-sb-1pri disconnect;

          after-sb-2pri disconnect;

          rr-conflict disconnect;

      }

 }

  • Kemudian buat file resource yang akan digunakan untuk mengontrol DRBD disk. Untuk membuat nama dataku.res (tidak harus seperti contoh) ketikan perintah “nano /etc/drbd.d/dataku.res“. Kemudian isikan script seperti di bawah pada masing-masing node.

            resource dataku {

                                       startup {

                                                    wfc-timeout 10;

                                                   degr-wfc-timeout 5;

                                                   outdated-wfc-timeout 3;

                                     }

                                      net {

                                                  protocol C;

                                                  cram-hmac-alg sha1;

                                                  shared-secret “datakumydrbd”;

                                                  rcvbuf-size 0;

                                                  sndbuf-size 0;

                                                  after-sb-0pri disconnect;

                                                  after-sb-1pri disconnect;

                                                  after-sb-2pri disconnect;

                                                  rr-conflict disconnect;

                                       }

                                         disk {

                                                  resync-rate 90M;

                                                  on-io-error detach;

                                                  al-extents 3389;

                                       }

                                        options { cpu-mask 0; }

                                         on mylab1.com {

                                                        volume 0 {

                                                       device /dev/drbd0;

                                                       disk /dev/sda4;

                                                       meta-disk /dev/sda3;

                                             }

                                                       address 192.168.2.100:7789;

                                             }

                                            on mylab2.com {

                                                      volume 0 {

                                                                     device /dev/drbd0;

                                                                     disk /dev/sda4;

                                                                     meta-disk /dev/sda3;

                                                                       }

                                                                   address 192.168.2.200:7789;

                                                  }

                }

  • Buat meta-disk dengan perintah “drbdadm create-md dataku“.
  • Jalankan service DRBD pada masing-masing node dengan perintah “service drbd start“.
  • Jadikan salah satu node ( menjadi aktif (primary) dengan perintah “drbdadm — –overwrite-data-of-peer primary dataku“.
  • Lihat status DRBD dengan mengetikan perintah “watch -n 1 cat /proc/drbd“. Perintah ini diketikan pada salah satu node, bisa di aktif node ataupun di pasif node.

  • Tunggu hingga disk state menjadi UpToDate/UpToDate.
  • Lakukan format pada disk dengan perintah mkfs.ex4 /dev/drbd0.

Sekilas Mengenai Cluster
Perangkat lunak pendukung failover
Konfigurasi Heartbeat

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: