In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
First, the main points of content:
Deploy PXE remote installation service
Set up PXE remote installation server
Verify PXE network installation
Implement unattended installation of kickstart
Prepare to install the answer file
Realize batch automatic installation
2. Batch deployment of servers
Scale: assemble multiple servers at the same time
Automation: install the system and configure various services
Remote implementation: no installation media such as CD, U disk and so on
III. About PXE network
PXE,Pre-boot eXcution Environment
● pre-starts the execution environment, which runs before the operating system
● can be used to remotely install and build diskless workstations.
Server side
● runs the DHCP service, which is used to assign addresses and locate bootstrap programs
● runs the TFTP server to provide bootstrap downloads
Client
● network card supports PXE protocol.
● motherboard supports network startup
4. Configure the PXE server
1. Basic deployment process
● prepares CentOS 7 installation source (YUM repository)
● enables TFTP services and provides kernel and bootstrap programs
● enables the DHCP service to assign addresses and indicate the location of the bootstrap
● configuration Startup menu
2. TFTP services and boot files
● installs ftp-server package and enables tftp service
● prepares kernel file vmlinuz and initializes mirror initrd.img
● prepares the bootstrap file pxelinux.0
[root@localhost ~] # yum-y install tftp-sever [root@localhost ~] # vi / etc/xinetd.d/tftp server_ args =-s / var/lib/tftpboot disable= no [root@localhost ~] # systemctl start tftp [root@localhost ~] # systemctl enable tftp [root@localhost ~] # cd / media/cdrom/images/pxeboot [root@localhost pxeboot] # cp vmlinuz nitrd.img / var/lib / tftpboot [root@localhost ~] # yum-y install syslinux [root@localhost ~] # cp / usr/share/syslinux/pxelinux.0 / var/lib/tftpboot
3. PXE settings of DHCP service
[root@localhost ~] # yum-y install dhcp [root@localhost ~] # vi / etc/dhcp/dhcpd.confsubnet 192.168.100.0 netmask 255.255 255.0 {.option routers 192. 168.100.100 option domain-name-servers 192.168.100.100range 192.168.100.100 192.168.100.200 alternative nextMurphy server 192.168.100.100 alternative filename "pxelinux.0";} [root@localhost ~] # systemctl start dhcpd [root@localhost ~] # systemctl enable dhcpd
4. Default startup menu file
Create / var/lib/tftpboot/pxelinux.cfg/default
[roo@localhost ~] # mkdir / var/lib/tftpboot/pxelinux.cfg [root@localhost-attached vi / var/lib/tftpboot/pxelinux.cfg/defaultdefault autoprompt 1label autokemel vmlinuzappend initrd=initrd.img method= ftp://192.168.100.100/centos7label linux textkernel vmlinuzappend text initrd=initrd.img method= ftp://192..168.100.100/centos7label linux rescuekernel vmlinuzappend rescue initrd=initrd.img method= ftp://192.168.100.100/centos7
5. The experimental steps are as follows
1. Experimental environment: a Linux server is used to install PXE services.
A bare metal without a server installed
2. In order to make the NET service work normally, add a new network card to the server and set it to host-only mode and configure static IP to assign addresses for DHCP.
Add a network card and set it to host-only mode
B. Configure the new network card ifcfg-ens36
[root@localhost ~] # cd / etc/sysconf ig/network-scripts/ arrives under the network card configuration file [root@localhost network scripts] # cp ifcfg-ens33 ifcfg-ens36 copies the configuration file data of ifcfg-ens33 to ifcfg-ens36 [root@localhost network-scripts] # vim ifcfg-ens36 configuration network card data information [root@localhost network-scripts] # systemctl restart network restart network Service [root@localhost network-scripts] # ifconfig to view Nic information
3. Install the DHCP service and edit the configuration file / etc/dhcp/dhcpd.conf
[root@localhost network-scripts] # yum install dhcp- y install the DHCP service [root@localhost network scripts] # cp / usr/share/doc/ dhcp-4.2.5/dhcpd. Conf .example / etc/dhcp/dhcpd. Conf copy the configuration file template to the target configuration file under [root@localhost network scripts] # vim / etc/dhcp/ dhcpd. Conf edits the target configuration file subnet 192. 168.100.0 netmask 255. 255.255.0 {range 192. 168.100.100 192.168.100.200; option routers 192.168.100.100; option domain-name-servers 114.114.11414; next-server 192.168. 100.100; filename "pxe linux.0";}
4. Install the bootstrap file syslinux and check the location of the bootstrap file pxelinux.0
[root@localhost network-scripts] # yum install syslinux-y install syslinux [root@localhost network-scripts] # rpm-ql syslinux | grep pxe linux to view the path of the boot file
5. Install the TFTP service, open the configuration file, and put the bootstrap program into the site
Install the TFTP service and open the configuration file
[root@localhost network-scripts] # yum install tftp-server-y install tftp-server [root@localhost network-scripts] # rpm-ql tftp-server View File location [root@localhost network-scripts] # vim / etc/xinetd.d/tftp Edit / etc/xinetd.d/tftp enable tftp service
B. Copy the boot file pxelinux.0 to the TFTP site in var/lib/tftpboot
[root@localhost network-scripts] # cp / usr/share/syslinux/pxelinux.0 / var/lib/tftpboot/ copy boot file to tftp site [root@localhost network scripts] # cd / var/lib/tftpboot/ switch to site view [root@localhost tftpboot] # ls replication successful pxelinux.0
6. Install the vsftpd service, mount the image file to the new directory centos7, and then copy the file compression kernel and initialization files to the TFTP site
[root@localhost tftpboot] # yum install vsftpd-y install vstfpd service [root@localhost tftpboot] # cd / var/ftp switch to [root@localhost ftp] # mkdir centos7 under the vstfpd configuration file to create a new directory [root@localhost ftp] # mount / dev/sr0 centos7/ mount the image file to the new directory [root@localhost ftp] # cd centos7/ Images/pxeboot/ switch to centos7/images/pxeboot/ [root@localhost pxeboot] # cp initrd.img vmlinuz / var/lib/tftpboot/ copy initialization file and compress kernel to TFTP site [root@localhost pxeboot] # ls / var/lib/tftpboot/
7. Edit the startup menu default configuration file, turn on three services, turn off the firewall, and turn off the enhanced security function.
[root@localhost pxeboot] # cd / var/lib/tftpboot/ switch to tftp site [root@localhost tftpboot] # mkdir pxelinux.cfg create profile directory [root@localhost tftpboot] # ls initrd.img pxelinux.0 pxelinux.cfg vmlinuz [root@localhost tftpboot] # cd pxelinux.cfg/ switch to configuration file [root@localhost pxelinux.cfg] # vim default Edit the configuration file [root@localhost pxelinux.cfg] # systemctl stop firewalld.service turn off the firewall [root@localhost pxelinux.cfg] # setenforce 0 turn off the enhanced security feature [root@localhost pxelinux.cfg] # systemctl start dhcpd start three services [root@localhost pxelinux.cfg] # systemctl start tftp [root@localhost pxelinux.cfg] # systemctl start vsftpd
8. Create and open the logic of the uninstalled system, select the network installation, install the system, and test the experimental results.
Pxe batch installation service deployed successfully!
6. Unattended installation of kickstart
1. Kickstart unattended technology
● creates an answer file and pre-defines various installation settings
● eliminates the interactive setup process, thus achieving fully automated installation
● completes various configuration operations after installation by adding% post script
2. The source of the answer file
● edits an existing answer file in the CentOS 7 system
. / root/anaconda-ks.cfg
● uses the system-config-kickstart tool to create a new answer file
. System-config-kickstart package needs to be installed
3. Experimental steps
Install the kickstart package and open the settings
[root@localhost ~] # yum install system-config-kickstart-y install kickstart package
B. Open the server to set up
Copy the template of the installation package into ks.cfg and boot the loading template in / var/lib/tftproot to make it effective. View ks.conf and copy the packages package template from the local anaconda-ks.cfg to ks.cfg
[root@localhost ~] # cd / var/ftp/ switch to / var/ftp to view the just saved configuration file [root@localhost ftp] # lscentos7 ks.cfg pub [root@localhost pxelinux.cfg] # cd / root switch to local / root [root@localhost ~] # lsanaconda-ks.cfg initial-setup-ks.cfg Public template Video Photo document download Music Desktop [root@localhost ~] # vim anaconda- Ks.cfg copies the installation package module in anaconda-ks.cfg to ks.cfg under / var/ftp/ [root@localhost ~] # vim / var/ftp/ks.cfg to edit ks.cfg
D. Boot load the ks.cfg template into the default configuration file under / var/lib/tftproot/pxelinux.cfg/
[root@localhost ftp] # cd / var/lib/tftpboot/pxelinux.cfg/ switch to default path [root@localhost pxelinux.cfg] # lsdefault [root@localhost pxelinux.cfg] # vim default to edit the configuration file default
E. Turn on the bare metal without the installed system and view the experimental results.
Installation is successful, experiment is successful.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.