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

  • Caranya Ngebangun Website Directory dengan Traffic Tinggi dalam Seminggu!
  • Cara Mengembangkan Channel YouTube Shorts Tanpa Wajah
  • Inilah Cara Menghitung Diskon Baju Lebaran Biar Nggak Bingung Saat Belanja di Mall!
  • Cara Jitu Ngebangun Bisnis SaaS di Era AI Pakai Strategi Agentic Workflow
  • Inilah Rincian Gaji Polri Lulusan Baru 2026, Cek Perbedaan Jalur Akpol, Bintara, dan Tamtama Sebelum Daftar!
  • Inilah 5 Channel YouTube Membosankan yang Diam-diam Menghasilkan Banyak Uang
  • Inilah Cara Pakai Google Maps Offline Biar Mudik Lebaran 2026 Nggak Nyasar Meski Tanpa Sinyal!
  • Inilah Alasan Mahkamah Agung Tolak Kasasi Google, Denda Rp202,5 Miliar Resmi Menanti Akibat Praktik Monopoli
  • Inilah Cara Daftar dan Syarat SPMB SMK Boarding Jawa Tengah 2026, Sekolah Gratis Sampai Lulus!
  • Inilah Daftar Sekolah Kedinasan 2026 untuk Lulusan SMK, Bisa Kuliah Gratis dan Berpeluang Besar Langsung Jadi CPNS!
  • Inilah Pajak TER: Skema Baru PPh 21 yang Nggak Bikin Pusing, Begini Cara Hitungnya!
  • Inilah Jadwal Resmi Jam Buka Tol Jogja-Solo Segmen Prambanan-Purwomartani Saat Mudik Lebaran 2026
  • Inilah Cara Mendapatkan Witherbloom di Fisch Roblox, Rahasia Menangkap Ikan Paling Sulit di Toxic Grove!
  • Kenapa Indomart Point Bisa Kalahkan Bisnis Kafe?
  • Inilah Cara Mendapatkan Rotten Seed di Fisch Roblox, Lokasi Rahasia di Toxic Grove Buat Unlock Toxic Lotus!
  • Inilah Cara Zakat Crypto Kalian Bisa Jadi Pengurang Pajak Berdasarkan Aturan Resmi Pemerintah!
  • Inilah Perbandingan Airwallex vs Payoneer 2026: Jangan Sampai Profit Kalian Ludes Gara-Gara Biaya Admin!
  • Inilah Roadmap 7 Tahap Bangun Bisnis Digital dari Nol Biar Nggak Cuma Putar-Putar di Tempat!
  • Inilah Cara Tetap Gajian dari YouTube Meski View Masih Ratusan, Penasaran?
  • Inilah Alasan Akun TikTok Affiliate GMV 270 Juta Kena Banned Permanen!
  • Inilah Bahaya Astute Beta Server APK, Jangan Sembarang Klik Link Download FF Kipas 2026!
  • Inilah Bahaya Nonton Film di LK21 dan IndoXXI, Awas Data Pribadi dan Saldo Rekening Kalian Bisa Ludes!
  • Inilah Kronologi & Video Lengkap Kasus Sejoli Tambelangan Sampang Viral, Ternyata Gini Awal Mulanya!
  • Inilah Alasan Kenapa Koin Nego Neko Shopee Nggak Bisa Dipakai Bayar Full dan Cara Rahasia Dapetinnya!
  • Inilah Cara Menjawab Pertanyaan Apakah di Sekolahmu Sudah Ada IFP/PID dengan Benar dan Profesional
  • Inilah Fakta Isu Roblox Diblokir di Indonesia 2026, Benarkah Akan Ditutup Total?
  • Inilah Penyebab dan Cara Mengatasi FF Kipas My ID Verify UID Biar Akun Tetap Aman
  • Inilah Deretan HP RAM 8GB Harga di Bawah 2 Juta Terbaik 2026, Spek Dewa Tapi Nggak Bikin Kantong Jebol!
  • Contoh Cara Buat SK Panitia TKA 2026
  • Inilah Cara Download Point Blank ID Versi Terbaru 2026, Gampang Banget Ternyata!
  • How to Fix Python Not Working in VS Code Terminal: A Troubleshooting Guide
  • Game File Verification Stuck at 0% or 99%: What is it and How to Fix the Progress Bar?
  • Why Does PowerPoint Underline Hyperlinks? Here is How to Remove Them
  • AI Bug Hunting with Semgrep
  • What is the Excel Power Query 0xc000026f Error?
  • Claude Code Tips: Don’t Overuse SKILL.md!
  • How to Planning Cinematic AI Film Production: A Step-by-Step Tutorial Using LitMedia Tools
  • 6 Innovative AI Tools for 2026: From Voice Cloning to Advanced Automation Systems
  • How to Run Hunter Alpha: The Free 1 Trillion Parameter AI Agent on OpenClaw
  • Build Your Own Self-Improving AI: A Guide to Andrej Karpathy’s Autoresearch and Claude Code
  • 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