Tuesday, December 20, 2016

Managing Automating Installation With Kickstart
------------------------------------------------
Kickstart installations provide an automated alternative to the normal interactive installations of Red Hat Linux. The automation of installation and post installation configuration steps represents a considerable time saving in situations where many similar installations are performed.

Installing Kickstart Configurator
---------------------------------
RedHat > System Settings > Add/Remove Applications ->Administration Tools->redhat-config-kickstart
Once the installation is complete, Kickstart is available from the menu (RedHat > System Tools > Kickstart).

Generating Kickstart Files
---------------------------
The Kickstart Configurator program allows you to answer most of the questions asked during an interactive installation process. Once each section of the configurator is complete, simply save the configuration as a file called "ks.cfg" on a floppy disk, cdrom or some other media available at boot time. You may want to then edit the configuration file and comment out certain parameters that may change from system to system with a "#". These could include things like the system's name and IP address. During the kickstart process you will be prompted for these unspecified values.

Editing Kickstart Files
-----------------------
The kickstart file below was generated by the configurator, then modified to include the hostname and some addition packages, to support the installation of 10g AS Release 1.

#Generated by Kickstart Configurator
#System  language
lang en_US
#Language modules to install
langsupport  --default=en_US
#System keyboard
keyboard uk
#System mouse
mouse generic3ps/2
#Sytem timezone
timezone Europe/London
#Root password
oracle --iscrypted $1$.6i6zn9F$/3A7hCL3hRFtCLCZRiwMa.
#Reboot after installation
reboot
#Install Red Hat Linux instead of upgrade
install
#Use CDROM installation media
cdrom
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part /boot --fstype ext3 --size 300
part swap --size 8192
part / --fstype ext3 --size 1 --grow
#System authorization infomation
auth  --useshadow  --enablemd5
#Network information
network --bootproto=static --ip=192.168.2.2 --netmask=255.255.255.255 --gateway=192.168.2.1
        --nameserver=192.168.2.1 --device=eth0 --hostname=rhel3.mydomain.com
#Firewall configuration
firewall --disabled
#XWindows configuration information
xconfig --depth=32 --resolution=1024x768 --defaultdesktop=GNOME --startxonboot
#Run the Setup Agent on first boot
firstboot --enable
#Package install information
%packages --resolvedeps
@ X Window System
@ GNOME Desktop Environment
@ Editors
@ Graphical Internet
@ Text-based Internet
@ Server Configuration Tools
@ FTP Server
@ Development Tools
@ Administration Tools
@ System Tools
setarch
sysstat
openmotif21
ORBit
libpng10
gnome-libs
compat-glibc
compat-gcc
compat-gcc-c++
compat-libstdc++
compat-libstdc++-devel



Post installation tasks can also be included in the kickstart file by using the "%post" option at the end of the file. The script listed below performs the majority of the post installation tasks necessary for the installation of 10g AS Release 1.

#Post-installation script
%post --nochroot
echo "192.168.2.2  rhel3.mydomain.com  rhel3" >> /etc/hosts
#
echo "kernel.shmall = 2097152" >> /etc/sysctl.conf
echo "kernel.shmmax = 2147483648" >> /etc/sysctl.conf
echo "kernel.shmmni = 142" >> /etc/sysctl.conf
echo "# semaphores: semmsl, semmns, semopm, semmni" >> /etc/sysctl.conf
echo "kernel.sem = 256 32000 100 142" >> /etc/sysctl.conf
echo "fs.file-max = 131072" >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 20000 65000" >> /etc/sysctl.conf
echo "kernel.msgmni = 2878" >> /etc/sysctl.conf
echo "kernel.msgmax = 8192" >> /etc/sysctl.conf
echo "kernel.msgmnb = 65535" >> /etc/sysctl.conf
/sbin/sysctl -p
#
echo "*               soft    nproc   16384" >> /etc/security/limits.conf
echo "*               hard    nproc   16384" >> /etc/security/limits.conf
echo "*               soft    nofile  65536" >> /etc/security/limits.conf
echo "*               hard    nofile  65536" >> /etc/security/limits.conf
#
echo "session    required     /lib/security/pam_limits.so" >> /etc/pam.d/login
#
mv /usr/bin/gcc /usr/bin/gcc323
mv /usr/bin/g++ /usr/bin/g++323
ln -s /usr/bin/gcc296 /usr/bin/gcc
ln -s /usr/bin/g++296 /usr/bin/g++
#
groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba -s /bin/ksh oracle
#
echo "# Oracle Settings" >> /home/oracle/.profile
echo "TMP=/tmp; export TMP" >> /home/oracle/.profile
echo "TMPDIR=$TMP; export TMPDIR" >> /home/oracle/.profile
echo "ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE" >> /home/oracle/.profile
echo "ORACLE_HOME=$ORACLE_BASE/product/904_infra; export ORACLE_HOME" >> /home/oracle/.profile
echo "ORACLE_TERM=xterm; export ORACLE_TERM" >> /home/oracle/.profile
echo "PATH=/usr/sbin:$ORACLE_HOME/bin:$PATH; export PATH" >> /home/oracle/.profile
echo "PATH=$PATH:$ORACLE_HOME/dcm/bin:$ORACLE_HOME/opmn/bin; export PATH" >> /home/oracle/.profile
echo "PATH=$PATH:$ORACLE_HOME/Apache/Apache/bin; export PATH" >> /home/oracle/.profile
echo "if [ $USER = "oracle" ]; then" >> /home/oracle/.profile
echo "  if [ $SHELL = "/bin/ksh" ]; then" >> /home/oracle/.profile
echo "    ulimit -p 16384" >> /home/oracle/.profile
echo "    ulimit -n 16384" >> /home/oracle/.profile
echo "  else" >> /home/oracle/.profile
echo "    ulimit -u 16384 -n 16384" >> /home/oracle/.profile
echo "  fi" >> /home/oracle/.profile
echo "fi" >> /home/oracle/.profile
echo "PS1="`hostname`> "" >> /home/oracle/.profile
echo "set -o emacs" >> /home/oracle/.profile
echo "set filec" >> /home/oracle/.profile
chown oracle:oinstall /home/oracle/.profile



Kickstart Installation
-----------------------
To start the installation, boot from the normal Red Hat installation disk. At the boot prompt, insert the floppy disk containg the "ks.cfg" file then type "linux ks=floppy" followed by return.

Using a Web Server
To perform a network installation, place the kickstart configuration file on a HTTP server and boot using the following boot option, using the IP address of the HTTP server.
linux ks=http://192.168.2.50/anaconda-ks.cfg
If you want to install using network media, copy the "RedHat" directories from all the CDs into a directory available from the HTTP server, then alter the "install" option in the kickstart configuration file to read as follows.
install url --url http://192.168.2.50/RHEL3/
The IP address is that of the HTTP server and "RHEL3" represents the directory containing the combined RedHat directories from the CDs.
OR
Verify that the first two lines of the file look like this or else you may be prompted for RPM base file location information.
install
url --url http://192.168.1.100/network-install/RPM

Using a NFS Server
Verify that the first two lines of the file look like this or else you may be prompted for NFS ISO file location information.
install
nfs --server=192.16.1.100 --dir=/data/network-install/ISO



Booting With Your Kickstart Files
---------------------------------
There are two ways to specify the name of the kickstart file to use. The first is to enter it manually from the LILO boot: prompt when you insert the boot CD. The second is to have your DHCP server automatically tell the Kickstart client about the name of the kickstart file to use when it assigns the IP address. Both methods are listed below:

Manually Specifying the Kickstart Filename
-------------------------------------------
Once you have booted from your boot CDROM, you'll need to use the following command at the lilo boot: prompt to continue with the installation. The ks.cfg file is the kickstart configuration file we want to use.
NFS Method
boot: linux ks=nfs:192.168.1.100:/kickstart/ks.cfg
HTTP Method
boot: linux ks=http://192.168.1.100/network-install/kickstart/ks.cfg


Configuring The Filename Automatically
---------------------------------------
Whenever you have to create lots of cloned Linux servers, then you may want to configure your DHCP server to specify the single kickstart configuration file you wish to use. Here is how it's done:
1) Place your kickstart file in the /data/network-install/kickstart directory.
2) Edit your dhcpd.conf file and add the following lines to the section for the interface that will be serving DHCP IP addresses. The next-server value is the IP address of the kickstart server.
filename "/data/network-install/kickstart/ks.cfg";
next-server 192.168.1.100;
3) Insert the boot CD into the kickstart client Linux box and connect it to the DHCP network. At the boot: prompt type in the following command:
boot: linux ks
Kickstart will first search for a configuration file named ks.cfg on either the boot CD. It will then automatically attempt to get a DHCP IP address and see if the DHCP server will specify a configuration file.
Kickstart will then use NFS to get both the configuration file and the installation ISOs. The rest should be automatic.




References:

http://oracle-base.com/articles/linux/kickstart.php
http://oracle-base.com/articles/linux/pxe-network-installations-ol5-and-rhel5.php(PXE Network Installations)

No comments:

Post a Comment