使用服务器 PXE 功能从网络安装操作系统
使用服务器 PXE 功能从网络安装操作系统 目的是方便集群服务器安装, 减少人力及物力开销,压缩安装系统时间, 目前多数服务器都支持 PXE 方式从服务器网卡进行引导,通过安装服务 器的 DHCP 功能分配 ip 地址, 由 tftp 软件创建引导服务器安装的引导菜单,再调用 nfs/ftp/http 方式进行安装操作系统. 此文档是使用 http 方式进行安装服务器系统.编写此文档时安装服务器使用 CenOS 5.2 x64 位操作系统.配置好了 yum 源. 其它操作系统类 似.安装步聚都是一样的. PXE server 从网络安装操作系统需要以下几个步聚 1) 安装 DHCP 服务 2) 安装 tftp 服务 3) 安装 NFS/FTP/HTTP 服务器(从中选其一) 1 安装 dhcp 服务 [root@server1 ~] # yum install dhcp Dhcpd 配置文件是 /etc/dhcpd.conf 文件, 可以用 /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample 这个基本样例配置文件创建/etc/dhcp .conf , 根据你自己的需要修改你的子网和配置你的 dhcp 服务在你的网络上. 此文档使用 172.20.30.x 子网, 此文档中的配置文件内容如下: #***************************************** # /etc/dhcpd.conf configure file contents #***************************************** ddnsupdatestyle interim; not authoritative; option domainname \ option domainnameservers 208.67.222.222, 208.67.220.220; option subnetmask 255.255.255.0; subnet 172.20.30.0 netmask 255.255.255.0 { authoritative; range 172.20.30.10 172.20.30.90; option routers 172.20.30.254; allow unknownclients; allow booting allow bootp nextserver 172.20.30.100; filename \ } 2 安装 tftp 服务 tftp 服务是一个通过 udp 协议来传输数据的小型 ftp, 使用 xinetd 服务来调用 tftp 服务.监听 tcp/udp 的 69 端口. 由 xinetd 来启动 tftp 服务. 编辑 /etc/xinetd.d/tftp 配置文件, 设置选项中的 disable 为 no 即可, 我的服务器上的 tftp 配置如下 #***************************************** #tftp configure file #***************************************** 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 } 3 创建网络安装源 我们能用三种方法用 pxe 网络引导时安装操作系统, 三种方法分别是 nfs, ftp 或者 http, 我是用的 http, 从 http 安装操作系统, 3.1 安装 http 服务 [root@server1 ~] # yum install http 3.2 编辑 http 配置文件 编辑/etc/http/conf/httpd.conf 增加发行版本的 iso 源文件目录别名 在
PXE网络安装OS过程
![](/skin/haowen/images/icon_star.png)
![](/skin/haowen/images/icon_star.png)
![](/skin/haowen/images/icon_star.png)
![](/skin/haowen/images/icon_star.png)