分类: LINUX
2008-03-21 17:37:20
安装服务器配置过程
过程原理:由一台服务器提供DHCP、TFTP及NFS服务,
客户端支持PXE启动,会在局域网上发送申请动态IP的广播包,
安装的过程是这样的:PXE网卡启动------DHCP服务器------获得IP------从TFTP上下载pxelinux.0、vmlinuz、initrd------启动系统------通过PEXlinux去HTTP下载ks.cfg文件-----跟据ks.cfg去HTTP下载RPM包及安装系统------完成安装。
DHCP,NFS,TFTP使用同一台服务器,IP为192.168.96.254
一、配置DHCP服务
安装dhpc
vi /etc/dhcpd.conf
QUOTE:
ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
class "pxeclients"{
match if substring(option vendor-class-identifier,0,9) = "PXEClient";
filename "pxelinux.0";
next-server 192.168.96.254;
}
subnet 192.168.96.0 netmask 255.255.255.0 {
option routers 192.168.96.254;
option subnet-mask 255.255.255.0;
option nis-domain "linux.5166.info";
option domain-name "linux.5166.info";
option domain-name-servers 202.106.46.151;
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 192.168.96.100 192.168.96.200;
default-lease-time 21600;
max-lease-time 43200;
host linux {
hardware ethernet 00:11:43:5A:5D:46;
fixed-address 192.168.96.254;
}
}
======================================================================
二、配置TFTP
安装
chkconfig tftp on
service xinetd restart
====================================================================
三、启动文件配置
cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
mkdir /tftpboot/pxelinux.cfg
mount -o loop /export/RHEL5dvd.iso /mnt
cp /mnt/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default
cp /mnt/images/pxeboot/initrd.img /tftpboot/
cp /mnt/images/pxeboot/vmlinuz /tftpboot/
vi /tftpboot/pxelinux.cfg/default
QUOTE:
default local
prompt 1
timeout 300
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label local
localboot 0
label linux install
kernel vmlinuz
append initrd=initrd.img
label linux text
kernel vmlinuz
append initrd=initrd.img text
label linux ks
kernel vmlinuz
append ks initrd=initrd.img
label linux memtest86
kernel memtest
append -
label autoinstall
kernel vmlinuz
append ks=nfs:192.168.96.254:/export/ks/ks.cfg initrd=initrd.img devfs=nomount ramdisk_size=16384 nofb
cp /mnt/isolinux/*.msg /tftpboot
vi /tftpboot/boot.msg
QUOTE:
^L
^Xsplash.lss
- To boot Operation System locally, press the ^O01
- To install or upgrade in graphical mode, type: ^O01linux install
- To install or upgrade in text mode, type: ^O01linux text
- To auto install or upgrade, type: ^O01autoinstall
- Use the function keys listed below for more information.
^O0f[F1-Main] [F2-Options] [F3-General] [F4-Kernel] [F5-Rescue]^O07
==================================================
四、配置NFS服务
vi /ec/exports
QUOTE:
/export *(ro,sync)
/export/ks *(rw,sync)
cp *.iso /export/
mkdir /export/ks
cp /root/anaconda-ks.cfg /export/ks/ks.cfg
chmod 644 /export/ks/ks.cfg
==================================================
五、重启服务
service dhcpd restart
service xinetd restart
service nfs restart
==================================================
六、设备客户端
客户端设置PXE启动启动后输入autoinstall即可执行全自动安装。
输入linux ks=nfs:192.168.96.254:/ks/otherks.cfg即可另指定ks文件。
输入linux rescue即可进入系统修复模式,以对系统进行修整。
简单按一下回车,或者等一会,客户端就从本地硬盘启动系统。
按F2、F3等键也可以进行切换。