Istilah gotong-royong tidak hanya digunakan dalam proses kerja manusia tetapi juga bisa diadaptasikan ke dalam proses kerja komputer. Kerja gotong royong ini bisa dimungkinkan untuk komputer mengingat komputer saat ini bisa saling berkomunikasi menggunakan jaringan baik internet maupun intranet. Istilah yang sering digunakan untuk konsep gotong-royong dalam proses komputasi adalah cluster computing, grid computing, atau paralel computing.
Kali ini yang dibahas adalah cluster storage dimana jaringan komputer akan digunakan sebagai gudang penyimpanan file. Ada banyak sistem cluster yang bisa digunakan untuk keperluan itu. Yang akan digunakan kali ini adalah GlusterFS. Untuk instalasinya, dilakukan berdasarkan tutorial di sini dan sini. Dalam artikel ini akan dituliskan sendiri pengalaman penulis sendiri ketika instalasi glusterfs dan pengujiannya.
Instalasi dilakukan pada 3 buah server VPS dengan sistem operasi Ubuntu 8.04. Langkah-langkah instalasi adalah sebagai berikut. Lebih baik menggunakan user root sehingga tidak repot dengan memasukkan password setiap kali memberikan perintah.
1. Persiapkan sebelum instal Fuse dan Glusterfs
============================================
## file: /etc/glusterfs/glusterfs-server.vol
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 posix-ns
type storage/posix
option directory /data/export-ns
end-volume
volume locks-ns
type features/locks
subvolumes posix-ns
end-volume
volume brick-ns
type performance/io-threads
option thread-count 8
subvolumes locks-ns
end-volume
volume server
type protocol/server
option transport-type tcp
option auth.addr.brick.allow *
option auth.addr.brick-ns.allow *
subvolumes brick brick-ns
end-volume
============================================
Setelah itu simpan file dan jalankan server daemon dengan
server 1 : 49.0.25.140
server 2 : 49.0.25.134
server 3 : 49.0.25.135
File konfigurasi dibuat dengan memberikan perintah
==============================
### Add client feature and attach to remote subvolume of server1
volume brick1
type protocol/client
option transport-type tcp/client
option remote-host 49.0.25.140 # IP address of the remote brick
option remote-subvolume brick # name of the remote volume
end-volume
### Add client feature and attach to remote subvolume of server2
volume brick2
type protocol/client
option transport-type tcp/client
option remote-host 49.0.25.134 # IP address of the remote brick
option remote-subvolume brick # name of the remote volume
end-volume
### Add client feature and attach to remote subvolume of server3
volume brick3
type protocol/client
option transport-type tcp/client
option remote-host 49.0.25.135 # IP address of the remote brick
option remote-subvolume brick # name of the remote volume
end-volume
### Add client feature and attach to remote subvolume of server1
volume brick1-ns
type protocol/client
option transport-type tcp/client
option remote-host 49.0.25.140 # IP address of the remote brick
option remote-subvolume brick-ns # name of the remote volume
end-volume
### Add client feature and attach to remote subvolume of server2
volume brick2-ns
type protocol/client
option transport-type tcp/client
option remote-host 49.0.25.134 # IP address of the remote brick
option remote-subvolume brick-ns # name of the remote volume
end-volume
volume afr1
type cluster/afr
subvolumes brick1 brick2
end-volume
volume afr2
type cluster/afr
subvolumes brick2 brick3
end-volume
volume afr3
type cluster/afr
subvolumes brick1 brick3
end-volume
volume afr-ns
type cluster/afr
subvolumes brick1-ns brick2-ns
end-volume
volume unify
type cluster/unify
option scheduler rr # round robin
option namespace afr-ns
subvolumes afr1 afr2 afr3
end-volume
==============================
Jumlah PC yang bisa digunakan adalah sesuai kemampuan saja. Untuk 2 PC dan 4 PC bisa dilihat di tutorial yang telah disebutkan.
Setelah itu mounting GlusterFS bisa dilakukan pada semua PC server.


Kali ini yang dibahas adalah cluster storage dimana jaringan komputer akan digunakan sebagai gudang penyimpanan file. Ada banyak sistem cluster yang bisa digunakan untuk keperluan itu. Yang akan digunakan kali ini adalah GlusterFS. Untuk instalasinya, dilakukan berdasarkan tutorial di sini dan sini. Dalam artikel ini akan dituliskan sendiri pengalaman penulis sendiri ketika instalasi glusterfs dan pengujiannya.
Instalasi dilakukan pada 3 buah server VPS dengan sistem operasi Ubuntu 8.04. Langkah-langkah instalasi adalah sebagai berikut. Lebih baik menggunakan user root sehingga tidak repot dengan memasukkan password setiap kali memberikan perintah.
1. Persiapkan sebelum instal Fuse dan Glusterfs
#apt-get install sshfs build-essential flex bison byacc vim2. Instal Fuse dari source code. Unduh dari situs glusterfs dan cari fuse-2.7.4glfs11.tar.gz dan salin lokasi tautan (copy link address)
#cd /root3. Instal GlusterFS dari source code juga yang bisa diperoleh dari situs yang sama. Lebih baik gunakan versi yang sama karena sepertinya harus ada kesesuaian antara versi Fuse dengan versi GlusterFS.
#wget http://download.gluster.com/pub/gluster/glusterfs/fuse/fuse-2.7.4glfs11.tar.gz
#tar -zxvf fuse-2.7.4glfs11.tar.gz
#cd /root/fuse-2.7.4glfs11
#./configure
#make && make install
#cd /root4. Menurut tutorialnya ada sedikit masalah, yaitu lokasi library yang terinstal. Untuk itu diperlukan perintah ini.
#wget http://download.gluster.com/pub/gluster/glusterfs/pre-releases/glusterfs-1.4.0rc7.tar.gz
#tar -zxvf glusterfs-1.4.0rc7.tar.gz
#cd /root/glusterfs-1.4.0rc7
#./configure
#make && make install
#cp -R /usr/local/lib/ /usr/lib/5. Membuat folder untuk operasi cluser storage
#mkdir /mnt/glusterfs6. Konfigurasi sebagai server. GlusterFS bekerja baik sebagai client atau server untuk tiap PC (perangkat komputer disebut PC agar tidak rancu dengan istilah server). Untuk itu perlu dibuat file konfigurasi baik sebagai server maupun sebagai client.Pertama-tama dibuat file konfigurasi sebagai server dan ini diletakkan di semua PC yang digunakan.
#mkdir /data/
#mkdir /data/export
#mkdir /data/export-ns
#mkdir /etc/glusterfs
#vi /etc/glusterfs/gluster-server.volFile tersebut akan digunakan untuk menyimpan kinerja PC sebagai server dengan isi sebagai berikut:
============================================
## file: /etc/glusterfs/glusterfs-server.vol
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 posix-ns
type storage/posix
option directory /data/export-ns
end-volume
volume locks-ns
type features/locks
subvolumes posix-ns
end-volume
volume brick-ns
type performance/io-threads
option thread-count 8
subvolumes locks-ns
end-volume
volume server
type protocol/server
option transport-type tcp
option auth.addr.brick.allow *
option auth.addr.brick-ns.allow *
subvolumes brick brick-ns
end-volume
============================================
Setelah itu simpan file dan jalankan server daemon dengan
#glusterfs -f /etc/glusterfs/glusterfs-server.vol7. Konfigurasi sebagai client.Pada eksperimen kali ini digunakan PC dengan IP berikut.
server 1 : 49.0.25.140
server 2 : 49.0.25.134
server 3 : 49.0.25.135
File konfigurasi dibuat dengan memberikan perintah
#vi /etc/glusterfs/glusterfs-client.volUntuk konfigurasi 3 PC adalah sebagai berikut :
==============================
### Add client feature and attach to remote subvolume of server1
volume brick1
type protocol/client
option transport-type tcp/client
option remote-host 49.0.25.140 # IP address of the remote brick
option remote-subvolume brick # name of the remote volume
end-volume
### Add client feature and attach to remote subvolume of server2
volume brick2
type protocol/client
option transport-type tcp/client
option remote-host 49.0.25.134 # IP address of the remote brick
option remote-subvolume brick # name of the remote volume
end-volume
### Add client feature and attach to remote subvolume of server3
volume brick3
type protocol/client
option transport-type tcp/client
option remote-host 49.0.25.135 # IP address of the remote brick
option remote-subvolume brick # name of the remote volume
end-volume
### Add client feature and attach to remote subvolume of server1
volume brick1-ns
type protocol/client
option transport-type tcp/client
option remote-host 49.0.25.140 # IP address of the remote brick
option remote-subvolume brick-ns # name of the remote volume
end-volume
### Add client feature and attach to remote subvolume of server2
volume brick2-ns
type protocol/client
option transport-type tcp/client
option remote-host 49.0.25.134 # IP address of the remote brick
option remote-subvolume brick-ns # name of the remote volume
end-volume
volume afr1
type cluster/afr
subvolumes brick1 brick2
end-volume
volume afr2
type cluster/afr
subvolumes brick2 brick3
end-volume
volume afr3
type cluster/afr
subvolumes brick1 brick3
end-volume
volume afr-ns
type cluster/afr
subvolumes brick1-ns brick2-ns
end-volume
volume unify
type cluster/unify
option scheduler rr # round robin
option namespace afr-ns
subvolumes afr1 afr2 afr3
end-volume
==============================
Jumlah PC yang bisa digunakan adalah sesuai kemampuan saja. Untuk 2 PC dan 4 PC bisa dilihat di tutorial yang telah disebutkan.
Setelah itu mounting GlusterFS bisa dilakukan pada semua PC server.
#glusterfs -f /etc/glusterfs/glusterfs-client.vol /mnt/glusterfs8. Pengujian. Setelah Dilakukan instalasi diperlukan pengujian untuk memastikan bahwa yang sudah dikerjakan berjalan dengan baik. Pengujian bisa dilakukan dengan melihat partisi yang ada pada PC server.
#df -h Filesystem Size Used Avail Use% Mounted on rootfs 15G 752M 13G 6% / /dev/root 15G 752M 13G 6% / /dev 257M 16K 257M 1% /dev tmpfs 257M 152K 256M 1% /var/run tmpfs 257M 0 257M 0% /var/lock tmpfs 257M 0 257M 0% /dev/shm glusterfs 44G 2.2G 39G 6% /mnt/glusterfsDari hasil yang ditampilkan tampak bahwa kapasitas untuk tiap PC server adalah 15 GB. Penggunaan sistem cluster memberikan kapasitas /mnt/glusterfs sekitar 44 GB, hampir 3 kali lipat kapasitas masing-masing PC server. Selain itu untuk mengetahui pembagian file yang disimpan dalam cluster storage digunakan perintah dari server 2.
#touch /mnt/glusterfs/uji1Hasilnya bisa dilihat pada PC lain. Misal pada PC 1 akan tampak seperti berikut :
#touch /mnt/glusterfs/uji2
#touch /mnt/glusterfs/uji3
#touch /mnt/glusterfs/uji4
#touch /mnt/glusterfs/uji5
#ls /data/export
uji1 uji2 uji3 uji4 uji5
#ls /data/exportSedangkan pada PC 3 akan tampak seperti berikut :
uji1 uji3 uji4
#ls /mnt/glusterfs/
uji1 uji2 uji3 uji4 uji5
#ls /mnt/glusterfs/Dari pengujian tersebut bisa dilihat bahwa dengan gotong-royong bisa digabungkan kapasitas penyimpanan dari masing-masing PC server.
uji1 uji2 uji3 uji4 uji5
#ls /data/export
uji1 uji2 uji3 uji4 uji5

0 comments:
Posting Komentar