Colocando Nós antigos na Spgrid

Na SPRace

  • Precisamos do dhcp funcionando e configurado. O
    /etc/dhcpd.conf
    está com o MAC ADDRESS do cliente
ddns-update-style none;
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;
class "pxeclients" {
  match if substring (option vendor-class-identifier, 0, 9) =
         "PXEClient";
  option PXE.mtftp-ip 0.0.0.0;
}

subnet 200.136.80.0 netmask 255.255.255.0
   {
   }
subnet 192.168.1.0 netmask 255.255.255.0 {
  deny unknown-clients;
  min-lease-time 300;
  default-lease-time 1800;
  max-lease-time 1800;
  use-host-decl-names on;
  option subnet-mask 255.255.255.0;
  option routers 192.168.1.200;
host node24
{
        hardware ethernet 00:30:48:53:EA:91;
        fixed-address node24;
        filename "/tftpboot/pxelinux.0";
}
        }
Agora iniciamos o dhcpd
[root@sprace:mdias]# /etc/init.d/dhcpd start
Starting dhcpd:                                            [  OK  ]
  • O NFS da sprace tem que estar ok, pois vamos exportar o diretório que contém os arquivos de configuração do kickstart (que é por sua vez
definido pelo /tftpboot/pxelinux.cfg/default) como veremos mais para frente.
[root@sprace:mdias]# cat /etc/exports
/export 192.168.1.0/24(rw,no_root_squash)
[root@sprace:mdias]# /etc/init.d/nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
[root@sprace:mdias]# service nfs status
rpc.mountd (pid 32435) is running...
nfsd (pid 32428 32427 32426 32425 32424 32423 32422 32421) is running...
rpc.rquotad (pid 32416) is running...
[root@sprace:mdias]# showmount -e
Export list for sprace.if.usp.br:
/export                 192.168.1.0/24
  • O tftpboot deve estar habilitado, usando a opção
    disable=no
    no arquivo de configuração do xinetd:
[root@sprace:mdias]# cat /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
service tftp
{
        disable                 = no
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = /tftpboot
        per_source              = 11
        cps                     = 100 2
}
[root@sprace:mdias]# cat /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
service tftp
{
        disable                 = no
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = /tftpboot
        per_source              = 11
        cps                     = 100 2
}
[root@sprace:mdias]# ls -la /tftpboot/pxelinux.cfg/
total 16
   4 drwxr-xr-x    2 root     root         4096 Aug  8  2003 ./
   4 drwxr-xr-x    4 root     root         4096 Jul 15  2003 ../
   4 -rw-r--r--    1 root     root          380 Nov  7 16:11 default
   4 -rw-r--r--    1 root     root          520 Nov  7 16:11 message.txt
[root@sprace:mdias]# cat /tftpboot/pxelinux.cfg/default
#SERIAL 1 19200

# Mensagem a ser apresentada
DISPLAY pxelinux.cfg/message.txt

# timeout de espera
TIMEOUT 100

# Sempre mostrar o prompt
PROMPT  1

# Default e' realizar o boot normal
DEFAULT boot

LABEL boot
    LOCALBOOT 0

LABEL linux
    kernel vmlinuz
    append ks=nfs:192.168.1.200:/export/tools/kickstart/linux.cfg
initrd=initrd.img devfs=nomount ksdevice=eth0
#console=ttyS1,19200
[root@sprace:mdias]# cat /tftpboot/pxelinux.cfg/message.txt
 Mensagem a ser apresentada no momento de boot

47                                              07
47               ITAUTEC CLUSTER                07
47               0741Boot Management0747                07
47                                              07
47   Press:                                     07
47      0741boot     0747 for normal boot               07
47      0741linux    0747 to install a new node         07
47                                              07

[root@sprace:mdias]# /etc/init.d/xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]

Observe que a linha
append
ks=nfs:192.168.1.200:/export/tools/kickstart/linux.cfg 
define onde fica o arquivo de configuração do kickstart ( no caso o linux.cfg). A opção ksdevice resolve o problema de termos duas interfaces de rede, o que faria ele interpelar por qual seria feita a importação dos arquivos de instalação.
  • Como o resto da instalação vai ser via nfs, exportado pela SPRAID, devemos ter o diretório
    /raid0/SL_308_i386/
    (isso é definido dentro do linux.cfg)
[root@spraid root]# showmount -e
Export list for spraid.if.usp.br:
/raid1 192.168.1.0/24
/raid0 192.168.1.0/24
[root@spraid mdias]# ls /raid0/SL_308_i386/
apt-rpm   errata    misc                RHupdates     SL
contrib   images    README              RPM-GPG-KEYs  SL.documentation
dosutils  isolinux  RELEASE-NOTES.html  sites         SL.releasenote
  • O arquivo de configuração do kickstart,
    /export/tools/kickstart/linux.cfg 
    manda a instalação ir para o
    /raid0/SL_308_i386
    , via nfs na Spraid

#kickstart file automatically generated by anaconda.

lang en_US.UTF-8
langsupport --default en_US.UTF-8 en_US.UTF-8 pt_BR.UTF-8
keyboard us-acentos
#mouse
mouse genericwheelps/2 --device psaux
#Reboot apos instalacao
#reboot
#Metodo de instalacao
install
text
#NFS ou CD ou FTP ou HTTP
nfs --server 192.168.1.100 --dir /raid0/SL_308_i386
#Configurando o X
#xconfig --card "ATI Radeon (generic)" --videoram 16384 --hsync 30-70 --vsync
50-160 --resolution 1024x768 --depth 24 --
defaultdesktop gnome
xconfig --resolution 1024x768 --depth 24 --defaultdesktop gnome
network --device eth0 --bootproto dhcp
#network --device eth1 --bootproto dhcp
rootpw --iscrypted $1$96lpAZKJ$RpfvtqR8nP9AHrScGgjQM.
firewall --disabled
authconfig --enableshadow --enablemd5
timezone America/Sao_Paulo
#System bootloader
bootloader --location=mbr
#Partition
zerombr yes
clearpart --all
part /boot --fstype ext3 --size 100 --asprimary
part / --fstype ext3 --size 10240 --asprimary
part swap --size 2048 --asprimary
part /var --fstype ext3 --size 2048
part /tmp --fstype ext3 --size  500
part /scratch --fstype ext3 --size 1 --grow

%packages
@ engineering-and-scientific
@ brazilian-support
@ admin-tools
@ portuguese-support
@ editors
@ system-tools
@ base-x
@ graphics
@ development-tools
@ misc-sl
@ gnome-desktop
@ dialup
@ apt-rpm
@ yum
@ openafs-client
@ server-cfg
pine
-octave
net-snmp-utils
SL_enable_serialconsole
anacron
firefox
-pvm
-units
kernel
grub
pcp
-samba-client
-blas
kernel-module-openafs-2.4.21-47.0.1.ELsmp
-lam
kernel-smp-unsupported
-lapack
kernel-smp

%post --nochroot


echo "Configurando chkconfig"
for f in sshd
{
chroot /mnt/sysimage chkconfig ${f} on
}

for f in cups hpoj pcmcia rhnsd sendmail yum
{
chroot /mnt/sysimage chkconfig --level 23456 ${f} off
}
observe que retiramos a opcao "reboot" , pois se a deixarmos habilitada ele entra em loop, ou seja reboota, entra no boot via pxe, instala o sistema operacional e por aí vai!

Nós

Em cada nó devemos configurar a Bios a aba BOOT-> BOOT DEVICE PRIORITY e colocar a interface de rede ( no caso IBAGE Slot 320v). Isso fará o nó bootar via PXE usando uma das interfaces de rede e pegar via DHCP seu endereço de rede e começar o processo de instalação.

Terminada a instalação devemos plugar de novo o terminal, dar enter (para rebootar o processo de instalação). Nisso, quando rebootar novamente, volte a configurar a BIOS para que o HD seja o primeiro dispositivo no Boot Device Priority.

Por ultimo colocamos em /tftpboot/pxelinux.cfg/default

DEFAULT boot
e substituimos a anterior. Assim caso algum problema no hd ( e nesse caso ele tentaria entrar no boot via rede) ele não tentaria instalar novamente.

Pós Instalação

Bom, com tudo instalado, primeiramente devemos remover as linhas em

/root/.ssh/known_hosts
relativo à estes nós. Feito isso devemos exportar a chave (tudo na mão):
[root@sprace:root]#  ssh node49 'mkdir .ssh; chmod 600 .ssh';scp authorized_keys node49:/root/.ssh/.
usando o
authorized_keys
de um nó qualquer.

O resto ficou por conta de um projeto de script

#!/bin/bash
RACK=3; RANK=0;
for ((i=39; i<55; i++))
 do
scp /home/mdias/ntp.conf 192.168.1.$i:/etc/.;
scp hosts 192.168.1.$i:/etc/hosts;
scp /home/mdias/nsswitch.conf  192.168.1.$i:/etc/.;
scp condor 192.168.1.$i:/etc/init.d/.;
scp   ganglia-monitor-core-gmond-2.5.4-8.i386.rpm 192.168.1.$i:/root/.;
scp gmond_fase2.conf 192.168.1.$i:/etc/gmond.conf;
ssh  192.168.1.$i 'mv /etc/resolv.conf /etc/resolv.conf.old;echo domain grid|cat>>/etc/resolv.conf; echo nameserver 192.168.1.150| cat >>/etc/
resolv.conf; echo nameserver 143.107.128.17| cat>>/etc/resolv.conf; echo nameserver 200.136.80.4| cat >>/etc/resolv.conf;mv /etc/sysconfig/net
work /etc/sysconfig/network.old;UNAME=`uname -n`; echo NETWORKING=yes| cat>>/etc/sysconfig/network; echo HOSTNAME=${UNAME}| cat >>/etc/sysconfig/network; echo GATEWAY=192.168.1.150| cat>>/etc/sysconfig/network; echo NISDOMAIN=grid|cat>>/etc/sysconfig/network;service gpm stop; chkconfig gpm off; chkconfig sendmail on;echoBROADCAST=192.168.1.255|cat>>/etc/sysconfig/network-scripts/ifcfg-eth0;echo IPADDR=192.168.1.'$i'|cat>>/etc/sysconfig/network-scripts/ifcfg-eth0 ;echo
NETMASK=255.255.255.0|cat>>/etc/sysconfig/network-scripts/ifcfg-eth0; echo
NETWORK=192.168.1.0| cat >> /etc/sysconfig/network-scripts/ifcfg-eth0;mv
/etc/sysconfig/network-scripts/ifcfg-eth0/etc/sysconfig/network-scripts/ifcfg-eth0.bak;
cat /etc/sysconfig/network-scripts/ifcfg-eth0.bak| sed -e "/BOOTPROTO=dhcp/d">
/etc/sysconfig/network-scripts/ifcfg-eth0; rm
/etc/sysconfig/network-scripts/ifcfg-eth0.bak;echo storage:/raid0 /raid0 nfs
rw,addr=192.168.1.100 0 0 |cat >>/etc/mtab; echo spg00:/home /home nfs
rw,addr=192.168.1.150 0 0 |cat >>/etc/mtab ; echo spg00:/OSG /OSG nfs
rw,addr=192.168.1.150 0 0 |cat >>/etc/mtab; echo "spg00:/home
/home           nfs     defaults        1 2"|cat >>/etc/fstab;echo "spg00:/OSG
/OSG            nfs     defaults        1 2"| cat>>/etc/fstab;echo
"storage:/raid0          /raid0          nfs     defaults 1 2"|cat
>>/etc/fstab;mkdir /OSG; mkdir /raid0;chkconfig ntpd on; service ntpd
start;echo ypserver 192.168.1.150|cat>>/etc/yp.conf;chkconfig ypbind on;
service ypbind start;mkdir /usr/local/opt;ln -s /OSG /usr/local/opt/OSG;ln -s /raid0/OSG /usr/local/share/OSG;mkdir
/scratch/condor;mkdir /scratch/OSG;chmod a+rw /scratch/OSG; chown condor:con
dor /scratch/condor; mount /OSG; ln -s
/usr/local/opt/OSG/condor/etc/condor_config /scratch/condor/condor_config; cd
/scratch/condor; touch co
ndor_config.local; mkdir execute log spool;chown condor:condor
condor_config.local execute log spool;ln -s /etc/init.d/condor
/etc/rc.d/rc0.d/
K99condor;ln -s /etc/init.d/condor /etc/rc.d/rc1.d/K99condor;ln -s
/etc/init.d/condor /etc/rc.d/rc2.d/S90condor;ln -s /etc/init.d/condor /etc/
rc.d/rc3.d/S90condor;ln -s /etc/init.d/condor /etc/rc.d/rc4.d/S90condor;ln -s
/etc/init.d/condor /etc/rc.d/rc5.d/S90condor;ln -s /etc/init.d/c
ondor /etc/rc.d/rc6.d/K99condor;echo location \"'$RACK','$RANK',0\"| cat >>/etc/gmond.conf;groupadd -g 104 ganglia;useradd -d /var/lib/ganglia
 -s /bin/false -g ganglia -u 107 ganglia ;rpm -ivh /root/ganglia-monitor-core-gmond-2.5.4-8.i386.rpm; rm /root/ganglia-monitor-core-gmond-2.5.
4-8.i386.rpm;reboot'
let "RANK += 1";
done;
Topic revision: r1 - 2006-12-11 - MarcoAndreFerreiraDias
 

This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback

antalya escort bursa escort eskisehir escort istanbul escort izmir escort