Presentation is loading. Please wait.

Presentation is loading. Please wait.

Scientific Linux Network Installation Pete Gronbech: April 2005 RAL.

Similar presentations


Presentation on theme: "Scientific Linux Network Installation Pete Gronbech: April 2005 RAL."— Presentation transcript:

1 Scientific Linux Network Installation Pete Gronbech: April 2005 RAL

2 dhcpd.conf # /etc/dhcpd.conf.ngexample - a DHCP daemon configuration file example # for dhcpd 2.0 # distribute an IP address only if the nodes is known deny unknown-clients; # the server will not reply to the unknown clients; in this way # it is possible to have a second DHCP server not authoritative; option domain-name "physics.ox.ac.uk"; # These 3 lines are needed for the installation via PXE option dhcp-class-identifier "PXEClient"; option vendor-encapsulated-options 01:04:00:00:00:00:ff; filename "pxelinux.0"; subnet netmask { option routers ; option domain-name-servers ; host t2slwn01 { hardware ethernet 00:30:48:72:F3:61; fixed-address ; next-server ; }

3 /tftpboot/pxelinux.cfg pxelinux.cfg]# ls –la /tftpboot/pxelinux.cfg lrwxrwxrwx 1 root root 31 Feb 15 12:47 A30105EC -> hosts/t2slwn01.physics.ox.ac.uk lrwxrwxrwx 1 root root 11 Dec 8 17:09 A30105ECold -> sl-kick.cfg lrwxrwxrwx 1 root root 31 Feb 15 12:47 A30105ED -> hosts/t2slwn02.physics.ox.ac.uk lrwxrwxrwx 1 root root 11 Dec 10 14:41 A30105EDold -> sl-kick.cfg lrwxrwxrwx 1 root root 31 Feb 15 13:43 A30105EE -> hosts/t2slwn03.physics.ox.ac.uk -rwxr-xr-x 1 root root 414 Feb 15 12:45 ack.cgi -rw-r--r-- 1 apache apache 631 Jul boot-hd.cfg -rwxr-xr-x 1 root root 1140 Feb 15 12:47 create-hash-links.pl lrwxrwxrwx 1 apache apache 11 May default -> boot-hd.cfg drwxr-xr-x 2 apache apache 4096 Feb 21 15:59 hosts -rw-r--r-- 1 apache apache 194 Oct lcfg-install-62.cfg -rw-r--r-- 1 apache apache 238 May lcfg-install cfg -rw-r--r-- 1 apache apache 218 May lcfg-install-73.cfg -rw-r--r-- 1 apache apache 209 Oct lcfg-install-nointeract-62.cfg -rw-r--r-- 1 apache apache 253 May lcfg-install-nointeract cfg -rw-r--r-- 1 apache apache 233 May lcfg-install-nointeract-73.cfg -rw-r--r-- 1 root root 277 May lcfg-install-nointeract-bigkernel-73.cfg -rw-r--r-- 1 root root 279 May lcfg-install-nointeract-custom-73.cfg -rwxr-xr-x 1 root root 182 Feb 15 12:45 Makefile drwxr-xr-x 2 root root 4096 Feb 15 12:52 oldlinks -rw-r--r-- 1 root root 758 Dec 9 17:00 sl-kick.cfg -rwxr-xr-x 1 root root 1063 Feb 15 12:45 swing

4 boot_hd.cfg pxelinux.cfg]# cat boot-hd.cfg default local # This is the default pxelinux cfg file # It by default drops onto the harddisk but otherwise # various rescure and diagnostic utilities can be used. default local prompt 1 # timeout after 6 seconds. (1/10s of seconds) timeout 60 # Pop up a small menu, this should be changed to correspond to # the options below. display messages/boot-hd.msg label local localboot 0 label memtest+ kernel memdisk append initrd=diagnostics/memtestp-1.15.img label cpuburn kernel memdisk append initrd=diagnostics/cpuburn-1.00.img label nuke kernel memdisk append initrd=diagnostics/book-and-nuke.img

5 sl-kick.cfg pxelinux.cfg]# cat sl-kick.cfg # This is the default pxelinux cfg file # It by default drops onto the harddisk but otherwise # various rescure and diagnostic utilities can be used. default kickstart prompt 1 # timeout after 6 seconds. (1/10s of seconds) timeout 60 # Pop up a small menu, this should be changed to correspond to # the options below. #display messages/boot-hd.msg label kickstart kernel SL/vmlinuz append initrd=SL/initrd.img keymap=uk devfs=nomount ramdisk_size=16384 ksdevice=link ks=nfs: :/opt/local/linux/SL303/ks/

6 hosts subdir link script pxelinux.cfg]# cat Makefile # Make file to update all the hash to hostname links. # This should be run after the the dhcpd file is updated # or the DNS is changed. all: /usr/local/sbin/create-hash-links.pl pxelinux.cfg]# cat /usr/local/sbin/create-hash-links.pl #!/usr/bin/perl -w use strict ; use Socket ; my $dhcpd = " /etc/dhcpd.conf" ; my $tftp = "/tftpboot/pxelinux.cfg" ; ; open (DHCP,"<$dhcpd") or die "Could not open $dhcpd: $!\n" ; print "Collecting a list of ip address from $dhcpd\n" ; while ( ) { if ( /\s*[^#]\s*fixed-address\s+(\S+)\s*;/ ) { my $fixed = $1 ; # Check if it is a host name and if so we must convert it to # ip address. if ( $fixed =~ m/^.*ox\.ac\.uk$/ ) { print "Converting hostname $fixed to ip address: " ; $fixed = inet_ntoa(inet_aton($fixed) ) or die "fixed= $fixed\n" ; print "$fixed\n" ; } ; } # Now set up the symlinks IF they are not already there. foreach my $ip ) { my $hexip = sprintf("%02X%02X%02X%02X",split('\.',$ip)) ; my $hostname = gethostbyaddr(inet_aton($ip), AF_INET) or die "No reverse look up for $ip\n" ; # Create a symlink from the hostname to default config. symlink('../boot- hd.cfg',$tftp.'/hosts/'.$hostname) unless ( -l $tftp.'/hosts/'.$hostname ) ; symlink('hosts/'.$hostname,$tftp.'/'.$hexip) ; } close (DHCP) ;

7 kickstart directory pxelinux.cfg]# cd /opt/local/linux/SL303/ SL303]# ls -la total 20 drwxr-xr-x 5 root root 4096 Dec 9 17:02. drwxr-xr-x 5 root root 4096 Nov 26 16:14.. drwxr-xr-x 3 root root 4096 Oct 1 00:14 images drwxr-xr-x 2 root root 4096 Feb 15 15:02 ks drwxr-xr-x 5 root root 4096 Oct 1 00:14 SL SL303]# cd ks ks]# ls -la total 16 drwxr-xr-x 2 root root 4096 Feb 15 15:02. drwxr-xr-x 5 root root 4096 Dec 9 17:02.. lrwxrwxrwx 1 root root 15 Dec 9 12: kickstart -> anaconda-ks.cfg lrwxrwxrwx 1 root root 15 Dec 10 14: kickstart -> anaconda-ks.cfg lrwxrwxrwx 1 root root 15 Dec 10 14: kickstart -> anaconda-ks.cfg lrwxrwxrwx 1 root root 14 Feb 14 16: kickstart -> SL-Clar-ks.cfg -rw-r--r-- 1 root root 1551 Feb 15 15:01 anaconda-ks.cfg -rw-r--r-- 1 root root 1567 Feb 15 14:10 SL-Clar-ks.cfg

8 kickstart file 1 ks]# cat anaconda-ks.cfg # Kickstart file automatically generated by anaconda. #network --device eth1 --bootproto dhcp reboot install lang en_US.UTF-8 langsupport --default en_US.UTF-8 en_US.UTF-8 keyboard uk mouse genericwheelps/2 --device psaux xconfig --card "ATI Mach64" --videoram hsync vsync resolution 1280x depth 24 --startxonboot --defaultdesktop gnome network --bootproto dhcp nfs --server dir /opt/local/linux/SL303/ rootpw --iscrypted encryptedpasswdhere firewall --disabled authconfig --enableshadow --enablemd5 timezone Europe/London bootloader --location=mbr

9 Kickstart file 2 # The following is the partition information you requested # Note that any partitions you deleted are not expressed # here so unless you clear all partitions first, this is # not guaranteed to work zerombr yes clearpart --all part / --fstype "ext3" --size=6000 part /usr --fstype "ext3" --size=6000 part swap --size=2000 part /home --fstype "ext3" --size=100 --grow graphical-internet kernel kernel-module-openafs ELsmp kernel-smp pine grub gv %post # Change link on server to boot from hard disk wget -q t2lcfg.physics.ox.ac.uk/cgi-bin/ack.cgi more later….

10 ack.cgi ks]# more /var/www/cgi-bin/ack.cgi #!/usr/bin/perl use Socket ; # Configuration file to boot from HD $boothd = "../boot-hd.cfg"; print "Content-type: text/plain\n\n"; $point_address = $ENV{'REMOTE_ADDR'}; $hostname = gethostbyaddr(inet_aton($point_address), AF_INET) ; system ("cd /tftpboot/pxelinux.cfg/hosts ; ln -fs $boothd /tftpboot/pxelinux.cfg/hosts/$hostname"); print "$hostname is now configured to boot from $boothd\n";

11 Post Installation We want to perform updates and local customisations yum update has to be done after the first reboot so set up a one time /etc/rc.local which calls configuration modules then returns the original rc.local and reboots. yaim can be installed here and LCG software installed and configured SL can also be mirrored to speed up installations

12 Post Installation ### Write motd echo "Kickstart-installed Scientific Linux release 3 (FNAL SL 303) `/bin/date`" > /etc/motd # Create a post install init script to run once # Mount the kickstart directory from the server. mkdir /tmp/kick mount -o nolock,nfsvers=2 t2lcfg.physics.ox.ac.uk:/opt/local/linux/SL303 /tmp/kick mkdir /root/install-scripts cp /tmp/kick/modules/* /root/install-scripts umount /tmp/kick rmdir /tmp/kick

13 Post Installation cp /etc/rc.d/rc.local /etc/rc.d/rc.local.orig # Create a script to run at first reboot. cat /etc/rc.d/rc.local #!/bin/sh # One time script to run in two minutes /usr/bin/at "now + 1 minutes" & /dev/null MODULES="slyum yum-4-lcg java yaim ntpd local-admins root-admins nokudzu " # MODULES="slyum yaim yum-4-lcg lcg-install-wn lcg-setup-wn" # MODULES="denyAll syslog slyum network180 yumit ntpd sshd-ral root-admins" # MODULES="\\\$MODULES sendmail heartbeat local-admins gmond-lcg-others" # MODULES="\\\$MODULES nrpe yaim yum-4-lcg lcg-install-bdii lcg-setup-bdii" for M in \\\$MODULES do /bin/sh -x /root/install-scripts/\\\$M.sh >& /root/install-scripts/\\\$M.log done mv /etc/rc.d/rc.local /etc/rc.d/rc.local.onetime mv /etc/rc.d/rc.local.orig /etc/rc.d/rc.local /sbin/shutdown -r now EOFat touch /var/lock/subsys/local EOFrc

14 Configuration Modules slyum.sh #!/bin/sh # yumsl consider yum for SL and update it. cd /etc rm -f yum.conf wget /sbin/chkconfig yum off yum -d 1 -y update echo "Oxford PP Scientific Linux 3 standard yum update installed `date`" >> /etc/motd

15 Configuration Modules yum-4-lcg.sh #!/bin/sh # Set up the yum repostories for LCG. cat >/etc/yum.conf [oxfordserver] name=Oxford java baseurl=http://t2lcfg.physics.ox.ac.uk/yum/java/ [sl-lcg] name=LCG packages baseurl=http://t2lcfg.physics.ox.ac.uk/yum/lcg/2_4_0/sl3/ [sl-lcg-ca] name=LCG CA packages baseurl=http://t2lcfg.physics.ox.ac.uk/yum/lcg/ca/ EOF

16 Configuration Modules java.sh #!/bin/sh yum -y -d 0 -t install j2sdk

17 Configuration Modules root-admins.sh #!/bin/sh # We want to allow admins to login mkdir -p /root/.ssh chmod go-rwx,u+rwx /root/.ssh cat /root/.ssh/authorized_keys ssh-dss //gAAAIB8jRBMgcTjU………………………………………qDjt5rmnGLKcSjLwN XCDqSNbKTqOAEWJO2SVp4r7emo3QGBiiiSL9AuBnIscNbLI0oitAFZlFs 0fmZSlYu1AiJk/f2MShNA7PTNlbqLUeF4BkUTpO/GFjiTe/FEIlF3IaArj YGfhrBCS14uhhULtcyrHt3KX2qwMw== EOF

18 lcg installation lcg-install-wn #!/bin/sh # Install the packages for a UI node. # We should just install the lcg-WN package # I just install the packages that it requires. yum -t -d 0 -y install lcg-WN-torque yum -t -d 0 -y install lcg-CA

19 lcg installation lcg-setup-wn.sh #!/bin/sh # Do the buisness. /opt/lcg/yaim/scripts/configure_WN_torque /root/yaim-conf/site-info.def

20 GOC Wiki ministrationFaqhttp://goc.grid.sinica.edu.tw/gocwiki/Ad ministrationFaq –Using yum to install LCG –Mirror LCG Packages –Preserving host keys when using Kickstart

21 Credits This installation method is heavily based on work carried out at RAL by Chris Brew and Steve Traylen.


Download ppt "Scientific Linux Network Installation Pete Gronbech: April 2005 RAL."

Similar presentations


Ads by Google