PXE+DHCP+Apache+KickStart无人值守安装RHEL5.8

简介:

相关概念

1. 什么是PXE

   严格来说,PXE 并不是一种安装方式,而是一种引导方式。进行 PXE 安装的必要条件是在要安装的计算机中必须包含一个 PXE 支持的网卡(NIC),即网卡中必须要有 PXE Client。PXE (Pre-boot Execution Environment)协议可以使计算机通过网络启动。此协议分为 Client端和 Server 端,而PXE Client则在网卡的 ROM 中。当计算机引导时,BIOS 把 PXE Client 调入内存中执行,然后由 PXE Client 将放置在远端的文件通过网络下载到本地运行。运行 PXE 协议需要设置 DHCP 服务器和 TFTP 服务器。DHCP 服务器会给 PXE Client(将要安装系统的主机)分配一个 IP 地址,由于是给 PXE Client 分配 IP 地址,所以在配置 DHCP 服务器时需要增加相应的 PXE 设置。此外,在 PXE Client 的 ROM 中,已经存在了 TFTP Client,那么它就可以通过 TFTP 协议到 TFTP Server 上下载所需的文件了。

2. 什么是Kickstart

   Kickstart是一种无人值守的安装方式。它的工作原理是在安装过程中记录典型的需要人工干预填写的各种参数,并生成一个名为 ks.cfg的文件。如果在安装过程中(不只局限于生成Kickstart安装文件的机器)出现要填写参数的情况,安装程序首先会去查找 Kickstart生成的文件,如果找到合适的参数,就采用所找到的参数;如果没有找到合适的参数,便需要安装者手工干预了。所以,如果Kickstart文件涵盖了安装过程中可能出现的所有需要填写的参数,那么安装者完全可以只告诉安装程序从何处取ks.cfg文件,然后就去忙自己的事情。等安装完毕,安装程序会根据ks.cfg中的设置重启系统,并结束安装。

3. PXE + Kickstart的安装先决条件

DHCP 服务器。
TFTP 服务器。
Kickstart所生成的ks.cfg配置文件。
一台存放系统安装文件的服务器,如 NFS、HTTP 或 FTP 服务器。
一个带有 PXE 支持网卡的主机。

实现步骤

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#############################挂载光盘################################
yum  install  -y httpd    安装apache
mount  /dev/cdro  /mnt/cdrom     挂载安装光盘
cp  -rf  /mnt/cdrom/ /mnt/cdrom     复制光盘内容到web目录
#############################安装tftp################################
yum  install  -y tftp-server    安装tftp-server
cat  /etc/xinetd .d /tftp     修改配置文件内容为
service tftp
{
   socket_type    = dgram
   protocol    = udp
   wait      =  yes
   user      = root
   server      =  /usr/sbin/in .tftpd
   server_args    = -s  /tftpboot
   disable      = no
   per_source    = 11
   cps      = 100 2
   flags      = IPv4
}
service xinetd restart    重启xinetd进程
########################配置支持PXE的启动程序#######################
mkdir  -p  /tftpboot
cp  /usr/lib/syslinux/pxelinux .0  /tftpboot
cp  /var/www/html/images/pxeboot/vmlinuz  /tftpboot
cp  /var/www/html/images/pxeboot/initrd .img  /tftpboot/
cp  /var/www/html/isolinux/ *.msg  /tftpboot/
mkdir  /tftpboot/pxelinux .cfg -pv
cp  /var/www/html/isolinux/isolinux .cfg   /tftpboot/pxelinux .cfg /default
########################安装配置dhcp服务#############################
yum –y  install  dhcp
cat  /etc/dhcpd .conf    主配置文件
ddns-update-style interim;
ignore client-updates;
next-server 192.168.1.110;
filename  "/pxelinux.0" ;
subnet 192.168.1.0 netmask 255.255.255.0 {
         option routers                  192.168.1.10;
         option subnet-mask              255.255.255.0;
         option nis-domain                "domain.org" ;
         option domain-name               "domain.org" ;
         option domain-name-servers      192.168.1.10;
         option  time -offset              -18000;  # Eastern Standard Time
         range dynamic-bootp 192.168.1.100 192.168.1.200;
         default-lease- time  21600;
         max-lease- time  43200;
}
service dhcpd start
########################安装Kickstart并配置##########################
yum –y  install  system-config-kickstart
system-config-Kickstart    配置
最后将生成的文件ks.cfg保存到 /var/www/html
###############修改/tftpboot/pxelinux.cfg/default文件################
修改前两行内容为
default text ks=http: //192 .168.11.29 /ks .cfg
timeout 2
#################修改/var/www/html/ks.cfg文件内容####################
#platform=x86, AMD64, or Intel EM64T
#System authorization information
auth    --useshadow    --enablemd5
# System bootloader configuration
key --skip
bootloader --location=mbr
# Partition clearing information
clearpart --none
# Use graphical install
graphical
# Firewall configuration
firewall --disabled
# Run the Setup Agent on first boot
firstboot --disable
#System keyboard
keyboard us
#System language
lang en_US
# Installation logging level
logging --level=info
# Use network installation
url --url=http: //192 .168.1.110/
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
reboot
#Root password
rootpw --iscrypted $1$aseasd$W0TpOJ8tqCoFgcbKk4wie0
# SELinux configuration
selinux --disabled
# System timezone
timezone --isUtc Asia /Shanghai
# Install OS instead of upgrade
install
# X Window System configuration information
xconfig    --defaultdesktop=GNOME --depth=8 --resolution=640x480
# Disk partitioning information
bootloader --location=mbr --driveorder=sda
clearpart --all --initlabel
part / --bytes-per-inode=4096 --fstype= "ext3"  --size=5120
part  /boot  --bytes-per-inode=4096 --fstype= "ext3"  --size=128
part swap --bytes-per-inode=4096 --fstype= "swap"  --size=500
part  /data  --bytes-per-inode=4096 --fstype= "ext3"  --grow --size=1
%packages
@base
@development-libs
@development-tools
#######################添加开机启动并且启动各服务####################
service httpd start
chkconfig httpd on
service dhcpd start
chkconfig dhcpd on
service xinetd restart

启动客户端测试

   至此表明各服务正常工作

160656307.png

   至此表明ks.cfg文件生效

160707615.png


本文转自 ftmoonfans  51CTO博客,原文链接:http://blog.51cto.com/soulboy/1282094

相关文章
|
14天前
|
网络安全 Apache
Apache服务器安装SSL证书
Apache服务器安装SSL证书
19 0
|
4月前
|
SQL 分布式计算 数据可视化
Apache Zeppelin系列教程第一篇——安装和使用
Apache Zeppelin系列教程第一篇——安装和使用
73 0
|
3月前
|
Java 应用服务中间件 Apache
Windows安装Apache服务器
可能你听说过Apache Tomcat, Apache与Tomcat都是Apache开源组织开发的用于处理HTTP服务的项目,两者都是免费的,都可以作为独立的Web服务器运行。Apache是Web服务器。Tomcat是Java应用服务器,是 Apache 的扩展。本文档将详细描述如何在云服务器上安装Apache环境。
50 0
|
4月前
|
SQL Apache 流计算
Apache StreamPark系列教程第一篇——安装和体验
Apache StreamPark系列教程第一篇——安装和体验
190 0
|
4月前
|
Shell Apache 流计算
Apache Flink教程----1.安装初体验
Apache Flink教程----1.安装初体验
38 0
|
4月前
|
Java Apache 数据库
下一代实时数据库:Apache Doris 【二】编译与安装
下一代实时数据库:Apache Doris 【二】编译与安装
82 0
|
4月前
|
Java 应用服务中间件 Spring
Tomcat【部署 01】安装包版本说明+安装+参数配置+启动(JDK11+最新版apache-tomcat-10.0.12)
Tomcat【部署 01】安装包版本说明+安装+参数配置+启动(JDK11+最新版apache-tomcat-10.0.12)
63 0
|
4月前
|
数据采集 消息中间件 缓存
Apache Flume及快速安装
Apache Flume及快速安装
34 0
|
4月前
|
Linux Apache
linux 安装 Apache 服务 并部署网站
linux 安装 Apache 服务 并部署网站
112 0
|
4月前
|
Apache Windows
小白下载和安装Apache的教程(保姆级)
小白下载和安装Apache的教程(保姆级)
76 0

热门文章

最新文章

推荐镜像

更多