Load balancing with Debian i386 Wheezy LTSP. One root server and three 
application servers.

If you do not have dhcp-server somewhere in your LAN - choose LTSP.

When you have very old thin clients [1], you need 486 kernel. Only 
Debian have package for that [2].


1. LTSP

Use Debian Wheezy AMD64 LXDE [3] for root server and Debian Wheezy i386 
LXDE [4] for three application servers.

Here are servers in this setup:

192.168.0.105   debian-ltsp
192.168.0.106   debian-app-01
192.168.0.107   debian-app-02
192.168.0.108   debian-app-03


A. Install LTSP in root server.

# apt-get install ltsp-server-standalone

# ltsp-build-client --arch i386

# nano /etc/dhcp/dhcpd.conf
# include "/etc/ltsp/dhcpd.conf";

# nano /etc/ltsp/dhcpd.conf
# Default LTSP dhcpd.conf config file.
#

authoritative;

subnet 192.168.0.0 netmask 255.255.255.0 {
     range 192.168.0.200 192.168.0.215;
     option domain-name "debian-ltsp";
     option domain-name-servers 192.168.0.1;
     option broadcast-address 192.168.0.255;
     option routers 192.168.0.1;
     next-server 192.168.0.105;
#    get-lease-hostnames true;
     option subnet-mask 255.255.255.0;
     option root-path "/opt/ltsp/i386";
     if substring( option vendor-class-identifier, 0, 9 ) = "PXEClient" {
         filename "/ltsp/i386/pxelinux.0";
     } else {
         filename "/ltsp/i386/nbi.img";
     }
}

# service isc-dhcp-server restart

# root@debian-ltsp:~# ltsp-info

server information:
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 7.6 (wheezy)
Release:        7.6
Codename:       wheezy

server packages:
ii ldm-server 2:2.2.11-2
un ltsp-client <none>
un ltsp-client-core <none>
ii ltsp-docs 1.1-1
ii ltsp-server 5.4.2-6+deb7u1
ii ltsp-server-standalone 5.4.2-6+deb7u1
un ltsp-utils <none>
ii ltspfs 1.1-2

packages in chroot: /opt/ltsp/i386
ii ldm 2:2.2.11-2
ii ldm-themes 12.07.1
ii ltsp-client 5.4.2-6+deb7u1
ii ltsp-client-core 5.4.2-6+deb7u1
ii ltspfsd 1.1-2
ii ltspfsd-core 1.1-2

found: /opt/ltsp/i386/etc/lts.conf

# root@debian-ltsp:~# uname -a
Linux debian-ltsp 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 
GNU/Linux

# root@debian-ltsp:~# ltsp-chroot -a i386

# root@debian-ltsp:/# dpkg -l | grep linux-image-486
ii linux-image-486 3.2+46 i386 Linux for older PCs (meta-package)


B. Install LDM-server in application servers.

# apt-get install ldm-server


C. Modify root server for load balancing.

1.

# touch /opt/ltsp/i386/usr/share/ltsp/get_hosts

# nano /opt/ltsp/i386/usr/share/ltsp/get_hosts

#!/bin/bash
# Prioritize the server list contained in MY_SERVER_LIST parameter based 
on server rating
TMP_LIST=""
SHUFFLED_LIST=""
if [ -z "$MY_SERVER_LIST" ]; then
         SHUFFLED_LIST=$SERVER
else
         for i in $MY_SERVER_LIST; do
             rank=$(netcat $i 9571 | grep rating | cut -d: -f2)
                 if [ -n "$rank" ]; then
                         TMP_LIST="$TMP_LIST\n${rank}_$i"
                 fi
         done

         TMP_LIST=$(echo -e $TMP_LIST | sort -r)
         for i in $TMP_LIST; do
             SHUFFLED_LIST="$SHUFFLED_LIST $(echo $i | cut -d_ -f2)"
         done
fi
echo $SHUFFLED_LIST

# chmod 755 /opt/ltsp/i386/usr/share/ltsp/get_hosts

2.

# nano /opt/ltsp/i386/etc/lts.conf

[Default]
LDM_DIRECTX=True
[--]
MY_SERVER_LIST="192.168.0.106 192.168.0.107 192.168.0.108"

3.

# touch /etc/ltsp/ssh_known_hosts.auto

# ltsp-update-sshkeys 192.168.0.106 debian-app-01 192.168.0.107 
debian-app-02 192.168.0.108 debian-app-03

# ltsp-update-sshkeys


D. Users

Be sure that every application servers are able to accept users 
(rsync/unison passwd, group, shadow or OpenLDAP). Share /home with NFS.

# root@debian-ltsp-pnp:~# cat /etc/exports
# /home 192.168.0.106(rw,no_root_squash,no_subtree_check) 
192.168.0.107(rw,no_root_squash,no_subtree_check) 
192.168.0.108(rw,no_root_squash,no_subtree_check)

# root@debian-app-01:~# cat /etc/fstab
# 192.168.0.105:/home /home nfs hard,intr,rsize=8192,wsize=8192,bg 0 0


E. Verify that users are able to log in. Here is three thin clients, 
three users, three application servers, load balancing is working.

root@debian-app-01:~# ps ax | grep ltsp
  3214 ?        Ss     0:00 sshd: ltsp003 [priv]
  3219 ?        S      0:00 sshd: ltsp003@pts/1
  3235 ?        Ss     0:00 bash -c  LTSP_CLIENT=192.168.0.201 
LTSP_CLIENT_HOSTNAME=ltsp201 LTSP_CLIENT_MAC=08:00:27:2C:BE:71 
LIBGL_ALWAYS_INDIRECT=true LC_ALL=fi_FI.UTF-8 LANGUAGE=fi_FI.UTF-8 
LANG=fi_FI.UTF-8 DISPLAY=192.168.0.201:7  
PULSE_SERVER=tcp:192.168.0.201:4713 ESPEAKER=192.168.0.201:16001 
LTSP_ALSA_DEFAULT=pulse /etc/X11/Xsession "default" < /dev/null > 
/dev/null ; /usr/sbin/ltspfsmounter all cleanup
  3308 ?        S      0:00 openbox --config-file 
/home/ltsp003/.config/openbox/lxde-rc.xml
  3355 pts/0    S+     0:00 grep ltsp
root@debian-app-01:~#

root@debian-app-02:~# ps ax | grep ltsp
  3191 ?        Ss     0:00 sshd: ltsp001 [priv]
  3196 ?        S      0:00 sshd: ltsp001@pts/1
  3212 ?        Ss     0:00 bash -c  LTSP_CLIENT=192.168.0.203 
LTSP_CLIENT_HOSTNAME=ltsp203 LTSP_CLIENT_MAC=08:00:27:CC:7A:AB 
LIBGL_ALWAYS_INDIRECT=true LC_ALL=fi_FI.UTF-8 LANGUAGE=fi_FI.UTF-8 
LANG=fi_FI.UTF-8 DISPLAY=192.168.0.203:7  
PULSE_SERVER=tcp:192.168.0.203:4713 ESPEAKER=192.168.0.203:16001 
LTSP_ALSA_DEFAULT=pulse /etc/X11/Xsession "default" < /dev/null > 
/dev/null ; /usr/sbin/ltspfsmounter all cleanup
  3293 ?        S      0:00 openbox --config-file 
/home/ltsp001/.config/openbox/lxde-rc.xml
  3378 pts/0    S+     0:00 grep ltsp
root@debian-app-02:~#

root@debian-app-03:~# ps ax | grep ltsp
  3402 ?        Ss     0:00 sshd: ltsp002 [priv]
  3407 ?        S      0:00 sshd: ltsp002@pts/2
  3422 ?        Ss     0:00 bash -c  LTSP_CLIENT=192.168.0.205 
LTSP_CLIENT_HOSTNAME=ltsp205 LTSP_CLIENT_MAC=08:00:27:D5:2E:14 
LIBGL_ALWAYS_INDIRECT=true LC_ALL=fi_FI.UTF-8 LANGUAGE=fi_FI.UTF-8 
LANG=fi_FI.UTF-8 DISPLAY=192.168.0.205:7  
PULSE_SERVER=tcp:192.168.0.205:4713 ESPEAKER=192.168.0.205:16001 
LTSP_ALSA_DEFAULT=pulse /etc/X11/Xsession "default" < /dev/null > 
/dev/null ; /usr/sbin/ltspfsmounter all cleanup
  3503 ?        S      0:00 openbox --config-file 
/home/ltsp002/.config/openbox/lxde-rc.xml
  3605 pts/0    S+     0:00 grep ltsp

[1] 
http://h10010.www1.hp.com/wwpc/pscmisc/vac/us/product_pdfs/t5135_Data_Sheet_02-26-07.pdf
[2] https://packages.debian.org/wheezy/linux-image-3.2.0-4-486
[3] 
http://cdimage.debian.org/debian-cd/7.6.0/AMD64/iso-cd/debian-7.6.0-AMD64-lxde-CD-1.iso
[4] 
http://cdimage.debian.org/debian-cd/7.6.0/i386/iso-cd/debian-7.6.0-i386-lxde-CD-1.iso


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.freenode.net

Reply via email to