Syndicate content

PVFS2 di Ubuntu

Tutorial ini akan menunjukkan langkah demi langkah memasang PVFS2 (Parallel Virtual File System v2) di Ubuntu. Cara yang sama seharusnya juga bisa diterapkan di atas Debian.

Tulisan ini diadaptasi dari sumber berikut.

PVFS2 akan diinstall pada 2 buah komputer bernama host-a dan host-b. Kedua komputer akan menyediakan storage (I/O server) dan menjadi client yang akan memount filesystem tersebut. Selain itu, host-a juga akan menjadi metadata server.

Berikut ini adalah langkah-langkahnya.

  1. Download PVFS2.

  2. Install paket-paket yang dibutuhkan. (Lakukan di kedua mesin)

    $ sudo apt-get install build-essential 
    $ sudo apt-get install linux-header-`uname -r` 
    $ sudo apt-get install libdb4.4 libdb4.4-dev
    
  3. Extract berkas PVFS2. (Lakukan di kedua mesin)

    $ tar xzf pvfs2-1.5.1.tar.gz
    
  4. Configure, make, make install, (Lakukan di kedua mesin)

    $ cd pvfs2-1.5.1
    $ ./configure --with-kernel=/lib/modules/`uname -r`/build/
    $ make
    $ make kmod
    $ sudo make kmod_install
    $ sudo make install
    

    Setelah diinstall, Anda akan melihat file-file baru di /usr/local/bin, /usr/local/sbin, dan direktori modul kernel.

  5. Install modul PVFS2 yang baru saja dibuat. (Lakukan di kedua mesin)

    $ sudo insmod /lib/modules/`uname -r`/kernel/fs/pvfs2/pvfs2.ko
    
  6. Buat direktori yang akan menjadi storage. (Lakukan di kedua mesin)

    $ sudo mkdir /pvfs-data
    
  7. Buat konfigurasi server. (Lakukan di host-a).

    host-a$ sudo /usr/local/bin/pvfs2-genconfig /etc/pvfs2-fs.conf /etc/pvfs2-server.conf
    
    **********************************************************************
            Welcome to the PVFS2 Configuration Generator:
    
    This interactive script will generate configuration files suitable
    for use with a new PVFS2 file system.  Please see the PVFS2 quickstart
    guide for details.
    
    **********************************************************************
    
    You must first select the network protocol that your file system will use.
    The only currently supported options are "tcp", "gm", and "ib".
    (For multi-homed configurations, use e.g. "ib,tcp".)
    
    * Enter protocol type [Default is tcp]: tcp
    
    Choose a TCP/IP port for the servers to listen on.  Note that this
    script assumes that all servers will use the same port number.
    
    * Enter port number [Default is 3334]: 3334
    
    Next you must list the hostnames of the machines that will act as
    I/O servers.  Acceptable syntax is "node1, node2, ..." or "node{#-#,#,#}".
    
    * Enter hostnames [Default is localhost]: host-a, host-b
    
    Now list the hostnames of the machines that will act as Metadata
    servers.  This list may or may not overlap with the I/O server list.
    
    * Enter hostnames [Default is localhost]: host-a
    
    Configured a total of 2 servers:
    2 of them are I/O servers.
    1 of them are Metadata servers.
    
    * Would you like to verify server list (y/n) [Default is n]? y
    
    ****** I/O servers:
    tcp://host-a:3334
    tcp://host-b:3334
    
    ****** Metadata servers:
    tcp://host-a:3334
    
    * Does this look ok (y/n) [Default is y]? y
    
    Choose a file for each server to write log messages to.
    
    * Enter log file location [Default is /tmp/pvfs2-server.log]: 
    
    Choose a directory for each server to store data in.
    
    * Enter directory name: [Default is /pvfs2-storage-space]: /pvfs-data
    
    Writing fs config file... Done.
    Writing 2 server config file(s)... Done.
    

    Pada direktori /etc akan terbentuk 3 buah file, yaitu pvfs2-fs.conf, pvfs2-server.conf-host-a, dan pvfs2-server.conf-host-b.

  8. Copy file konfigurasi ke host-b dari host-a.

    host-a$ scp /etc/pvfs2-* root@host-b:/etc
    

    Mungkin Anda perlu mengatur password untuk root di host-b. Anda juga bisa mencoba cara lain, yang jelas, pastikan konfigurasi dari host-a ada di host-b pada direktori yang sama (/etc).

  9. Inisialisasi direktori storage. (Lakukan di kedua mesin)

    Pada host-a:

    host-a$ sudo /usr/local/sbin/pvfs2-server /etc/pvfs2-fs.conf /etc/pvfs2-server.conf-host-a -f
    

    Pada host-b:

    host-b$ sudo /usr/local/sbin/pvfs2-server /etc/pvfs2-fs.conf /etc/pvfs2-server.conf-host-b -f
    

    Perhatikan file konfigurasi yang digunakan di setiap mesin.

  10. Jalankan aplikasi server. (Lakukan di kedua mesin).

    Pada host-a:

    host-a$ sudo /usr/local/sbin/pvfs2-server /etc/pvfs2-fs.conf /etc/pvfs2-server.conf-host-a
    

    Pada host-b:

    host-b$ sudo /usr/local/sbin/pvfs2-server /etc/pvfs2-fs.conf /etc/pvfs2-server.conf-host-b
    

    Perhatikan opsi -f yang tidak lagi digunakan saat menjalankan server.

  11. Buat konfigurasi client (mirip fstab, tapi khusus untuk keperluan PVFS2). Lakukan di kedua mesin atau salah satunya.

    host-a$ sudo vi /etc/pvfs2tab
    host-a$ cat /etc/pvfs2tab
    tcp://host-a:3334/pvfs2-fs /pvfs pvfs2 default,noauto 0 0
    
  12. Buat mount point.

    host-a$ sudo mkdir /pvfs
    
  13. Cek konfigurasi.

    host-a$ /usr/local/bin/pvfs2-ping -m /pvfs
    

    Anda akan melihat keterangan atas konfigurasi yang telah ada. Tulisan The PVFS2 filesystem at /pvfs appears to be correctly configured. akan muncul jika konfigurasi sudah benar.

  14. Jalankan aplikasi client.

    host-a$ sudo /usr/local/sbin/pvfs2-client -f -p /usr/local/sbin/pvfs2-client-core
    pvfs2-client starting
    Spawning new child process
    Waiting on child with pid 11924
    About to exec ./pvfs2-client-core
    

    Aplikasi client ini akan jalan di foreground

  15. Mount.

    host-a$ sudo mount -t pvfs2 tcp://host-a:3334/pvfs2-fs /pvfs
    

    Jika berhasil, saat Anda menjalankan program mount, Anda akan melihat partisi virtual yang dimount pada /pvfs

Data yang disimpan pada PVFS2 ini akan disebar ke setiap I/O Server (storage) yang ada (striping).

Contoh penggunaan: http://www.cbrc.jp/symposium/bg2006/PDF/Ross.pdf (506 clients, 116.8 TByte, 16 dual P4 server @ 7.3 TByte).

PVFS2 gunanya buat apa ya...?

bisa dipake tuk membuat cluster filesystem. misalnya ada kompi2 yg khusus dijadiin sbg penyedia storage. trus kompi2 tsb saling sharing filesystem dg cara membuat cluster. nanti client bisa me-mount filesystem tersebut. ngeliat banyak kompi dlm cluster sebagai 1 buah penyedia storage.

test comment