公司购买了一批HP DL360G5服务器,数量大约有200台。要统一安装 RedHat Enterprise Linux AS 4 update 7 操作系统。如果一台一台手动安装不但费时费事,更是会让我羸弱的身体雪上加霜。于是公欲善其事,必先利其器。我决定使用PXE来批量安装这批服务器。
以下是安装配置的过程:
硬件和软件环境:
硬件:找一台安装了RedHat Enterprise Linux AS 4 update 7 系统的服务器,一台48口千兆交换机(没有千兆交互机可以用百兆交换机替代)
软件:tftp-server、dhcpd、vsftpd
软件安装配置过程:
1、安装tftp-server
从 RedHat Enterprise Linux AS 4 update 7 安装光盘找到 tftp-server-0.39-3.el4.i386.rpm 软件包并安装。
修改 /etc/xinetd.d/tftp 文件:
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no #将原来的yes改成no
per_source = 11
cps = 100 2
flags = IPv4
}
# Kickstart file automatically generated by anaconda.
install
url --url=ftp://192.168.0.1/rhel/
lang zh_CN.UTF-8
langsupport --default=en_US.UTF-8 zh_CN.UTF-8 en_US.UTF-8
keyboard us
xconfig --card "ATI ES1000" --videoram 32768 --hsync 31.5-37.9 --vsync 50-70 --resolution 800x600 --depth 16 --startxonboot --defaultdesktop kde
text
network --device eth0 --bootproto dhcp
network --device eth1 --bootproto dhcp
rootpw --iscrypted $1$VhK0ct0.$yLPLHRWsKYEUFnNbGA4s2.
firewall --enabled --port=22:tcp --port=80:tcp --port=21:tcp --port=25:tcp
selinux --enforcing
poweroff
authconfig --enableshadow --passalgo=md5
timezone Asia/Shanghai
bootloader --location=mbr
# 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
clearpart --all --initlabel
part /boot --fstype ext3 --size=200
part swap --size=2048
part / --fstype ext3 --size=100 --grow