belajar mengkonfigurasi bonding mode-1 backup) di rhel 5.5

15
 Belajar Mengkonfigurasi Bonding Mode-1 (Active-Backup) Di RHEL 5.5 http://iwing.wordpress.com Pada kesempatan ini penulis berkesempatan untuk berexperimen dan mengenal konfigurasi bonding mode-1 ( active-backup) di RHEL 5.5. (Gambar-1) Bonding adalah proses menggabungkan 2 buah NIC atau lebih menjadi sebuah device tunggal. Sebagai contoh saya memiliki 2 buah NIC eth1 dan eth2, kemudian saya gabungkan keduanya kedalam satu buah device tunggal yaitu bond0. “Bounded”  interface digunakan untuk redudansi atau meningkatkan troughtput, perilaku dari “Bounded”  interface tergantung dari mode yang digunakan, mode-modenya adalah sebagai berikut : [0  Sets a round-robin policy for fault tolerance and load balancing. Transmissions are received and sent out sequentially on each bonded slave interface beginning with the first one available. 1  Sets an active-backup policy for fault tolerance. Transmissions are received and sent out via the  first available bonded slave interface. Another bonded slave interface is only used if the active bonded slave interface fails. 2  Sets an XOR (exclusive-or) policy for fault tolerance and load balancing. Using this method, the interface matches up the incoming request's MAC address with the MAC address for one of the slave NICs. Once this link is established, transmissions are sent out sequentially beginning with the first available interface. 3  Sets a broadcast policy for fault tolerance. All transmissions are sent on all slave interfaces. 4  Sets an IEEE 802.3ad dynamic link aggregation policy. Creates aggregation groups that share the same speed and duplex settings. Transmits and receives on all slaves in the active aggregator. Requires a switch that is 802.3ad compliant. 5  Sets a Transmit Load Balancing (TLB) policy for fault tolerance and load balancing. The outgoing traffic is distributed according to the current load on each slave interface. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the  failed slave. 6  Sets an Active Load Balancing (ALB) policy for fault tolerance and load balancing. Includes transmit and receive load balancing for IPV4 traffic. Receive load balancing is achieved through ARP negotiation.] 1  Dari sekian banyak mode yang ada kebutuhan saya adalah sebagai berikut, jika salah satu nic server bermasalah maka dengan otomatis paket akan dilewatkan ke nic yang lain. Ilustrasinya adalah sebagai berikut :

Upload: iwing

Post on 17-Jul-2015

3.003 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5

5/14/2018 Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5 - slidepdf.com

http://slidepdf.com/reader/full/belajar-mengkonfigurasi-bonding-mode-1-backup-di-rhel-55 1/15

 

Belajar Mengkonfigurasi Bonding Mode-1 (Active-Backup) Di RHEL 5.5http://iwing.wordpress.com 

Pada kesempatan ini penulis berkesempatan untuk berexperimen dan mengenal konfigurasi bonding

mode-1 ( active-backup) di RHEL 5.5.

(Gambar-1)

Bonding adalah proses menggabungkan 2 buah NIC atau lebih menjadi sebuah device tunggal.

Sebagai contoh saya memiliki 2 buah NIC eth1 dan eth2, kemudian saya gabungkan keduanya

kedalam satu buah device tunggal yaitu bond0. “Bounded” interface digunakan untuk redudansi atau

meningkatkan troughtput, perilaku dari “Bounded”  interface tergantung dari mode yang digunakan,

mode-modenya adalah sebagai berikut :

[0 — Sets a round-robin policy for fault tolerance and load balancing. Transmissions are received and 

sent out sequentially on each bonded slave interface beginning with the first one available.

1 — Sets an active-backup policy for fault tolerance. Transmissions are received and sent out via the

  first available bonded slave interface. Another bonded slave interface is only used if the active

bonded slave interface fails.

2—

Sets an XOR (exclusive-or) policy for fault tolerance and load balancing. Using this method, theinterface matches up the incoming request's MAC address with the MAC address for one of the slave

NICs. Once this link is established, transmissions are sent out sequentially beginning with the first 

available interface.

3 — Sets a broadcast policy for fault tolerance. All transmissions are sent on all slave interfaces.

4 — Sets an IEEE 802.3ad dynamic link aggregation policy. Creates aggregation groups that share

the same speed and duplex settings. Transmits and receives on all slaves in the active aggregator.

Requires a switch that is 802.3ad compliant.

5 — Sets a Transmit Load Balancing (TLB) policy for fault tolerance and load balancing. The outgoing

traffic is distributed according to the current load on each slave interface. Incoming traffic is received 

by the current slave. If the receiving slave fails, another slave takes over the MAC address of the

 failed slave.6 — Sets an Active Load Balancing (ALB) policy for fault tolerance and load balancing. Includes

transmit and receive load balancing for IPV4 traffic. Receive load balancing is achieved through ARP

negotiation.]1 

Dari sekian banyak mode yang ada kebutuhan saya adalah sebagai berikut, jika salah satu nic server

bermasalah maka dengan otomatis paket akan dilewatkan ke nic yang lain. Ilustrasinya adalah

sebagai berikut :

Page 2: Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5

5/14/2018 Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5 - slidepdf.com

http://slidepdf.com/reader/full/belajar-mengkonfigurasi-bonding-mode-1-backup-di-rhel-55 2/15

 

 

(Gambar-2 Kondisi normal)

(Gambar-3 Kondisi Eth-1 bermasalah)

(Gambar-4 Kondisi Eth-1 kembali up)

Page 3: Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5

5/14/2018 Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5 - slidepdf.com

http://slidepdf.com/reader/full/belajar-mengkonfigurasi-bonding-mode-1-backup-di-rhel-55 3/15

 

Dengan kebutuhan yang ada maka pilihan mode jatuh ke mode-1.

Langkah-langkah untuk mengkonfigurasi bounding adalah sebagai berikut (berdasarkan pengalaman

penulis):

1). Tambahkan line berikut di /etc/modprobe.conf 

(Gambar-5)

2). Buat konfigurasi bounding interface (ifcfg-bond0 ) di directory /etc/sysconfig/network-

scripts/

-------------------------------------------------------------------- 

DEVICE=bond0

IPADDR=192.168.10.1

NETWORK=192.168.10.0

NETMASK=255.255.255.0

USERCTL=no

BOOTPROTO=none

ONBOOT=yes

TYPE=bond 

--------------------------------------------------------------------

Page 4: Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5

5/14/2018 Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5 - slidepdf.com

http://slidepdf.com/reader/full/belajar-mengkonfigurasi-bonding-mode-1-backup-di-rhel-55 4/15

 

3). Konfigurasi interface  – interface ethernet yang akan dijadikan anggota dari bounding interface,

dalam kasus ini adalah eth1 dan eth2 seperti berikut:

-------------------------------------------------------------------- 

# Intel Corporation 82540EM Gigabit Ethernet Controller DEVICE=eth1

BOOTPROTO=none

HWADDR=08:00:27:A8:31:48

ONBOOT=yes

USERCTL=no

ONBOOT=yes

MASTER=bond0

SLAVE=yes

TYPE=Ethernet

--------------------------------------------------------------------

-------------------------------------------------------------------- 

# Intel Corporation 82540EM Gigabit Ethernet Controller 

DEVICE=eth2

BOOTPROTO=none

HWADDR=08:00:27:1A:06:BC 

ONBOOT=yes

USERCTL=no

ONBOOT=yes

MASTER=bond0

SLAVE=yes

TYPE=Ethernet

--------------------------------------------------------------------

4). Save kemudian restart service networknya.

5). Cek hasil konfigurasi tadi dengan perintah ifconfig bond0 (seperti pada gambar-6)

(Gambar-6)

Page 5: Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5

5/14/2018 Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5 - slidepdf.com

http://slidepdf.com/reader/full/belajar-mengkonfigurasi-bonding-mode-1-backup-di-rhel-55 5/15

 

 

(Gambar-7)

(Gambar-8)

6). Cek hasil konfigurasi bonding cat /proc/net/bonding/bond0  seperti pada gambar-9, terlihat

bahwa bonding mode sudah sesuai dengan yang kita konfigurasi yaitu pada mode-1, terlihat juga

bahwa eth1 bertindak sebagai active slave dengan ini maka paket dilewatkan melalui eth1,sedangkan eth2 bertindak sebagai backup.

Page 6: Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5

5/14/2018 Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5 - slidepdf.com

http://slidepdf.com/reader/full/belajar-mengkonfigurasi-bonding-mode-1-backup-di-rhel-55 6/15

 

 

(Gambar-9)

7). Kemudian kita simulasikan seolah-olah eth1 mengalami masalah, hal ini disimulaikan dengan

perintah ifconfig eth1 down seperti terlihat pada gambar-10

(Gambar-10)

Page 7: Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5

5/14/2018 Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5 - slidepdf.com

http://slidepdf.com/reader/full/belajar-mengkonfigurasi-bonding-mode-1-backup-di-rhel-55 7/15

 

Cek lagi konfigurasi bond dengan cat /proc/net/bonding/bond0 , terlihat bahwa setelah eth1 down

maka eth2 berubah menjadi active slave, pada kondisi ini paket dilewatkan melalui eth2.

8). Kemudian kita simulasikan seolah-olah eth1 kembali normal dan up, hal ini disimulaikan dengan

perintah ifconfig eth1 up seperti terlihat pada gambar-11

(Gambar-11)

Cek lagi konfigurasi bond dengan cat /proc/net/bonding/bond0 , terlihat bahwa setelah eth1 up

maka eth2 tetap menjadi active slave. Keadaan ini sudah sesuai dengan kebutuhan yang kita

perlukan (lihat gambar-2, gambar-3 dan gambar-4)

Page 8: Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5

5/14/2018 Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5 - slidepdf.com

http://slidepdf.com/reader/full/belajar-mengkonfigurasi-bonding-mode-1-backup-di-rhel-55 8/15

 

9). Gambar-12 menunjukan ping ke server 192.168.10.1 selama pengujian, terlihat ketika eth1 down

ataupun kembali up tidak ada paket yang loss.

(Gambar-12)

10). Sekenario berikutnya adalah sebagai berikut, kita ingin agar salah satu nic bertindak selaku

active slave seterusnya, pada kasus ini kita pilih eth2 sebagai primary link. Jadi ketika keadaan

normal maka paket akan melewati eth2 (seperti pada gambar-13)

(Gambar-13)

Page 9: Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5

5/14/2018 Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5 - slidepdf.com

http://slidepdf.com/reader/full/belajar-mengkonfigurasi-bonding-mode-1-backup-di-rhel-55 9/15

 

Kemudian apabila eth2 bermasalah, maka eth1 bertindak sebagai active slave (seperti pada gambar-

14)

(Gambar-14)

Dan apabila eth2 kembali up dan normal maka eth2 kembali menjadi active slave dan menjadi

primary link seperti pada gambar-15

(Gambar-15)

Page 10: Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5

5/14/2018 Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5 - slidepdf.com

http://slidepdf.com/reader/full/belajar-mengkonfigurasi-bonding-mode-1-backup-di-rhel-55 10/15

 

11). Untuk mengakomodir kebutuhan skenario diatas maka kita hanya perlu menambahkan line

 primary=eth[X] di /etc/modprobe.conf 

(Gambar-16)

12). Restart service network lalu cek hasilnya cat /proc/net/bonding/bond0  

(Gambar-17)

Page 11: Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5

5/14/2018 Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5 - slidepdf.com

http://slidepdf.com/reader/full/belajar-mengkonfigurasi-bonding-mode-1-backup-di-rhel-55 11/15

 

Terlihat pada gambar-17 primary slave dan active slave terletak pada eth2

13). Kemudian kita simulasikan seolah-olah eth2 mengalami masalah, hal ini disimulaikan dengan

perintah ifconfig eth2 down seperti terlihat pada gambar-18

(Gambar-18)

Cek lagi konfigurasi bond dengan cat /proc/net/bonding/bond0 , terlihat bahwa setelah eth2 down

maka eth1 berubah menjadi active slave, pada kondisi ini paket dilewatkan melalui eth1.

Page 12: Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5

5/14/2018 Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5 - slidepdf.com

http://slidepdf.com/reader/full/belajar-mengkonfigurasi-bonding-mode-1-backup-di-rhel-55 12/15

 

13). Kemudian kita simulasikan seolah-olah eth2 kembali up dan normal, hal ini disimulaikan dengan

perintah ifconfig eth2 up seperti terlihat pada gambar-19

(Gambar-19)

Cek lagi konfigurasi bond dengan cat /proc/net/bonding/bond0 , terlihat bahwa setelah eth2 up

maka eth2 kembali berubah menjadi active slave, pada kondisi ini paket dilewatkan melalui eth2.

Kondisi ini telah sesuai dengan yang kita harapkan, lihat gambar ilustrasi 13, 14 dan 15.

Tapi dari beberapa server yang di setting tidak semuanya berhasil mulus, ada server yang telah

disetting dengan cara diatas, mode yang di pilih adalah mode=1 akan tetapi mode yang keluar

adalah mode=0 :

Page 13: Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5

5/14/2018 Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5 - slidepdf.com

http://slidepdf.com/reader/full/belajar-mengkonfigurasi-bonding-mode-1-backup-di-rhel-55 13/15

 

 

(Gambar-20)

(Gambar-21)

Page 14: Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5

5/14/2018 Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5 - slidepdf.com

http://slidepdf.com/reader/full/belajar-mengkonfigurasi-bonding-mode-1-backup-di-rhel-55 14/15

 

Salah satu solusinya adalah menambahkan script di /etc/sysconfig/network-

scripts/ifcfg-bond[X] dan me-uncomand kan script di /etc/modprobe.conf

(Gambar-22)

(Gambar-23)

Page 15: Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5

5/14/2018 Belajar Mengkonfigurasi Bonding Mode-1 Backup) Di RHEL 5.5 - slidepdf.com

http://slidepdf.com/reader/full/belajar-mengkonfigurasi-bonding-mode-1-backup-di-rhel-55 15/15

 

Ref:

[1]. Red Hat Enterprise Linux 5.0.0, Red Hat Enterprise Linux Deployment Guide (page 504).

[2].Credit to Kang Maliki (http://mohammadmaliki.blogspot.com/) dan Kang Onay

(http://dudulz.wordpress.com/) yang telah memberikan wawasan tentang bonding kepada penulis.