Вы находитесь на странице: 1из 5

11/14/2016

LinuxAdministration:HowtoInstallCentOSPXEserver

LinuxAdministration
Learningbyexample
Home

AllArticles

LinuxProfessionalInstitutePracticeTest

LinuxInterviewQuestions

AboutMe

HowtoInstallCentOSPXEserver
APXEinstallserverallowsyourclientcomputerstobootandinstallaLinuxdistribution
overthenetwork,withouttheneedofburningLinuxisoimages,orhumaninteraction.
ToinstallaPXEserver,youwillneedthefollowingcomponents:
1.DHCPServer
2.TFTPServer
3.NFS/FTP/HTTPDserver(tostoreinstallingfiles)
Step1Installdhcpserver

[root@server1~]#yuminstalldhcp
LatestArticles

Dhcpd configuration file is located at /etc/dhcpd.conf. You can use /usr/share/doc/dhcp


3.0.5/dhcpd.conf.sampleasasampleconfig,oryoucanusemyconfigbelowasabase,
makesureyouchangethesubnet.

DeployingPrometheusfor
monitoringandstatscollection
DeployingMongoDB

ddnsupdatestyleinterim;
notauthoritative;
optiondomainname"test.org";
optiondomainnameservers208.67.222.222,208.67.220.220;
optionsubnetmask255.255.255.0;
subnet172.20.30.0netmask255.255.255.0{
authoritative;
range172.20.30.10172.20.30.90;
optionrouters172.20.30.254;
allowunknownclients;
allowbooting
allowbootp
nextserver172.20.30.100;
filename"pxelinux.0";
}

DeployingApacheCassandra
DeployingElasticsearchcluster
SimpleContinuousDeployment
SystemwithJenkinsandGithub
DeployingserviceswithMesos,
Marathon,ZookeeperandDocker
MultitenantHARedisonAWS
ContainerIntegrationinsystemd
FunwithLinuxNetwork
Namespaces

Step2Installtftpserver

DeployingApacheKafkaand
ApacheZookeeper

[root@server1~]#yuminstalltftpserver

Blockdeviceencryptionwith
cryptsetupandLUKS

Edit/etc/xinetd.d/tftpandsetdisabletono.

Keepalivedusingunicast,track
andnotifyscripts

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

http://www.linuxadmins.net/2010/09/howtoinstallcentospxeserver.html

DeployingHighlyAvailable
MySQLwithMHAandHAProxy
DeployingHAProxy1.5from
source
Metricsvisualisationand
collectionwithGraphite,Grafana
andpython
DeployingHighlyAvailableNFS
ServerwithDRBDandHeartbeat
onDebian
Injectingkernelmodulesin

1/5

11/14/2016

LinuxAdministration:HowtoInstallCentOSPXEserver
}

initrd.gzfortheDebianInstaller

Step3CreateNetworkInstallsource

CreatinganofficialDebianmirror
withaptmirror
CreatingsecureLXCcontainers
withvirtsandboxservice

We can use three methods to store the installation files on the network and retrieve it
whenbootingtheclientusingPXEnfs,ftporhttp.Ihavechosenftp:

DROPversusREJECTapacket

[root@server1~]#yuminstallvsftpd

DiagnosingHighCPUutilization
andmemoryleaks

Publicaccessibleftpsiteislocatedin/var/ftp.Createinstallationtreeinthisfolder.

[root@server1~]#mkdirp/var/ftp/install/centos/i386/5.2
[root@server1~]#mkdirp/var/ftp/install/debian/i386/4
[root@server1~]#mkdirp/var/ftp/install/ubuntudesktop/i386/8.10
[root@server1~]#mkdirp/var/ftp/install/ubuntuserver/i386/8.10

DeployingOpenVZContainers
ConnectingKVMorLXCtoOpen
vSwitch
ListofAllArticles

Ifyouhavedownloaddvdorcdisofiles,youcanmountthemandcopythefiles:

[root@server1~]#mounttiso9660oloopCentOS5.2i386binDVD.iso/mnt/iso

Once mounted copy the installation files to /var/ftp/install/centos/i386/5.2. do this for


eachLinuxdistributionyouwanttoincludeinyourPXEserver:

[root@server1~]#cpavr/mnt/iso/*/var/ftp/install/centos/i386/5.2

Step4Restartdhcpd,tftpdandvsftpdServices

[root@server1~]#/etc/init.d/dhcpdrestart
[root@server1~]#/etc/init.d/xinetdrestart
[root@server1~]#/etc/init.d/vsftpdrestart

andmaketheservicespersistentacrossreboots:

[root@server1~]#chkconfiglevel345dhcpdon
[root@server1~]#chkconfiglevel345vsftpdon

tftpdserverismanagedbyxinetdwhichisonafterrebootbydefault.
Step5Setuptftpnetworkbootfiles
Create /tftpboot/images/ directory and populate it with the files necessary to start the
installationprogramviaPXE.
1. Copy the /usr/lib/syslinux/pxelinux.0 file installed by the syslinux package into
/tftpboot/

[root@server1tftpboot]#cp/usr/lib/syslinux/pxelinux.0/tftpboot

2. Create /tftpboot/images/ directory tree and copy vmlinuz and inetrd files which are in
thefirstcd/dvdorinstallsouce(/images/pxeboot/vmlinuzand/images/pxeboot/initrd).

[root@server1tftpboot]#mkdirpimages/centos/i386/5.2
[root@server1tftpboot]#cp/var/ftp/install/centos/i386/5.2/images/pxeboot/vmlinuzimages/centos/i386/5.2
[root@server1tftpboot]#cp/var/ftp/install/centos/i386/5.2/images/pxeboot/initrdimages/centos/i386/5.2

Step6CreatePXEMenu
UsethefollowingstepstoconfigurethePXEmenu:
1.Copymenu.c32filefrom/usr/lib/syslinux/menu.c32into/tftpboot

[root@server1~]#cp/usr/lib/syslinux/menu.c32/tftpboot

http://www.linuxadmins.net/2010/09/howtoinstallcentospxeserver.html

2/5

11/14/2016

LinuxAdministration:HowtoInstallCentOSPXEserver
2.Create/tftpboot/pxelinux.cnfdirectory

[root@server1~]#mkdir/tftpboot/pxelinux.cfg

3. Create /tftpboot/pxelinux.cnf/default configuration file. The following is my default file


configuration:

defaultmenu.c32
prompt0
timeout300
MENUTITLEPXEMenu
LABELCentoS5.2i386
MENULABELCentOS5.2i386
KERNELimages/centos/i386/5.2/vmlinuzappendvga=normalinitrd=images/centos/i386/5.2/initrd.imgramdisk_size=32768
method=ftp://172.20.30.100/install/centos/i386/5.2
LABELDebianetchi386
MENULABELDebianetchi386
KERNELimages/debian/i386/4/vmlinuzappendvga=normalinitrd=images/debian/i386/4/initrd.gzramdisk_size=32768
method=ftp://172.20.30.100/install/debian/i386/4
LABELUbuntuServer8.10
MENULABELUbuntuServer8.10
KERNELimages/ubuntuserver/i386/8.10/linuxappendvga=normalinitrd=images/ubuntuserver/i386/8.10/initrd.gzramdisk_size=32768
LABELUbuntuDesktop8.10
MENULABELUbuntuDesktop8.10
KERNELimages/ubuntudesktop/i386/8.10/linuxappendvga=normalinitrd=images/ubuntudesktop/i386/8.10/initrd.gzramdisk_size=32768

tftpserverfilesstructureshouldlooklikethis:

[root@server1~]#tree/tftpboot/
/tftpboot/
|images
||centos
||`i386
||`5.2
|||initrd.img
||`vmlinuz
||debian
||`i386
||`4
|||initrd.gz
||`vmlinuz
||ubuntudesktop
||`i386
||`8.10
|||initrd.gz
||`linux
|`ubuntuserver
|`i386
|`8.10
||initrd.gz
|`linux
|menu.c32
|pxelinux.0
`pxelinux.cfg
|default

FTPfilesstructureshouldlooklikethis:

[root@server1~]#treeL3/var/ftp
/install/
/var/ftp/install/
|centos
|`i386
|`5.2
|debian
|`i386
|`4
|ks
|`ks.cfg

http://www.linuxadmins.net/2010/09/howtoinstallcentospxeserver.html

3/5

11/14/2016

LinuxAdministration:HowtoInstallCentOSPXEserver
|ubuntudesktop
|`i386
|`8.10
`ubuntuserver
`i386
`8.10

AutomatingCenOSinstallationusingkickstart
1.Installkickstart.

[root@server1~]#yuminstallsystemconfigkickstart

2.Createkickstartfile
Create kickstart file and place it on your installation source ftp site. Following is my
kickstartconfigurationfilethathavebeenplacedinftp://172.20.30.100/install/ks/ks.cfg

#platform=x86,AMD64,orIntelEM64T
#Systemauthorizationinformation
authuseshadowenablemd5
#Systembootloaderconfiguration
bootloaderlocation=mbr
#CleartheMasterBootRecord
zerombr
#Partitionclearinginformation
clearpartallinitlabel
#Usegraphicalinstall
graphical
#Firewallconfiguration
firewallenabledssh
#RuntheSetupAgentonfirstboot
firstbootdisable
#Systemkeyboard
keyboarduk
#Systemlanguage
langen_GB
#Installationlogginglevel
logginglevel=info
#Usenetworkinstallation
urlurl=ftp://172.20.30.100/install/centos/i386/5.2
#Networkinformation
networkbootproto=dhcpdevice=eth0onboot=on
#networkbootproto=dhcpdevice=eth1onboot=on
#Rebootafterinstallation
reboot
#Rootpassword
rootpwiscrypted$1$dfadfaaffafarae1
#SELinuxconfiguration
selinuxenforcing
#Systemtimezone
timezoneEurope/London
#InstallOSinsteadofupgrade
install
#XWindowSystemconfigurationinformation
xconfigdefaultdesktop=GNOMEdepth=8resolution=800x600
#Diskpartitioninginformation
partswapbytesperinode=4096fstype="swap"size=1000
part/bytesperinode=4096fstype="ext3"size=4000
%packages
@base

3.Modify/ftpboot/pxelinux.cfg/default
Edit/ftpboot/pxelinux.cfg/defaultfileandaddksparameter.

LABELCentoS5.2i386
MENULABELCentOS5.2i386
KERNELimages/centos/i386/5.2/vmlinuz
appendvga=normalinitrd=images/centos/i386/5.2/initrd.imgramdisk_size=32768
ks=ftp://172.20.30.100/install/ks/ks.cfg

http://www.linuxadmins.net/2010/09/howtoinstallcentospxeserver.html

4/5

11/14/2016

LinuxAdministration:HowtoInstallCentOSPXEserver

Recommend this on Google

1comment:
software November29,2011at7:18PM
IwanttoinstallCentOSPXEServer,thanksalreadytoguidehowtoinstall.
Reply

Enteryourcomment...

Commentas:

Publish

Unknown(Google)

Signout

Notifyme

Preview

Linkstothispost
CreateaLink
NewerPost

Home

OlderPost

Subscribeto:PostComments(Atom)

www.linuxadmins.net.Simpletemplate.PoweredbyBlogger.

http://www.linuxadmins.net/2010/09/howtoinstallcentospxeserver.html

5/5

Вам также может понравиться