Instalasi DRBL

From OnnoWiki
Jump to navigation Jump to search

Setup Linux Server

Install distribusi Linux dan konfigurasi semua network card. Perlu di ingat bahwa DRBL menggunakan IP private (contoh 192.168.x.x). Jika pada Linux anda, NetworkManager service start automatik, sebaiknya dimatikan. Pada Fedora: chkconfig --del NetworkManager, chkconfig --del NetworkManagerDispatcher, dan matikan network servis dengan "chkconfig network on". Di Debian / Ubuntu, sebaiknya di buang apt-get remove network-manager. Aturan Firewall akan mengeliminasi aturan yang ditulis oleh DRBL server. Setelah selesai menulis setup DRBL dan men-test-nya, anda dapat menulis aturan firewall yang kita inginkan. Pastikan, di lingkungan DRBL, layanan NFS, NIS, tftp, dan dhcp akan di perlukan, jangan blok layanan tersebut di firewall.

Jika kita ingin kinerja yang lebih baik, kita dapat melakukan beberapa hal. Hal ini hanya option, tidak keharusan:

  • Jika kita menggunakan Gnome sebagai lingkungan desktop, kita dapat men-delete beberapa file bahasa yang tidak digunakan di /etc/gconf/gconf.xml.defaults/ atau var/lib/gconf/defaults/. Contoh, kita dapat menyimpan %gconf-tree.xml, maka kita akan mempunyai sekitar 40MB tambahan harddisk. Jika kita mempunyai 40 client, kita akan menghemat harddisk 1.6GB di server, dan beban di server NFS akan lebih rendah. Di Debian atau Ubuntu, kita juga dapat menginstall localepurge, jalankan "localepurge" untuk membuang file local yang tidak dibutuhkan.
  • Jika ada filesystem reiserfs tersedia di distribusi Linux, reiserfs lebih di sukai karena akan memberikan kinerja yang lebih baik daripada ext2/ext3.
  • Setelah Linux di install di server, pastikan DMA mode di harddisk on. Hal ini akan mempercepat kecepatan akses di harddisk server. Gunakan "hdparm /dev/hdx" untuk mencek apakah mode DMA on atau off. Jika off, jalankan perintah "hdparm -d1 -c3 -k1 /dev/hdx" untuk meng-on-oan. Ganti /dev/hdx sesuai dengan nama device di linux anda, seperti /dev/hda.

Konfigurasi Client

Proses ini dilakukan di server, tapi untuk keperluan client. Sebaiknya selesaikan dulu langkah pertama di atas sebelum menjalankan langkah ini.

Cara Bagi Yang Punya Bandwidth ke Internet yang Cepat

Berikut adalah langkah di Debian / Ubuntu.

  • Jika Distribusi Linux anda mendukung secure apt (seperti Ubuntu Gutsy atau Debian Etch), kita dapat menambahkan DRBL key (ID: 1024D/D7E8DF3A, Key fingerprint = F532 A131 65AF 2168 1634 DB1B 4000 9511 D7E8 DF3A) ke apt-key menggunakan privilege root. Ada dua (2) cara untuk melakukan hal ini,
    • Pertama:
wget -q http://drbl.org/GPG-KEY-DRBL -O- | sudo apt-key add -
    • Kedua: Download key dari server ket. KeyID untuk DRBL adalah D7E8DF3A
gpg --keyserver subkeys.pgp.net --recv-key D7E8DF3A
gpg -a --export D7E8DF3A | apt-key add -


  • Edit /etc/apt/sources.list sebagai berikut:
    • Untuk Debian Lenny (5.0):
deb http://ftp.us.debian.org/debian/ lenny main # (Or any Debian mirror site near you)
deb http://drbl.sourceforge.net/drbl-core drbl stable
    • Untuk Ubuntu Maverick (10.10):
deb http://archive.ubuntu.com/ubuntu maverick main restricted universe multiverse # (Or any Ubuntu mirror site near you)
deb http://drbl.sourceforge.net/drbl-core drbl stable
    • Untuk Ubuntu Lucid (10.04):
deb http://archive.ubuntu.com/ubuntu lucid main restricted universe multiverse # (Or any Ubuntu mirror site near you)
deb http://drbl.sourceforge.net/drbl-core drbl stable
    • Jika anda ingin menggunakan DRBL yang masih dalam masa percobaan / test / unstable dapat menggunakan
deb http://drbl.sourceforge.net/drbl-core drbl stable testing
deb http://drbl.sourceforge.net/drbl-core drbl stable testing unstable
  • Jalankan
apt-get update
apt-get install drbl


Cara Bagi Yang Tidak Punya Bandwidth

Cara lain

  • download .deb drbl dari
http://drbl.sourceforge.net/
http://drbl.sourceforge.net/download/sourceforge/stable/pkg-files.php

Lakukan

dpkg -i drbl_1.9.7-28_all.deb 


gpg --keyserver subkeys.pgp.net --recv-key D7E8DF3A
gpg -a --export D7E8DF3A | apt-key add -
cd ~/.gnupg/
cp -Rf * /var/data/mirrorkeyring/


   * <Step 2b>
         o Scenario 1: If your network bandwidth to Internet is good, and your GNU/Linux distribution provides apt, urpmi or yum repository: Execute "/opt/drbl/sbin/drblsrv -i".  Note: There is a space before the "-i". This is the example execution. If you are uncertain, just press Enter to accept the default value.
         o Scenario 2: If you can not access Internet, the network bandwidth is narrow, you do not want drblsrv to install the required packages for you, or your GNU/Linux distribution does NOT provides apt, urpmi or yum repository (such as RHEL): You can install the required packages by yourself (such as by apt-get, up2date, yum, yast or urpmi), then use "/opt/drbl/sbin/drblsrv-offline" to finish this step <2b>. (drblsrv-offline is available from drbl version 1.7.6-22). Those required packages can be listed by "/opt/drbl/sbin/drblsrv-offline -r". After you install those required packages, if you are sure the kernel in the server meets the client's CPU arch, you can run "/opt/drbl/sbin/drblsrv-offline -s `uname -r`", or you can download appropriate kernel rpm/deb file, which meets the client's CPU arch. Then run "/opt/drbl/sbin/drblsrv-offline -k $KERNEL_PKG" (Replace $KERNEL_PKG with the downloaded kernel rpm or deb file name with path). If you are uncertain, just press Enter to accept the default value when you run drblsrv-offline. (PS 1. More options for drblsrv-offline can be shown by "/opt/drbl/sbin/drblsrv-offline --help". PS 2. To install DRBL in Scientific Linux 5.0, you can refer to this FAQ)
   * For the impatient: If you are impatient, your network bandwidth to Internet is good, and your GNU/Linux distribution provides apt, urpmi or yum repository, you can run "/opt/drbl/sbin/drbl4imp" to finish step "2b" and "3a". "drbl4imp" uses the default values to setup the DRBL server. THIS IS VERY IMPORTANT! The default value might not fit your environment! It uses the "range" option in dhcp server so your DRBL client will not always get the same IP address. It also assumes each of the server's network card (except eth0) provides DRBL services to 12 clients. If you want the setup to fit your environment, please run steps "2b" and "3a" step-by-step.

Setup File System untuk Client di Server

  • Atur lingkungan / environment dan pastikan anda mengerti tentang lingkungan tersebut.
     Taking NCHC's computer class room C as an example: There are 40 computers. In order to get DRBL to work more efficiently, we separated them to 4 subnets: 192.168.100.0, 192.168.101.0, 192.168.102.0 and 192.168.103.0. There are four Ethernet cards in DRBL server. One is for WAN and the others are for LAN. The IPs of DRBL environment (LAN) are 192.168.100.254, 192.168.101.254, 192.168.102.254 and 192.168.3.254. The services DHCP, TFTP, NFS, etc will run on eth0:1, eth1, eth2, and eth3.
              NIC    NIC IP                    Clients
     +-----------------------------+
     |         DRBL SERVER         |
     |                             |
     |+-- [eth0] public IP         +- to WAN
     |     (ex. 61.216.116.23)     |
     |                             |
     |+-- [eth0:1] 192.168.100.254 +- to clients group 1 [ 10 clients, their IP
     |                             |            from 192.168.100.1 - 192.168.100.10]
     |+-- [eth1] 192.168.101.254   +- to clients group 1 [ 10 clients, their IP
     |                             |            from 192.168.101.1 - 192.168.101.10]
     |+-- [eth2] 192.168.102.254   +- to clients group 2 [ 10 clients, their IP
     |                             |            from 192.168.102.1 - 192.168.102.10]
     |+-- [eth3] 192.168.103.254   +- to clients group 3 [ 10 clients, their IP
     |                             |            from 192.168.103.1 - 192.168.103.10]
     +-----------------------------+
   * There are four modes available from DRBL version 1.6.3 or later: Full DRBL, Full Clonezilla, DRBL SSI (Single System Image) and Clonezilla Box. The network bandwidth and disk space requirement are higher in the former two modes, but all the system setting will be saved to server's disk, and every client can have its own individual setting. On the other hand, the DRBL SSI uses single system image for all clients, and the necessary individual settings of clients are created run-time when they boot. This will reduce the required disk space in the server since only one image is necessary. However, the disadvantage is every client can NOT have its own individual system setting (Users' setting will be saved to server). In DRBL SSI mode, once there are extra client nodes want to join DRBL environment, all you have to do is modify the dhcpd config file (dhcpd.conf), then use "/opt/drbl/sbin/dcs -> others -> gen_3N_conf" to create or run "/opt/drbl/sbin/drbl-3n-conf generate", the necessary files will be created. In this mode, theoretically one network card in the server can provide 253 clients. The fourth mode, Clonezilla box mode, is based on DRBL SSI mode, especially for clone system. If you want to use DRBL SSI mode, make sure your client has large memory (say > 512 MB), and all the hardware (especially the graphic card) in the clients are the same. Check this comparison table for these four modes.
   * Notes for network switch and NICs when using multiple NICs:
     When you use multiple NICs to expand the bandwidth, we recommend you set the MAC addresses so that every node will get the same IP address all the time. (i.e. in the following step 3a, when you run "/opt/drbl/sbin/drblpush -i", it prompts "Do you want to fix the IP address of client connected to eth1 by giving MAC address ? [y/N]", choose "Y"). If you do NOT set MAC address (we will call it "range" from now), and you have only one 48-port network switch (or many switches but connected to be one), and you use four NICs (or more than two...) in DRBL server to expand the network bandwidth, a problem will occur (i.e. some clients will not lease IP from DHCP server) so it will not be able to boot.
     On the other hand, if your DRBL server uses four NICs to expand the network bandwidth (meaning that four NICs with four private subnets such as 192.168.100.x, 192.168,101,x, 192.168.102.x, 192.168.103.x), and you have exactly four switches that are separated and not connected to each other, then you can use range (i.e. you do not have to set the MAC address of clients).
     Remember, if you use N NICs to expand network bandwidth in the DRBL server, if using the "range" method, then you must have N switches and they can NOT be connected to each other.
   * Before executing step <3a>, you can do some customized config:
        1. If you have some specific directories in this DRBL server to share, such as /work1, then you can use text editor to open file /opt/drbl/conf/drbl.conf, edit the diskless_root_dir_ro_user_add="/work1"(If you want /work1 can only be read by clients, not writable), or diskless_root_dir_rw_user_add="/work1"(If you want /work1 to be readable and writable by clients. (Warning!!! drbl.conf is VERY IMPORTANT, be careful when you edit it!!!)
        2. If all the clients have their local harddisk, and the partition is formated (For example, /dev/hda1, its filesystem is ext3), then if you want the client to mount /dev/hda1 as /localwork when booting. Therefore you can edit /opt/drbl/conf/client-append-fstab, and its syntax is just like /etc/fstab. In this example, you can make /opt/drbl/conf/client-append-fstab like this:
           /dev/hda1 /localwork ext3 defaults 0 0
           (PS: You do not have to create the directory /tftpboot/node_root/localwork in DRBL server manually, later drblpush will do that for you)
        3. If you have extra services (such as apmd and bluetooth) to be on when client boots, you can edit /opt/drbl/conf/client-extra-service, let service_extra_added="apmd bluetooth".
        4. If you want to overwrite some or all automatically created hostnames later by "drblpush -i", you can edit "/opt/drbl/conf/client-ip-hostname" now. Check that file for the format. If some machines are not assigned, drblpush will use those automatically created hostname. 
   * <Step 3a> run "/opt/drbl/sbin/drblpush -i". The software will auto-detect the system to figure out the argument. If the argument is not set up in the system, the system will request you to do that. Example: see here.
   * Note!!! If newer packages are installed in the server after this step, you have to run "/opt/drbl/sbin/drblpush -i" or "/opt/drbl/sbin/drblpush -c /etc/drbl/drblpush.conf" (This will loaded the previously saved settings) again so that newer packages will be deployed to clients.
   * Note!!! It is not recommended to turn on the system update automatically. Since If newer packages are installed in the server automatically, without running "/opt/drbl/sbin/drblpush -i", the programs for client might not be compatible with that newer in server. If you want to turn on system update automatically, remember to follow the above step to update the files in client automatically.


IV. Setting up clients to use the DRBL environment

         o There are four different scenarios where you can make clients boot from network: 1) the client has PXE network interface card, 2) the client has a floppy drive, 3) the client has a CDROM, 4) the client has a local hard drive. We use etherboot 5.4.3 as an example for cases 2-4. NOTE! With DRBL version 1.3.9 or later, if you want to use Etherboot, Etherboot bersion 5.4.0 or newer is required.
         o Case 1: The client has a PXE network interface card
               + Set the client's BIOS to boot from "LAN" or "network".
               + Take one of the Asus motherboards for example, in this manual file.
                    1. Page 4-24, you will see OnBoard LAN, there is a subfuncton "OnBoard LAN BOOT ROM", normally it's disabled, you have to enable it.
                    2. Usually you have to reboot it now, make the function re-read by BIOS.
                    3. After rebooting, enter BIOS setting again, this time, in Page 4-35, you have to make LAN boot as the 1st boot device.
               + That's it. Let client boot and enjoy DRBL!!!
         o Case 2: The client has a floppy drive.
               + <Step 4a> Get the image file first.
                     # Use the "universal" image /opt/drbl-etherboot/etherboot-net.zdsk in the DRBL server. It supports most modern network cards. (Ref: here. If this universal image fails, try using specific image for client's network card, the image file is located in /opt/drbl-etherboot/. As an example, if you have a Realtek 8139 network card, use the image /opt/drbl-etherboot/rtl8139.zdsk.
               + <Step 4b> Insert the floppy to floppy drive in DRBL server
                     # Run "cat /opt/drbl-etherboot/etherboot-net.zdsk > /dev/fd0" in the DRBL server.
                     # If you want to create the image floppy in M$ windows, download rawrite.exe or "RawWrite for windows" (http://uranus.it.swin.edu.au/~jn/linux/) to write the ROM image to floppy.
               + <Step 4c> Put this floppy to client's floppy drive, make sure the floppy is the first boot device in the client's BIOS. If everything was done correctly, after a few minutes, the clients will be waiting for you to login, All the accounts are same as the ones in server.
         o Case 3: Client has a CDROM (Reference):
               + 1) The "universal" image is located in /opt/drbl-etherboot/etherboot-net.iso
                 2) Burn the ISO to a CD:
                 cdrecord -v speed=12 fs=16m dev=0,0,0 -data etherboot-net.iso
                 (If necessary, modify "dev=0,0,0", run "cdrecord -scanbus" to get your CD burner.)
                 3) Ensure the PC is set to boot from CDROM, place the burned CD in the drive, and reboot. Done!
         o Case 4: client has a local hard drive
               + If the client has a local hard drive which is installed with the bootloader grub in GNU/Linux:
                 1. Copy the file "/opt/drbl-etherboot/etherboot-net.zlilo" to client's directory "/boot/" in its harddisk
                 2. Append one block in the client's /boot/grub/menu.lst or /boot/grub/grub.conf (depends on your distribution) like this:
                 ---------------
                 title Etherboot-PXE
                 kernel /boot/etherboot-net.zlilo
                 ---------------
                 3. Change the default boot to the corresponding one above, like "default 1", in menu.lst or grub.conf in client.
               + If the client is running M$ Windows XP/2K on its hard disk:
                 You can install WINGRUB. Put the file etherboot-net.zlilo in C:\, and the files: C:\boot.ini and C:\GRUB\MENU.LST look like: (This method is only suitable for installing wingrub in BOOT.INI (Tool -> Install grub -> Boot from BOOT.INI). If necessary, you can use other modes provides by WinGRUB):
                 boot.ini:
                 ---------------
                 [boot loader]
                 timeout=30
                 default=C:\GRLDR
                 [operating systems]
                 multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
                 C:\GRLDR="Etherboot"
                 ---------------
                 MENU.LST:
                 ---------------
                 timeout 7
                 title etherboot
                 root (hd0,0)
                 kernel /etherboot-net.zlilo
                 title Windows at (hd0,0)
                 root (hd0,0)
                 chainloader +1
                 ---------------
               + If the client has local hard drive which is installed with M$ Windows 9x:
                 1. Copy the file "/opt/drbl-etherboot/etherboot-net.com" to client's hard disk
                 2. Rename it so that it is shorter in client, for example, "eb-net.com".
                 3. Write a multi-boot config file in the client (e.g. add one paragraph to run "eb-net.com").


V. Additional usage for the DRBL environment

         o Some useful scripts are located in the directories /opt/drbl/sbin and /opt/drbl/bin in the server, Take a look at them. Usage will appear by running them without parameters.
         o The most useful command is /opt/drbl/sbin/dcs which sets the client's default boot mode. Here's a screenshot of what it looks like:
           drbl_client_switch screenshot
         o Another useful command is drbl-SL.sh, it can load Small GNU/Linux (DSL, PuppyLinux, INSERT, PLD, Debian Live, GeeXbox, PUD-Linux...) into DRBL environment. By doing this, the client can use that Small GNU/Linu after booting via PXE. The client still can work even if the network cable is unplugged. It's fire and forget. For more info, check here.

6. Upgrade

     If newer DRBL packages are available, and you want to upgrade, you can do it by:
        1. Backup the important files, such as those files in /etc/drbl and /etc/dhcpd.conf or /etc/dhcp3/dhcpd.conf, etc...
        2. Run "/opt/drbl/sbin/drblsrv -u" to uninstall all the DRBL-related packages
        3. Follow the step II, download the drbl main program, re-install and configure it again (i.e. /opt/drbl/sbin/drblsrv -i and /opt/drbl/sbin/drblpush -i)
     Sometimes if the versions are close, maybe you can try to upgrade the packages without re-install and re-configure it (i.e. just use apt-get update; apt-get upgrade or yum upgrade). However, this is not recommended, since some of the files will only be deployed to clients after drblsrv and drblpush are run. 

Uninstall DRBL

Jalankan

/opt/drbl/sbin/drblsrv -u


Bug Report

Jalankan

/opt/drbl/bin/drbl-bug-report

Referensi

Pranala Menarik