Scientific Linux Network Installation Pete Gronbech: April 2005
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Scientific Linux Network Installation Pete Gronbech: April 2005

  • 1,237 views
Uploaded on

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,237
On Slideshare
1,235
From Embeds
2
Number of Embeds
1

Actions

Shares
Downloads
12
Comments
0
Likes
0

Embeds 2

http://www.slideshare.net 2

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

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 163.1.5.0 netmask 255.255.255.0 {
    • option routers 163.1.5.254;
    • option domain-name-servers 163.1.2.1;
    • host t2slwn01 {
    • hardware ethernet 00:30:48:72:F3:61;
    • fixed-address 163.1.5.236;
    • next-server 163.1.5.240;
    • }
  • 3. /tftpboot/pxelinux.cfg
    • [root@t2lcfg 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 21 2004 boot-hd.cfg
    • -rwxr-xr-x 1 root root 1140 Feb 15 12:47 create-hash-links.pl
    • lrwxrwxrwx 1 apache apache 11 May 7 2004 default -> boot-hd.cfg
    • drwxr-xr-x 2 apache apache 4096 Feb 21 15:59 hosts
    • -rw-r--r-- 1 apache apache 194 Oct 24 2003 lcfg-install-62.cfg
    • -rw-r--r-- 1 apache apache 238 May 17 2004 lcfg-install-73-2.4.20.cfg
    • -rw-r--r-- 1 apache apache 218 May 13 2004 lcfg-install-73.cfg
    • -rw-r--r-- 1 apache apache 209 Oct 24 2003 lcfg-install-nointeract-62.cfg
    • -rw-r--r-- 1 apache apache 253 May 17 2004 lcfg-install-nointeract-73-2.4.20.cfg
    • -rw-r--r-- 1 apache apache 233 May 7 2004 lcfg-install-nointeract-73.cfg
    • -rw-r--r-- 1 root root 277 May 13 2004 lcfg-install-nointeract-bigkernel-73.cfg
    • -rw-r--r-- 1 root root 279 May 13 2004 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
    • [root@t2lcfg 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
    • [root@t2lcfg 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:163.1.5.240:/opt/local/linux/SL303/ks/
  • 6. hosts subdir link script
    • [root@t2lcfg 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
    • [root@t2lcfg 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" ;
    • my @ips ;
    • open (DHCP,&quot;<$dhcpd&quot;) or die &quot;Could not open $dhcpd: $! &quot; ;
    • print &quot;Collecting a list of ip address from $dhcpd &quot; ;
    • while ( <DHCP> ) {
    • if ( /s*[^#]s*fixed-addresss+(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 &quot;Converting hostname $fixed to ip address: &quot; ;
    • $fixed = inet_ntoa(inet_aton($fixed) ) or die &quot;fixed= $fixed &quot; ;
    • print &quot;$fixed &quot; ;
    • }
    • push(@ips,$fixed) ;
    • }
    • }
    # Now set up the symlinks IF they are not already there. foreach my $ip ( @ips ) { my $hexip = sprintf(&quot;%02X%02X%02X%02X&quot;,split('.',$ip)) ; my $hostname = gethostbyaddr(inet_aton($ip), AF_INET) or die &quot;No reverse look up for $ip &quot; ; # 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
    • [root@t2lcfg pxelinux.cfg]# cd /opt/local/linux/SL303/
    • [root@t2lcfg 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
    • [root@t2lcfg SL303]# cd ks
    • [root@t2lcfg 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:10 163.1.5.236-kickstart -> anaconda-ks.cfg
    • lrwxrwxrwx 1 root root 15 Dec 10 14:40 163.1.5.237-kickstart -> anaconda-ks.cfg
    • lrwxrwxrwx 1 root root 15 Dec 10 14:40 163.1.5.238-kickstart -> anaconda-ks.cfg
    • lrwxrwxrwx 1 root root 14 Feb 14 16:40 163.1.5.93-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 [root@t2lcfg 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 &quot;ATI Mach64&quot; --videoram 8192 --hsync 31.5-67 --vsync 50-75 --resolution 1280x1024 --depth 24 --startxonboot --defaultdesktop gnome network --bootproto dhcp nfs --server 163.1.5.240 --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 &quot;ext3&quot; --size=6000
    • part /usr --fstype &quot;ext3&quot; --size=6000
    • part swap --size=2000
    • part /home --fstype &quot;ext3&quot; --size=100 --grow
    • %packages
    • @ office
    • @ engineering-and-scientific
    • @ editors
    • @ xemacs
    • @ base-x
    • @ graphics
    • @ misc-sl
    • @ text-internet
    • @ kde-desktop
    • @ gnome-desktop
    • @ dialup
    • @ yum
    • @ openafs-client
    • @ authoring-and-publishing
    • @ printing
    • @ sound-and-video
    • @ graphical-internet
    • kernel
    • kernel-module-openafs-2.4.21-20.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
    • [root@t2lcfg ks]# more /var/www/cgi-bin/ack.cgi
    • #!/usr/bin/perl
    • use Socket ;
    • # Configuration file to boot from HD
    • $boothd = &quot;../boot-hd.cfg&quot;;
    • print &quot;Content-type: text/plain &quot;;
    • $point_address = $ENV{'REMOTE_ADDR'};
    • $hostname = gethostbyaddr(inet_aton($point_address), AF_INET) ;
    • system (&quot;cd /tftpboot/pxelinux.cfg/hosts ; ln -fs $boothd /tftpboot/pxelinux.cfg/hosts/$hostname&quot;);
    • print &quot;$hostname is now configured to boot from $boothd &quot;;
  • 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 &quot;Kickstart-installed Scientific Linux release 3 (FNAL SL 303) `/bin/date`&quot; > /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 <<EOFrc>/etc/rc.d/rc.local
    • #!/bin/sh
    • # One time script to run in two minutes
    • /usr/bin/at &quot;now + 1 minutes&quot; <<EOFat >& /dev/null
    • MODULES=&quot;slyum yum-4-lcg java yaim ntpd local-admins root-admins nokudzu &quot;
    • # MODULES=&quot;slyum yaim yum-4-lcg lcg-install-wn lcg-setup-wn&quot;
    • # MODULES=&quot;denyAll syslog slyum network180 yumit ntpd sshd-ral root-admins&quot;
    • # MODULES=&quot;MODULES sendmail heartbeat local-admins gmond-lcg-others&quot;
    • # MODULES=&quot;MODULES nrpe yaim yum-4-lcg lcg-install-bdii lcg-setup-bdii&quot;
    • 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 http://t2lcfg.physics.ox.ac.uk/yum/SL/yum.conf
      • /sbin/chkconfig yum off
      • yum -d 1 -y update
      • echo &quot;Oxford PP Scientific Linux 3 standard yum update installed `date`&quot; >> /etc/motd
  • 15. Configuration Modules
    • yum-4-lcg.sh
      • #!/bin/sh
      • # Set up the yum repostories for LCG.
      • cat <<EOF>>/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 <<EOF>/root/.ssh/authorized_keys
      • ssh-dss //gAAAIB8jRBMgcTjU………………………………………qDjt5rmnGLKcSjLwNXCDqSNbKTqOAEWJO2SVp4r7emo3QGBiiiSL9AuBnIscNbLI0oitAFZlFs0fmZSlYu1AiJk/f2MShNA7PTNlbqLUeF4BkUTpO/GFjiTe/FEIlF3IaArjYGfhrBCS14uhhULtcyrHt3KX2qwMw== gronbech@pplx3
      • 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
    • http://goc.grid.sinica.edu.tw/gocwiki/AdministrationFaq
      • 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.