PXE远程安装文档.docx
《PXE远程安装文档.docx》由会员分享,可在线阅读,更多相关《PXE远程安装文档.docx(20页珍藏版)》请在冰豆网上搜索。
PXE远程安装文档
PXE远程批量安装linux服务器(两种方式)
Ø基于DHCP+NFS+TFTP+PXE远程安装
⏹部署DHCP服务
◆安装dhcp并配置服务
●rpm–vihdhcpd-devel-3.0.5-18.el5.i386.rpm
●rpm–vihdhcp-3.0.5-18.el5.i386.rpm
●vim/etc/dhcpd.conf
#DHCPServerConfigurationfile.
#see/usr/share/doc/dhcp*/dhcpd.conf.sample
ddns-update-styleinterim;
ignoreclient-updates;
default-lease-time21600;
max-lease-time43200;
subnet192.168.14.0netmask255.255.255.0{
rangedynamic-bootp192.168.14.1192.168.14.250;
optionrouters192.168.14.1;
optionsubnet-mask255.255.255.0;
filename"pxelinux.0";(必须添加)
next-server192.168.14.1;(必须添加)
}
●启动DHCP服务:
servicedhcpdrestart
⏹部署TFTP服务及NFS服务配置
◆安装TFTP服务并配置
●Rpm–vihxinetd-2.3.14-10.el5.i386.rpm
●Rpm–ivhtftp-server-0.42-3.1.i386.rpm
Vim/etc/xinetd.d/tftp
servicetftp
{
socket_type=dgram
protocol=udp
wait=yes
user=root
server=/usr/sbin/in.tftpd
server_args=-s/tftpboot
disable=no
per_source=11
cps=1002
flags=IPv4
}
◆安装NFS服务并配置
●默认NFS组件已安装我们直接配置文件
●Mkdir/pub
●Chmod777/pub
●Vim/etc/exports
●/pub192.168.14.0/24(ro,sync,root_squash)
●启动NFS服务:
servicenfsrestart
◆PXE部署及配置文件
●复制相关文件及挂载IS0
●Mount/dev/cdrom/mnt
●Cp–fr/mnt/*/pub
●复制PXE相关文件到TFTP目录中()
●Cp–fr/pub/isolinux/*/tftpboot
●Mkdirpxelinux.cfg
●Mvisolinux.cfgpxelinux.cfg/default
●Vimpxelinux.cfg/default
defaultlinux
prompt1
timeout6
displayboot.msg
F1boot.msg
F2options.msg
F3general.msg
F4param.msg
F5rescue.msg
labellinux
kernelvmlinuz
appendinitrd=initrd.imgks=nfs:
192.168.14.1:
/pub/ks.cfg
labeltext
kernelvmlinuz
appendinitrd=initrd.imgtext
labelks
kernelvmlinuz
appendksinitrd=initrd.img
labellocal
localboot1
labelmemtest86
kernelmemtest
append–
●Cp/usr/lib/syslinux/pxelinux.0/tftpboot/
●Chmod777–R/tftpdboot
●Cd/pub
●创建kickstart文件有多种方法、为了节约时间、本人copy标准模板中/root/anaconda-ks.cfg文件修改成ks.cfg文件
●Cp–fr/root/anaconda-ks.cfg/pub/ks.cfg
●Vimks.cfg
text
install
nfs--server=192.168.14.1--dir=/pub
key49af89414d147589
langen_US.UTF-8
keyboardus
network--deviceeth0--bootprotodhcp
rootpw--iscrypted$1$GwS9wVJv$TSXV1AZWqMQJTucJRaRFM1
timezone--utcAsia/Shanghai
firewall--disabled
authconfig--enableshadow--enablemd5
selinux--disabled
clearpart--linux--initlabel
bootloader--location=mbr--md5pass=$1$174xB0$UnA2EkjDBmXfpHVvNqA7h0
part/var--fstypeext3--size=2048--ondisk=sda
part/--fstypeext3--size=1--grow--ondisk=sda
partswap--size=2048--ondisk=sda
%packages
……
……
◆启动服务
●Servicenfsrestart
●Servicedhcpdrestart
●Servicexinetdrestart
Ø基于多系统DHCP+HTTPD+TFTP+PXE远程安装
⏹部署DHCP服务
◆安装dhcp并配置服务
●rpm–vihdhcpd-devel-3.0.5-18.el5.i386.rpm
●rpm–vihdhcp-3.0.5-18.el5.i386.rpm
●vim/etc/dhcpd.conf
ddns-update-stylenone;
default-lease-time3600;
max-lease-time7200;
subnet192.168.10.0netmask255.255.255.0{
range192.168.10.2192.168.10.254;
optionrouters192.168.10.1;
optiondomain-name-servers192.168.10.1;
filename"pxelinux.0";
next-server192.168.10.1;
}
●启动DHCP服务:
servicedhcpdrestart
●DHCP配置截图
●
⏹部署TFTP服务及NFS服务配置
◆安装TFTP服务并配置
●Rpm–vihxinetd-2.3.14-10.el5.i386.rpm
●Rpm–ivhtftp-server-0.42-3.1.i386.rpm
Vim/etc/xinetd.d/tftp
servicetftp
{
socket_type=dgram
protocol=udp
wait=yes
user=root
server=/usr/sbin/in.tftpd
server_args=-s/tftpboot
disable=no
per_source=11
cps=1002
flags=IPv4
}
●TFTP截图
●
⏹HTTPD部署及配置信息
◆HTTPD安装依赖包
●Rpm–vih
httpd-2.2.3-31.el5.i386.rpmhttpd-devel-2.2.3-31.el5.i386.rpmhttpd-manual-2.2.3-31.el5.i386.rpm
apr-devel-1.2.7-11.el5_3.1.i386.rpmapr-util-devel-1.2.7-7.el5_3.2.i386.rpm
●Vim/etc/httpd/conf/httpd.conf
Optionsall
Allowoverrideall
Orderallow,deny
Allowfromall
#Includeconf.d/*.conf
●保存退出
●HTTP截图
●
●Servicehttpdrestart
◆共享ISO文件及KS文件
●Cd/var/www/html/
●Mkdirrhel5.4x86
Mount–olooprhel5.4x86.iso/var/www/html/rhel5.4x86
●Mkdirrhel5.5x64
Mount–olooprhel5.5x64.iso/var/www/html/rhel5.5x64/
●Mkdirrhel6.0x86
Mount–olooprhel6.0x86.iso/var/www/html/rhel6.0/
●Mkdirks
●HTTPD共享截图
●
⏹PXE的部署及配置信
◆PXE相关文件copy及目录创建
●Cd/tftpboot/
●Mkdirpxelinux.cfg
●Mkdirrhel5.4x86
●Mkdirrhel5.5x64
●Mkdirrhel6.0x86
◆复制各个OS引导文件到对应的目录中
●Cp–fr/usr/lib/syslinux/pxelinux.0./
●Cp–fr/var/www/html/rhel5.4x86/isolinux/*./rhel5.4x86
●Cp–fr/var/www/html/rhel5.5x64/isolinux/*./rhel5.5x64
●Cp–fr/var/www/html/rhel6.0x86/isolinux/*./rhel6.0x86
●TFTP目录结构截图
●
◆Pxedefault文件配置
●Cp–fr/mnt/isolinux/isolinux.cfg./pexlinux.cfg/default
●Vim./pxelinux.cfg/default
default1
prompt1
timeout120
displaypxelinux.cfg/list
F1boot.msg
F2options.msg
F3general.msg
F4param.msg
F5rescue.msg
label1
kernelrhel5.4x86/vmlinuz
appendinitrd=rhel5.4x86/initrd.imgnoipv6ksdevice=eth1ip=dhcpks=http:
//192.168.10.1/ks/rhel5.4x86.cfg
label2
kernelrhel5.5x64/vmlinuz
appendinitrd=rhel5.5x64/initrd.imgks=http:
//192.168.10.1/ks/rhel5.5x64.cfg
label3
kernelrhel6.0x86/vmlinuz
appendinitrd=rhel6.0x86/initrd.imgks=http:
//192.168.10.1/ks/rhel6.0x86.cfg
labellocal
localboot1
labelmemtest86
kernelmemtest
append–
●PXEdefault文件截图
●
●Vimlist
#-----------------PXEremoteinstallationLinuxserverlist----------------
#Plessenternumber!
...................
1redhat5.4x86
.......................................
2redhat5.5x64
.......................................
3redhat6.0x86
.......................................
●List文件截图
●
◆Ks配置文件信息
●Cd/var/www/html/ks
●Vimrhel5.4x86.cfg
text
install
url--urlhttp:
//192.168.10.1/rhel5.4x86/
key49af89414d147589
langzh_CN.UTF-8
keyboardus
network--deviceeth0--bootproto=static--ip=192.168.10.5--netmask=255.255.255.0--nameserver=219.238.232.231,202.106.0.20--noipv6--gateway=192.168.10.1
network--deviceeth1--bootproto=static--ip=10.14.22.5--netmask=255.255.255.0--nameserver=8.8.8.8--noipv6
rootpw--iscrypted$1$ht/lYYYb$M4wt0lZOD6bzP.vtDDAf51
firewall--disabled
authconfig--enableshadow--enablemd5
selinux--disabled
timezone--utcAsia/Shanghai
bootloader--location=mbr--driveorder=sda--append="rhgbquiet"
clearpart--initlabel
part/--fstypeext3--size=1--grow--ondisk=sda
partswap--size=1024--ondisk=sda
%packages
●Rhel5.4x86。
ks文件截图
●
●Vimrhel5.5x64.cfg
text
install
url--urlhttp:
//192.168.10.1/rhel5.5x64/
key49af89414d147589
langen_US.UTF-8
keyboardus
network--deviceeth0--bootprotostatic--ip192.168.10.5--netmask255.255.255.0--gateway192.168.10.254--nameserver219.238.232.231,202.106.0.20--hostnamelocalhost--noipv6
network--deviceeth1--bootprotostatic--ip10.14.22.5--netmask255.255.255.0--nameserver219.238.232.231,202.106.0.20--hostnamelocalhost--noipv6
rootpw--iscrypted$1$UpNsGJfB$B.O/om51ounN2gsa/8Pf9.
firewall--disabled
authconfig--enableshadow--enablemd5
selinux--disabled
timezone--utcAsia/Shanghai
bootloader--location=mbr--driveorder=sda
clearpart--initlabel
part/--fstypeext3--size=1--grow--ondisk=sda
partswap--size=2048--ondisk=sda
%packages
●Rhel5.5x64。
ks文件截图
●
●Vimrhel6.0x86.cfg
text
install
url--urlhttp:
//192.168.10.1/rhel5.5x64/
key49af89414d147589
langen_US.UTF-8
keyboardus
network--deviceeth0--bootprotostatic--ip192.168.10.5--netmask255.255.255.0--gateway192.168.10.254--nameserver219.238.232.231,202.106.0.20--hostnamelocalhost--noipv6
network--deviceeth1--bootprotostatic--ip10.14.22.5--netmask255.255.255.0--nameserver219.238.232.231,202.106.0.20--hostnamelocalhost--noipv6
rootpw--iscrypted$1$UpNsGJfB$B.O/om51ounN2gsa/8Pf9.
firewall--disabled
authconfig--enableshadow--enablemd5
selinux--disabled
timezone--utcAsia/Shanghai
clearpart--initlabel
part/--fstypeext3--size=1--grow--ondisk=sda
partswap--size=2048--ondisk=sda
%packages
●rhel6.0。
ks文件截图
●
◆启动服务
●Servicenfsrestart
●Servicedhcpdrestart
●Servicexinetdrestart
◆REDHAT,CENTOS系统安装截图
◆因rhel6.0ISO是Centos6.0故安装系统是CentOS、在配置文件中、本人没有指定文本模式安装、所有默认是图形化安装
●
●
●
●
●Redhat5.5x64安装截图
●
●
●