Skip to content

emka.web.id

menulis pengetahuan – merekam peradaban

Menu
  • Home
  • Tutorial
  • Search
Menu

Membuat High-Availability Storage Server dengan GlusterFS

Posted on October 8, 2010

Tutorial kali ini berangkat dari apa yang saya coba bangun kemarin, saya mencoba membuat 2 server storage dengan kemampuan tinggi menggunakan GlusterFS di Ubuntu Server 10.04. Skenarionya, setiap server storage akan menjadi cermin/mirror dari server storage yang lain dan file akan otomatis saling direplikasi diantara kedua server tersebut.

GlusterFS memang file sistem cluster yang luar biasa, GlusterFS mampu menangani storage sampai dengan akhiran petabyte!. Hal ini wajar karena Gluster sendiri dikembangkan dengan mengkombinasikan beberapa teknologi seperti Infiniband RDMA atau interkoneksi TCP/IP pada jaringan file sistem besar.

Sekadar catatan, IP Address yang saya gunakan adalah 192.168.0.100 untuk server1, 192.168.0.101 untuk server2 dan sebuah client dengan IP 192.168.0.102. Semua komputer tersebut harus sudah mempunyai hostname yang jelas (silakan oprek /etc/hosts/ anda).

Langkah Instalasi Server GlusterFS

1. masuk sebagai root pada terminal,
2. jalankan instalasi glusterfs-server dengan aptitude
[sourcecode language=”bash”]aptitude install glusterfs-server[/sourcecode]

setelah selesai kita dapat mengecek versi keberapa GlusterFS yang kita pakai dengan command [code]glusterfs –version[/code]
contohnya:
[code]
root@server1:~# glusterfs –version
glusterfs 3.0.2 built on Mar 23 2010 00:24:16
Repository revision: v3.0.2
Copyright (c) 2006-2009 Gluster Inc. <http://www.gluster.com>
GlusterFS comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GlusterFS under the terms of the GNU General Public License.
root@server1:~#
[/code]

3. buat beberapa direktori penting:
[code]mkdir /data/
mkdir /data/export
mkdir /data/export-ns[/code]

4. buat konfigruasi untuk glusterfs server di [code]/etc/glusterfs/gluesterfsd.vol[/code] dengan mencadangkan file asli dan melakukan pengubahan seperti mendefisikan kembali direktori yang akan diekspor (misalnya /data/export) dan client mana yang diperbolehkan (misalnya 192.168.0.102) dll.
[sourcecode]
cp /etc/glusterfs/glusterfsd.vol /etc/glusterfs/glusterfsd.vol_orig
cat /dev/null > /etc/glusterfs/glusterfsd.vol
vi /etc/glusterfs/glusterfsd.vol
[/sourcecode]

berikut konfigurasi milik saya:
[sourcecode]
volume posix
type storage/posix
option directory /data/export
end-volume

volume locks
type features/locks
subvolumes posix
end-volume

volume brick
type performance/io-threads
option thread-count 8
subvolumes locks
end-volume

volume server
type protocol/server
option transport-type tcp
option auth.addr.brick.allow 192.168.0.102
subvolumes brick
end-volume
[/sourcecode]
Oh ya, selain anda menetapkan IP address secara statik, anda bisa juga menggunakan wildcard seperti 192.168.* serta menaruh banyak IP pada baris yang sama dengan dipisah tanda koma.

5. restart daemon glusterfs server
[code]/etc/init.d/glusterfs-server start[/code]

Konfigurasi Client GlusterFS

Client dari sistem GlusterFS ini juga harus dikonfigurasi. Untuk tiap klien harus diinstall glusterfs-client dan glusterfs-server.

1. instalasi glusterfs-client dan glusterfs-server
[code]aptitude install glusterfs-client glusterfs-server[/code]

2. buat direktori untuk mounting sistem glusterfs
[code]mkdir /mnt/glusterfs[/code]

3. buat konfigurasi glusterfs.vol dengan langkah serupa (salin dan ubah).
[sourcecode]
cp /etc/glusterfs/glusterfs.vol /etc/glusterfs/glusterfs.vol_orig
cat /dev/null > /etc/glusterfs/glusterfs.vol
vi /etc/glusterfs/glusterfs.vol
[/sourcecode]

berikut contoh konfigurasi saya:
[code]
volume remote1
type protocol/client
option transport-type tcp
option remote-host server1.example.com
option remote-subvolume brick
end-volume

volume remote2
type protocol/client
option transport-type tcp
option remote-host server2.example.com
option remote-subvolume brick
end-volume

volume replicate
type cluster/replicate
subvolumes remote1 remote2
end-volume

volume writebehind
type performance/write-behind
option window-size 1MB
subvolumes replicate
end-volume

volume cache
type performance/io-cache
option cache-size 512MB
subvolumes writebehind
end-volume
[/code]

Catt. Pastikan anda mencantumkan hostname atau IP address yang benar pada baris-baris option remote-host!

Penggunaan

Untuk menggunakan storage besar ini, anda harus melakukan mounting dulu dengan perintah sebagai berikut:
[code]
glusterfs -f /etc/glusterfs/glusterfs.vol /mnt/glusterfs
[/code]
atau
[code]
mount -t glusterfs /etc/glusterfs/glusterfs.vol /mnt/glusterfs
[/code]

berikut adalah contoh apa yang terjadi ketika saya menjalankan command mount:

root@client1:~# mount
 /dev/mapper/server3-root on / type ext4 (rw,errors=remount-ro)
 proc on /proc type proc (rw,noexec,nosuid,nodev)
 none on /sys type sysfs (rw,noexec,nosuid,nodev)
 none on /sys/fs/fuse/connections type fusectl (rw)
 none on /sys/kernel/debug type debugfs (rw)
 none on /sys/kernel/security type securityfs (rw)
 none on /dev type devtmpfs (rw,mode=0755)
 none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
 none on /dev/shm type tmpfs (rw,nosuid,nodev)
 none on /var/run type tmpfs (rw,nosuid,mode=0755)
 none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
 none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
 none on /var/lib/ureadahead/debugfs type debugfs (rw,relatime)
 /dev/sda1 on /boot type ext2 (rw)
 /etc/glusterfs/glusterfs.vol on /mnt/glusterfs type fuse.glusterfs (rw,allow_other,default_permissions,max_read=131072)
 root@client1:~#

kalau dicek dengan perintah df -h, hasilnya sebagai berikut:

root@client1:~# df -h
 Filesystem            Size  Used Avail Use% Mounted on
 /dev/mapper/server3-root
                        29G  852M   26G   4% /
 none                  243M  172K  242M   1% /dev
 none                  247M     0  247M   0% /dev/shm
 none                  247M   36K  247M   1% /var/run
 none                  247M     0  247M   0% /var/lock
 none                  247M     0  247M   0% /lib/init/rw
 none                   29G  852M   26G   4% /var/lib/ureadahead/debugfs
 /dev/sda1             228M   17M  199M   8% /boot
 /etc/glusterfs/glusterfs.vol
                        18G  848M   16G   5% /mnt/glusterfs
 root@client1:~#

dapat dilihat kalau server1 memilik ruang bebas sekitar 18GB saja, padahal aslinya 36GB, hal ini dikarenakan kita memilih opsi saling mirror sehingga terdeteksi separuhnya saja.

Untuk melakukan mounting otomatis tiap sistem linux dijalankan, silakan masukkan baris berikut pada /etc/fstab:
[code]
/etc/glusterfs/glusterfs.vol /mnt/glusterfs glusterfs defaults 0 0
[/code]
Lakukan reboot pada client dan cek ulang dengan perintah df serta mount.

Salam,

Luthfi Emka
PPTIK Universitas Negeri Semarang

Terbaru

  • Inilah Update Terbaru Kasus Video Asusila Pasangan Bandar Batang yang Kini Masuk Tahap Penyidikan
  • Inilah 9 Aplikasi Penghasil Saldo DANA Tercepat dan Terbukti Membayar Tanpa Perlu Deposit
  • Inilah Cara Mengaktifkan Fitur Vertical Tab di Google Chrome Biar Tampilan Browser Kalian Makin Lega dan Rapi
  • Inilah Alasan Kenapa elementary OS Adalah Pilihan Paling Pas Buat Pengguna macOS yang Ingin Coba Linux
  • Inilah Alasan Kenapa Windows Server Kalian Restart Terus Setelah Update April 2026
  • Inilah Alasan Layar TV Kalian Sering Kedip Hitam Saat Main Game dan Cara Mengatasinya
  • Inilah Rekomendasi HP Redmi Note RAM 12 GB dan Koneksi 5G Paling Worth It Buat Kalian
  • Inilah Bocoran Event FF Mei 2026 yang Siap Bikin Dompet Kering, Ada Kuda dan MP40 Cobra!
  • Inilah Kejutan Kompensasi Bug FC Mobile 18 April 2026, Ada Kartu Flashback Gratis yang Bikin Skuad Makin Gahar!
  • Inilah Greenwashing: Trik Nakal Perusahaan Biar Terlihat Ramah Lingkungan Padahal Enggak!
  • Inilah Rekomendasi Parfum Segar untuk Cuaca Panas Agar Kalian Tetap Wangi Seharian Tanpa Bikin Pusing
  • Inilah 12 Aplikasi TV Online Terbaik 2026, Nonton Siaran Langsung Jadi Makin Gampang!
  • Inilah Rekomendasi Kipas Angin Dinding Terbaik Buat Ngatasin Cuaca Panas Tanpa Bikin Kantong Jebol
  • Inilah Cara Sewa Mobil yang Aman dan Nyaman Biar Liburan Kalian Makin Seru Tanpa Drama
  • Inilah Cara Daftar Lowongan 30.000 Manajer Koperasi Desa Merah Putih, Cek Jadwal Lengkapnya Di Sini!
  • Inilah Cara Daftar Lowongan 1.369 Manajer Operasional Kampung Nelayan Merah Putih Jadi Pegawai BUMN!
  • Inilah Perbedaan Skin Tint, Cushion, dan Foundation Biar Kalian Nggak Salah Pilih Base Makeup Natural
  • Inilah Rekomendasi Sepeda Lipat Dewasa Terbaik 2026 yang Paling Praktis untuk Kebutuhan Commuting dan Olahraga Harian
  • Inilah 5 Rekomendasi Sepeda Lipat Listrik Jarak Tempuh Terjauh Biar Mobilitas Kalian Makin Praktis!
  • Inilah 30 Ucapan Hari Kartini 2026 Paling Bermakna untuk Caption Media Sosial dan Pesan Personal yang Inspiratif
  • Inilah Cara Daftar Manajer Koperasi Merah Putih, Peluang Karir BUMN dengan 30.000 Formasi
  • Inilah 5 Rekomendasi Bedak Two Way Cake Anti Oksidasi Supaya Wajah Nggak Terlihat Kusam dan Gelap
  • Inilah Syarat dan Cara Mengurus Surat Sehat Jasmani Rohani untuk Daftar Manajer Kopdes Merah Putih
  • Inilah Alasan Harga Plastik Naik dan 7 Alternatif Kemasan Ramah Lingkungan yang Lebih Hemat buat UMKM
  • Inilah Profil Syekh Ahmad Al Misry dan Rekam Jejaknya yang Sedang Viral di Media Sosial
  • Inilah Alasan HP Nokia Jadul Harganya Masih Selangit dan Banyak Diburu Kolektor di Tahun 2026
  • Inilah HP Samsung A Series Terbaru yang Pakai Layar AMOLED, Mewah Tapi Harganya Terjangkau Banget!
  • Inilah Vivo T5 Pro, HP Midrange dengan Baterai 9.020 mAh yang Siap Comeback ke Indonesia!
  • Inilah Cara Daftar Manajer Koperasi Desa Merah Putih 2026, Ada 30.000 Formasi yang Bisa Kalian Lamar!
  • Inilah Alasan Kenapa Kemkomdigi Ancam Blokir Wikipedia dan Dampak Seriusnya Buat Masa Depan Pendidikan Kita
  • Is it Time to Replace Nano? Discover Fresh, the Terminal Text Editor You Actually Want to Use
  • How to Design a Services Like Google Ads
  • How to Fix 0x800ccc0b Outlook Error: Step-by-Step Guide for Beginners
  • How to Fix NVIDIA App Error on Windows 11: Simple Guide
  • How to Fix Excel Formula Errors: Quick Fixes for #NAME
  • How to Master Claude & NotebookLM to Boost Research and Productivity
  • How to create professional design prototypes and presentations with the power of Claude Design & Figma
  • How to Master Claude Code 2.0: The Ultimate Guide to AI Automation
  • How to Create Consistent AI-Generated Short Films and Assets with Seedance 2.0
  • How to create stunning sci-fi AI movie visuals like a pro With Seedance 2.0
  • Apa itu Spear-Phishing via npm? Ini Pengertian dan Cara Kerjanya yang Makin Licin
  • Apa Itu Predator Spyware? Ini Pengertian dan Kontroversi Penghapusan Sanksinya
  • Mengenal Apa itu TONESHELL: Backdoor Berbahaya dari Kelompok Mustang Panda
  • Siapa itu Kelompok Hacker Silver Fox?
  • Apa itu CVE-2025-52691 SmarterMail? Celah Keamanan Paling Berbahaya Tahun 2025

©2026 emka.web.id | Design: Newspaperly WordPress Theme