好文档 - 专业文书写作范文服务资料分享网站

PXE网络安装OS过程

天下 分享 时间: 加入收藏 我要投稿 点赞

使用服务器 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 源文件目录别名 在之间加入: Alias /iso \ 然后在之后加入对 iso 源文件目录权限设置: 3.3 及创建安装源目录 mkdir p /www/iso/www/centos/5.2/x64 mkdir p /www/iso/www/centos/5.2/i386 3.4 创建安装源 如果你有一个从互联网上下载下来的 dvd 或 cd 文件, 你可以将 dvd 或 cd 文件的 iso mount 到安装源目录上 我下载的是 centos5.2 的 dvd 64 及 32 们版本,使用以下命令 mount 到安装源目录上: mount o loop /home/opensoft/iso/centos/5.2/x64/centos.iso /www/iso/www/centos/5.2/x64 mount o loop /home/opensoft/iso/centos/5.2/i386/centos.iso /www/iso/www/centos/5.2/i386 4 启动 dhcp, tftp 和 http 服务 [root@guorui ~] # /etc/init.d/dhcpd restart [root@guorui ~] # /etc/init.d/xinetd restart [root@guorui ~] # /etc/init.d/httpd restart 配置以上三个服务在重启后自动运行, 运行以下命令 [root@guorui ~] # chkconfig level 345 dhcpd on [root@guorui ~] # chkconfig level 345 httpd on [root@guorui ~]# chkconfig –level 345 xinetd on tftpd 服务是用 xinetd 来启动,所以只设置 xinetd 服务开机启动即可 5 配置 tftp 网络启动文件 5.1 创建/tftpboot/images 上当用于当 PXE 启动安装程序时要找的启动文件目录 mkdir p /tftpboot/images 5.2 拷贝 /usr/lib/syslinux/pxelinux.0 文件到/tftpboot/目录下 [root@guorui tftpboot]# cp /usr/lib/syslinux/pxelinux.0 /tftpboot 5.3 建立 /tftpboot/images 目录树并且拷贝 vmlinuz 和 initrd.img 文件从你的安装源目录 (/images/pxeboot/vmlinuz 和 /images/pxeboot/initrd.img [root@guorui tftpboot]# mkdir p images/centos/5.2/i386 [root@guorui tftpboot]# mkdir p images/centos/5.2/x64 [root@guorui tftpboot]# cp /www/iso/www/centos/5.2/i386/images/pxeboot/vmlinuz images/centos/5.2/i386/ [root@guorui tftpboot]# cp /www/iso/www/centos/5.2/i386/images/pxeboot/initrd.img images/centos/5.2/ i386/

PXE网络安装OS过程

使用服务器PXE功能从网络安装操作系统使用服务器PXE功能从网络安装操作系统目的是方便集群服务器安装,减少人力及物力开销,压缩安装系统时间,目前多数服务器都支持PXE方式从服务器网卡进行引导,通过安装服务器的DHCP功能分配ip地址,由tftp软件创建引导服务器安装
推荐度:
点击下载文档文档为doc格式
9nlft1hu4z5136q5t3t485bn78arf200cg2
领取福利

微信扫码领取福利

微信扫码分享