Search:  
Gentoo Wiki

HOWTO_Install_Mythtv_With_Diskless_Workstations_in_an_OpenMosix_Cluster

This page is currently undergoing strong development, if you could help me out, that would be great ;-) Playing with IPv6 first before I continue with this guide so I don't have to go back and redo a ton of stuff.

Note: OpenMosix is no longer developed so imo this guide is obsolete

Contents

Introduction

Basically, this HOWTO is about setting up Mythtv with diskless workstations and using all of the systems to build an OpenMosix cluster using the 2.6 kernel. I am winging this article right now and will try to finish it asap, but it will probably take me a lot of time, if you can help, please do so. (I imagine I can take advantage of the other howto's on this wiki and just point out some handy tips along the way).

What you need

  1. A running Gentoo Linux System
  2. A TV tuner card such as the HD 3000
  3. Get your system running MythTV by following this HARDWARE Setup MythTV
  4. Knowledge
  5. Time
  6. This article
  7. Lots of caffeine and patience

Getting Diskless workstations going

We need to do some -special- stuff to get everything working properly, so for the most part this will just be gentoo's official documentation, but slightly modified.

Create Directories

  1. mkdir /diskless
  2. mkdir /diskless/192.168.1.51

We are going to have diskless nodes from 192.168.1.50-192.168.1.100 in this example. For each node we will need a new directory in /diskless and personally I like to just use the IP address to help simplify things.

Configure the masters kernel

Just use the master config like the gentoo handbook here.

DHCP and TFTP setup

First "emerge -av dhcp tftp-hpa" then edit /etc/dhcp/dhcpd.conf

File: /etc/dhcp/dhcpd.conf
# DHCP configuration file for DHCP ISC 3.0

ddns-update-style none;

# Definition of PXE-specific options
# Code 1: Multicast IP address of boot file server
# Code 2: UDP port that client should monitor for MTFTP responses
# Code 3: UDP port that MTFTP servers are using to listen for MTFTP requests
# Code 4: Number of seconds a client must listen for activity before trying
#         to start a new MTFTP transfer
# Code 5: Number of seconds a client must listen before trying to restart
#         a MTFTP transfer

option space PXE;
option PXE.mtftp-ip               code 1 = ip-address;
option PXE.mtftp-cport            code 2 = unsigned integer 16;
option PXE.mtftp-sport            code 3 = unsigned integer 16;
option PXE.mtftp-tmout            code 4 = unsigned integer 8;
option PXE.mtftp-delay            code 5 = unsigned integer 8;
option PXE.discovery-control      code 6 = unsigned integer 8;
option PXE.discovery-mcast-addr   code 7 = ip-address;

option domain-name "network";
option domain-name-servers 68.87.66.196, 68.87.64.196;
default-lease-time 600;
max-lease-time 7200;
authoritative;

subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
  class "pxeclients" {
    match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
    option vendor-class-identifier "PXEClient";
    vendor-option-space PXE;

    # At least one of the vendor-specific PXE options must be set in
    # order for the client boot ROMs to realize that we are a PXE-compliant
    # server.  We set the MCAST IP address to 0.0.0.0 to tell the boot ROM
    # that we can't provide multicast TFTP (address 0.0.0.0 means no
    # address).

    option PXE.mtftp-ip 0.0.0.0;
    # This is the name of the file the boot ROMs should download.
    filename "pxelinux.0";
    # This is the name of the server they should get it from.
    # Use the master's IP
    next-server 192.168.1.8;
  }

  # If you are using etherboot with a non specific image
  class "etherboot" {
        if substring (option vendor-class-identifier, 0, 9) = "Etherboot" {
        filename "/diskless/vmlinuz";
        }
  }

  pool {
    max-lease-time 86400;
    default-lease-time 86400;
    range 192.168.1.50 192.168.1.80;
    # This prevents unlisted machines from getting an IP
    # deny unknown clients;
    allow unknown clients;
    #option routers 192.168.1.1;
    #option domain-name-servers 68.87.66.196, 68.87.64.196;
  }

  host slave51 {
       # Use your slave's MAC address
       hardware ethernet                00:00:E8:89:15:60;
       # Give your slave a static IP
       fixed-address                    192.168.1.51;
       server-name                      "tom";
       # Use your gateway IP, if required
       option routers                   192.168.1.1;
       # Use your DNS IP, if required
       option domain-name-servers       68.87.66.196, 68.87.64.196;
       option domain-name               "network";
       # Use your slave hostname
       option host-name                 "slave51";

    
       # Etherboot and pxe boot with a mac specific image
       option root-path                 "/diskless/192.168.1.51";

       if substring (option vendor-class-identifier, 0, 9) = "Etherboot" {
                        filename "/vmlinuz";
        } else if substring (option vendor-class-identifier, 0,9) ="PXEClient" {
                        filename "/pxelinux.0";
        }
   
  }
}

As you can see our masters IP in this example is 192.168.1.8

Now, I have an amd athlon xp for the master and I have an intel celeron for a slave (right now I only have one slave) and all the programs on the master will not really work on the slave because the programs are built for different architectures. I am just doing what applied in my situation, if someone wants to do this where all the systems are the same architecture, please do so. (I gotta get this section setup for IPv6).

Reboot with CD

Reboot the server on a Gentoo LiveCD and install just like the gentoo install howto but with the following difference: When you have to mount the file system, do the following (where md1 is the partition where you created the /diskless directory: I have a raid so md1 is where it is, if you have a raid don't forget to do a 'modprobe md' you will also have to recreate your /etc/raidtab file and "cd /dev ; MAKEDEV md" and then start the raid devices with raidstart /dev/md* where * is the raid device you want started) : I know this is a little tricky and if someone wants to clarify this please do so.

# mount /dev/md1 /mnt/gentoo (remember, if ext3 do mount -t ext3 /dev/md1 /mnt/gentoo)

Do not do anything else...

Stage tarballs and chroot

WARNING ! Be very careful where you extract your stage tarball ...

I used a stage3 tarball ... as I wanted to have it running quick :

# cd /mnt/gentoo/diskless/192.168.1.51/
# tar -xvjpf  /mnt/cdrom/stages/stage3-*.tar.bz2 (where * is whatever architecture you want for me that was i686 for the celeron slave.)

now grab the latest portage snapshot like in the handbook, then do a quick

  1. tar -xvjf portage-la* -C usr
  2. mount -t proc /proc /mnt/gentoo/diskless/192.168.1.51/proc
# cp /etc/resolv.conf /mnt/gentoo/diskless/192.168.1.51/etc/resolv.conf 
# chroot /mnt/gentoo/diskless/192.168.1.51/ /bin/bash 
# env-update 
# source /etc/profile

my cd was scratched to hell since I have not used it in such a long time, so I had to use a stage from the net, just use gentoo's install guide and you should be good. Now follow the usual steps ... until the kernel configuration and be sure not to forget to set the root password, I did and had to go back into the install and wasted time.. grr.

Kernel configuration

Use the settings for the slave and master from here the gentoo handbook Don't forget your network card device support.

Setup NFS

File: /etc/exports
# one line like this for each slave
/diskless/192.168.1.51   192.168.1.51(sync,rw,no_root_squash,no_all_squash)

The first field indicates the directory to be exported and the next field indicates to who and how. This field can be divided in two parts: who should be allowed to mount that particular directory, and what the mounting client can do to the filesystem: ro for read only, rw for read/write; no_root_squash and no_all_squash are important for diskless clients that are writing to the disk, so that they don't get "squashed" when making I/O requests. Each slave should have it's own fstab like this.

File: /diskless/192.168.1.51/etc/fstab
192.168.1.8:/diskless/192.168.1.51   /         nfs     sync,hard,intr,rw,nolock,rsize=8192,wsize=8192    0 0
tmpfs                   /dev/shm        tmpfs           defaults                0 0
proc                    /proc           proc            defaults                0 0
/dev/cdroms/cdrom0      /mnt/cdrom      auto            noauto,user             0 0

the last file you need to edit is

File: /diskless/192.168.1.51/etc/conf.d/nfs
# Config file for /etc/init.d/nfs

# Number of servers to be started up by default, change to number of diskless clients you have
RPCNFSDCOUNT=8

# Options to pass to rpc.mountd
RPCMOUNTDOPTS=""

Getting OpenMosix working

Right now OpenMosix 2.6 was released on April 14, 2005 and openmosix-sources-2.6.11.564 is out as a hard masked ebuild, but the userland tools are still missing, so I think I will just wait a little bit for that before I really get into this document. I think they are in CVS though, only a matter of time. I also quote a member of one of my local lugs "I am also going to be working on a CoLinux version with the openmosix patched kernel, so windows users can partake in all the fun!". So that should be great since then the CPU power of windows boxes can also be harnessed.

Retrieved from "http://www.gentoo-wiki.info/HOWTO_Install_Mythtv_With_Diskless_Workstations_in_an_OpenMosix_Cluster"

Last modified: Fri, 05 Sep 2008 21:10:00 +0000 Hits: 13,932