LCFGng server installation

19
C. Aiftimiei, E. Ferro / January 2003 1 LCFGng server installation LCFGng server installation Cristina Aiftimiei, Enrico Ferro Cristina Aiftimiei, Enrico Ferro INFN-LNL INFN-LNL

description

LCFGng server installation. Cristina Aiftimiei, Enrico Ferro INFN-LNL. Roadmap. Where are documentation & packages LCFGng in 1 slide Differences between LCFG and LCFGng Server installation: Install a RH62 + openssh + 3 additional packages Download the RPM from the EDG repository - PowerPoint PPT Presentation

Transcript of LCFGng server installation

Page 1: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 1

LCFGng server installationLCFGng server installation

Cristina Aiftimiei, Enrico Ferro Cristina Aiftimiei, Enrico Ferro

INFN-LNLINFN-LNL

Page 2: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 2

Where are documentation & packagesWhere are documentation & packages LCFGng in 1 slideLCFGng in 1 slide Differences between LCFG and LCFGngDifferences between LCFG and LCFGng Server installation:Server installation:

Install a RH62 + openssh + 3 additional packagesInstall a RH62 + openssh + 3 additional packages Download the RPM from the EDG repositoryDownload the RPM from the EDG repository Install additional packages automaticallyInstall additional packages automatically Build installroot(s)Build installroot(s) Set up services: DHCP, NFS, Apache, mkxprofdSet up services: DHCP, NFS, Apache, mkxprofd Prepare and build XML profile(s) [see Andrea's slides]Prepare and build XML profile(s) [see Andrea's slides] Install a node via floppyInstall a node via floppy Install a node via PXEInstall a node via PXE

Roadmap

Page 3: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 3

Client nodesLCFGng Server

LCFGng in 1 slide

Notification (UDP)

<XML>

Source files

XML profilesCompiler

(mkxprof)

HTTP server

<XML>Download (HTTP)

ClientDaemon

(rdxprof)

Local cache

ProfileComponent

Components

Page 4: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 4

You can find LCFGng server installation guide in PDF, PS, HTML:You can find LCFGng server installation guide in PDF, PS, HTML: http://datagrid.in2p3.fr/distribution/datagrid/wp4/edg-lcfg/http://datagrid.in2p3.fr/distribution/datagrid/wp4/edg-lcfg/

documentationdocumentation The software packages are available here:The software packages are available here:

http://datagrid.in2p3.fr/distribution/datagrid/wp4/edg-lcfg/packageshttp://datagrid.in2p3.fr/distribution/datagrid/wp4/edg-lcfg/packages Please note that almost all will be downloaded automaticallyPlease note that almost all will be downloaded automatically

Documentation and software packages

Page 5: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 5

These changes are described in detail in:These changes are described in detail in: http://datagrid.in2p3.fr/distribution/datagrid/wp4/edg-lcfg/http://datagrid.in2p3.fr/distribution/datagrid/wp4/edg-lcfg/

documentation/lcfgng-migration.txtdocumentation/lcfgng-migration.txt Support both RedHat 6.2 and Cern Redhat 7.3.1Support both RedHat 6.2 and Cern Redhat 7.3.1 Both XML profiles and source directories changed :-(Both XML profiles and source directories changed :-( .def files are in a different directory (in the past they were with the .def files are in a different directory (in the past they were with the

configuration files)configuration files) Many components (i.e. objects) changed (some splitted, some Many components (i.e. objects) changed (some splitted, some

added, some removed). See the previous link for the details.added, some removed). See the previous link for the details.

LCFG vs LCFGng (1/2)

Page 6: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 6

mkxprof, the XML compilermkxprof, the XML compiler Now it must be run as a daemon:Now it must be run as a daemon:/sbin/service mkxprofd /sbin/service mkxprofd startstart

To rebuild the profiles you must reload the daemon: To rebuild the profiles you must reload the daemon: /sbin/service mkxprofd /sbin/service mkxprofd reloadreload

A web interface is available with A web interface is available with the status of mkxprof:the status of mkxprof:http://<LCFGngServer>/statushttp://<LCFGngServer>/status

To select which nodes should be installed:To select which nodes should be installed:http://<LCFGngServer>/install/install.cgihttp://<LCFGngServer>/install/install.cgi

InstallaInstallation more flexyble:tion more flexyble: Now it is possible to specify additional commands that must be run Now it is possible to specify additional commands that must be run

during the installation customizing the LCFGng configuration filesduring the installation customizing the LCFGng configuration files Added PXE supportAdded PXE support

LCFG vs LCFGng (2/2)

Page 7: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 7

You should install a RedHat Linux 6.2 node that will provide the You should install a RedHat Linux 6.2 node that will provide the following services:following services: NFS: to distribute the software packages and rpm listsNFS: to distribute the software packages and rpm lists DHCP: for the 1st installationDHCP: for the 1st installation HTTP: to distribute the XML profilesHTTP: to distribute the XML profiles

Why RH6.2? To simplify the update of an existing LCFG serverWhy RH6.2? To simplify the update of an existing LCFG server From:From:

http://datagrid.in2p3.fr/distribution/datagrid/wp4/edg-lcfg/packageshttp://datagrid.in2p3.fr/distribution/datagrid/wp4/edg-lcfg/packages

Download and install the latest version of these 3 packages:Download and install the latest version of these 3 packages: edg-populate-serverng, updaterpms-static-server, edg-updaterepedg-populate-serverng, updaterpms-static-server, edg-updaterep

Download and install ssh for RedHat from:Download and install ssh for RedHat from: http://datagrid.in2p3.fr/distribution/external/RPMS/http://datagrid.in2p3.fr/distribution/external/RPMS/

1/9: To start install a RH62

Page 8: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 8

2/9: Download packages via updaterep

To download all the EDG, RedHat and external packages you can To download all the EDG, RedHat and external packages you can use a tool called updaterep (see man updaterep)use a tool called updaterep (see man updaterep)

Due to the frequent changes on RPM repositories :-(, get the Due to the frequent changes on RPM repositories :-(, get the updaterep's configuration file matching your EDG release from:updaterep's configuration file matching your EDG release from: http://datagrid.in2p3.fr/cgi-bin/cvsweb.cgi/edg-release/updaterep/http://datagrid.in2p3.fr/cgi-bin/cvsweb.cgi/edg-release/updaterep/

updaterep will updaterep will Create automatically the required directoryCreate automatically the required directory Download via wget only the packages that are not already present Download via wget only the packages that are not already present Write automatically the hdfiles (Write automatically the hdfiles (package.rpm->.package.rpmpackage.rpm->.package.rpm) )

(they are needed by updaterpms, the packages installer)(they are needed by updaterpms, the packages installer) Write a 'Makefile' in each repository to create the hdfilesWrite a 'Makefile' in each repository to create the hdfiles

With LCFGWith LCFGngng you must use version 2.<latest> version of updaterep you must use version 2.<latest> version of updaterep

Page 9: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 9

3/9: Installation/upgrade of server packages

If you are upgrading an existing LCFGng server you have to remove If you are upgrading an existing LCFGng server you have to remove the old packages with something like:the old packages with something like: rpm -e lcfg-adapt-serverrpm -e lcfg-adapt-server rpm -e `rpm -qa | grep 'obj-.*-server'`rpm -e `rpm -qa | grep 'obj-.*-server'`

To install other packages run this script (it is provided by edg-To install other packages run this script (it is provided by edg-populate-serverng)populate-serverng) /opt/local/linux/utils/installpackages-ngserver/opt/local/linux/utils/installpackages-ngserver

Page 10: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 10

4/9: Building installroot(s)

The installroot is a basic Linux system mounted via NFS during the The installroot is a basic Linux system mounted via NFS during the installation. This script will create the RPM DB and install all the installation. This script will create the RPM DB and install all the required packages. So run:required packages. So run: /opt/local/linux/utils/create-nginstallroot-rh62/opt/local/linux/utils/create-nginstallroot-rh62

You have also to provide an installparams file; customize it changing You have also to provide an installparams file; customize it changing the default keyboard (UK) to your preferred:the default keyboard (UK) to your preferred: cd /opt/local/linux/nginstallroot/6.2/etccd /opt/local/linux/nginstallroot/6.2/etc cp installparams.default installparamscp installparams.default installparams vi installparamsvi installparams

Follow similar steps for RH 7.3 (the installroot are differents)Follow similar steps for RH 7.3 (the installroot are differents)

Page 11: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 11

5/9: Set up DHCP

To configure DHCP:To configure DHCP: touch /var/state/dhcp/dhcpd.leasestouch /var/state/dhcp/dhcpd.leases An example of /etc/dhcpd.conf is provided in An example of /etc/dhcpd.conf is provided in

/etc/dhcpd.conf.ngexample/etc/dhcpd.conf.ngexample Remember to customize there:Remember to customize there:

Domain, DNS, gatewayDomain, DNS, gateway And for each node you need:And for each node you need:

MAC address, IP addressMAC address, IP address To start itTo start it

/etc/rc.d/init.d/dhcpd start/etc/rc.d/init.d/dhcpd start Enable it for the future:Enable it for the future:

//sbin/chkconfig --level 2345 dhcpd onsbin/chkconfig --level 2345 dhcpd on WarningWarning: some dhcpd.conf lines changed from the old LCFG!: some dhcpd.conf lines changed from the old LCFG!

Page 12: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 12

6/9: Set up NFS

An example of /etc/export is provided by /etc/exports.ngexample. An example of /etc/export is provided by /etc/exports.ngexample. The installroot and the RPM repositories should be read-only The installroot and the RPM repositories should be read-only available to the clientsavailable to the clients

Start (or restart) the nfs service:Start (or restart) the nfs service: /etc/rc.d/init.d/nfs start/etc/rc.d/init.d/nfs start /etc/rc.d/init.d/nfslock start/etc/rc.d/init.d/nfslock start

Enable them for the future:Enable them for the future: /sbin/chkconfig --level 345 nfs on/sbin/chkconfig --level 345 nfs on /sbin/chkconfig --level 345 nfslock on/sbin/chkconfig --level 345 nfslock on

Page 13: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 13

7/9: Set up HTTP

Shut down apache (if running)Shut down apache (if running) /etc/rc.d/init.d/httpd stop/etc/rc.d/init.d/httpd stop

Follow the instructions on the server installation guide to customize Follow the instructions on the server installation guide to customize some lines on /etc/httpd/conf/httpd.confsome lines on /etc/httpd/conf/httpd.conf

Create an htpasswd file to protect the CGI script used to select the Create an htpasswd file to protect the CGI script used to select the machines to install (it will be explained in the next PXE slides):machines to install (it will be explained in the next PXE slides): htpasswd -c /etc/httpd/.htpasswd lcfgnghtpasswd -c /etc/httpd/.htpasswd lcfgng

Start it and enable it:Start it and enable it: /etc/rc.d/init.d/httpd start/etc/rc.d/init.d/httpd start /sbin/chkconfig --level 345 httpd on/sbin/chkconfig --level 345 httpd on

Page 14: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 14

8/9: Set up mkxprofd

In LCFGng mkxprof In LCFGng mkxprof mustmust be run as daemon be run as daemon Start and enabled mkxprofd:Start and enabled mkxprofd:

/etc/rc.d/init.d/mkxprofd start/etc/rc.d/init.d/mkxprofd start /sbin/chkconfig --level 345 nfslock on/sbin/chkconfig --level 345 nfslock on

When you change the configuration files and you have to deploy When you change the configuration files and you have to deploy the changes to the client, you should reload the daemon so it will the changes to the client, you should reload the daemon so it will rebuild the XML files and send the notifications:rebuild the XML files and send the notifications: /etc/rc.d/init.d/mkxprofd reload/etc/rc.d/init.d/mkxprofd reload

The compilation output is available only via web :-(The compilation output is available only via web :-( http://<LCFGServer>/status/http://<LCFGServer>/status/

Page 15: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 15

9/9: Build the XML profiles

See Andrea's presentation in the afternoon...See Andrea's presentation in the afternoon...

Page 16: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 16

There are two diskettes, RH62 or RH731. Download the image:There are two diskettes, RH62 or RH731. Download the image: http://datagrid.in2p3.fr/distribution/datagrid/wp4/edg-lcfg/packages/http://datagrid.in2p3.fr/distribution/datagrid/wp4/edg-lcfg/packages/

external/diskettes/external/diskettes/ Write the image on a disketteWrite the image on a diskette

dd if=<filename> of=/dev/fd0 bs=1024dd if=<filename> of=/dev/fd0 bs=1024 Boot from it on the client and confirm manually when askedBoot from it on the client and confirm manually when asked Put a look on the server:Put a look on the server:

tail -f /var/log/messagestail -f /var/log/messages Cross all your fingers ;-)Cross all your fingers ;-)

Install a client: floppy

Page 17: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 17

1/3: Install a client: PXE

Copy the loader, provided by the package syslinux, in /tftpboot:Copy the loader, provided by the package syslinux, in /tftpboot: cp /usr/lib/syslinux/pxelinux.0 /tftpboot/cp /usr/lib/syslinux/pxelinux.0 /tftpboot/

Enable TFTP in /etc/inetd.conf by adding this line:Enable TFTP in /etc/inetd.conf by adding this line: tftp dgram udp wait root/usr/sbin/tcpd in.tftpd -s /tftpboottftp dgram udp wait root/usr/sbin/tcpd in.tftpd -s /tftpboot

Restart the service:Restart the service: /etc/rc.d/init.d/inetd restart/etc/rc.d/init.d/inetd restart

Via web you can choose which nodes should be installed. If there is Via web you can choose which nodes should be installed. If there is the corresponfing XML profile, the node will be listed here: the corresponfing XML profile, the node will be listed here: http://<LCFGngServer>/install/install.cgihttp://<LCFGngServer>/install/install.cgi

This web interface updates some symlinks that are used by pxelinux This web interface updates some symlinks that are used by pxelinux to choose the boot from the local disk or the installation via networkto choose the boot from the local disk or the installation via network

On the next slide a screen shot...On the next slide a screen shot...

Page 18: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 18

2/3 How pxelinux works (only for curious)

LCFG server NodeNIC (broadcast): "Please, I need an IP"

DHCP server: "Your IP is 192...; to boot you have to load a file called pxelinux.0"

NIC (now configured): "Could you give me this pxelinux.0"?

TFTP server: "Of course, it's for free!"

pxelinux.0: "Thank you Sir. I am the OS loader.Could send me my configuration file

(it is called as my ipaddress)?"

TFTP server: "Yessir"

pxelinux.0 looks into its configuration file and decide if it has to boot from the pxelinux.0 looks into its configuration file and decide if it has to boot from the local disk or to mount via NFS a root file system (and starting automatic local disk or to mount via NFS a root file system (and starting automatic installation installation without manual interventionwithout manual intervention))

Page 19: LCFGng server installation

C. Aiftimiei, E. Ferro / January 2003 19

3/3: Web interface for PXE installations

This CGI script creates symlinks so each client download its This CGI script creates symlinks so each client download its configuration fileconfiguration file

At the end the installation script, using wget, calls another CGI script At the end the installation script, using wget, calls another CGI script that restore the boot from hard diskthat restore the boot from hard disk