In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
This blog will lead you to use PXE for network installation, as well as use kickstart tools for real one-button installation. PXE environment
Known as the pre-boot execution environment, it provides a mechanism to start a computer using a network interface, so that the startup of the computer does not depend on a local data storage device (such as a hard disk) or a locally installed operating system.
The first step in preparing for the lab is to install all the services required for this lab
Enter:
Yum install dhcp-y / / install the DHCP service
Yum install tftp-servsers-y / / install the TFTP service
Yum install vsftpd-y / / install the FTP service
Yum install syslinux-y / / install the bootstrapper
The second step is to add the network card and set the static IP
Note: when using PXE environment for network installation, the whole process needs to be carried out in the local area network!
Set a static IP address for the second block
The steps of the experiment:
1. Enter:
Cp / etc/sysconfig/network-scripts/ifcfg-ens33 / etc/sysconfig/network-scripts/ifcfg-ens36 / / copy the configuration file of the first network card to facilitate subsequent modification
2. Enter: vim / etc/sysconfig/network-scripts/ifcfg-ens36 / / modify the configuration file of the new network card
3. For more information on the configuration process, please see the following example.
4. After the configuration is completed, enter: service network restart / / restart the network service
5. Enter: ifconfig / / to check whether the IP has been changed successfully.
Example:
Above, all the preliminary preparations for this experiment have been completed, and the experimental process will be officially started below! Formal Lab 1. Configure FTP Services
FTP Service:
FTP (General purpose File transfer Protocol) service, which usually stores system images, is more secure than TFTP, has larger storage capacity, but is less efficient than TFTP.
Configuration steps:
After the FTP service has been installed, type: rpm-ql vsftpd to view all the files in the FTP service, where "/ var/ftp" is the site of the FTP service and the storage place of the CD image.
At this time, in order to store the installation CD image, you need to enter: mkdir / var/ftp/centos7 to create an empty folder in the FTP site.
Add a CD image to the virtual machine and type: mount / dev/sr0 / var/ftp/centos7 to mount the CD to the FTP site
This completes the configuration of the FTP service, and then starts configuring the TFTP service.
2. Configure TFTP service
TFTP (simple File transfer Protocol) service, which runs on the UDP69 port, has high speed and high efficiency, but has small storage capacity.
The TFTP site of this experiment will host bootstrap pxelinux.0, compressed kernel vmlinuz, system initialization file initrd.img, and boot menu default.
1. Enable TFTP service
Enter:
Rpm-ql tftp-server
See what the TFTP protocol contains, where "/ etc/xinetd.d/tftp" is the TFTP protocol profile and "/ var/lib/tftpboot" is the site of the TFTP protocol.
Enter:
Vim / etc/xinetd.d/tftp
Go to the configuration file and change "disable" from yes to no
2. Add the bootstrap program pxelinux.0
Enter:
Rpm-ql syslinux | grep pxelinux
Filter from our pre-prepared syslinux package and use the cp command to copy the bootstrap to the "/ var/lib/tftpboot" site
3. Add compressed kernel (vmlinuz) and system initialization file (initrd.img)
The compressed kernel and system initialization files are usually saved in a CD-ROM image, but we have previously mounted the image to the FTP site, so we only need to copy it manually. Enter:
Cp / var/ftp/centos7/images/pxeboot/initrd.img / var/ftp/centos7/images/pxeboot/vmlinuz / var/lib/tftpboot/
Copy two files.
4. Add startup menu (default)
So far, there are three of the top four King Kong in the TFTP site, except for the important startup menu. Unlike the other three, the startup menu is the only one that needs to be configured manually. Enter:
Mkdir / var/lib/tftpboot/pxelinux.cfgvim / var/lib/tftpboot/pxelinux.cfg/default
Among them, "pxelinux.cfg" folder, "default" file, the name must not be typed wrong, once typed wrong, the bootstrap will not be found, resulting in installation system failure.
Add manually in the "default" file as shown below
3. Configure DHCP service
At this point, the PXE environment is more than half complete. Only the DHCP service assigned to the client has not been configured.
Configure DHCP
Enter:
Cp/ usr/share/doc/dhcp-4.2.5/dhcpd.conf.example / etc/dhcp/dhcpd.confvim / etc/dhcp/dhcpd.conf
Overwrite the template to the configuration file and modify it as shown below
At this point, all the settings for the PXE environment have been set up, and all you need to do is turn on the service. 4. Open all services and complete the setup of the whole environment
Enter:
Systemctl start dhcpd / / enable DHCP service
Systemctl start tftp / / enable TFTP service
Systemctl start vsftpd / / enable FTP service
Systemctl stop firewalld.service / / turn off the firewall
Setenforce 0 / / turn off enhanced security features
The above is the complete environment setting of PXE network installation. Although it has made it very convenient to install the system, a great man once said, "laziness is the first driving force for scientific and technological progress." Is there a more convenient way to install the machine?
The answer is, of course, that the next experiment is to install using the kickstart tool.
With regard to the creation of answer files for kickstartkickstart unattended technology, various installation settings are pre-defined to eliminate the interactive setting process, so as to achieve fully automatic installation by adding% post script to complete various configuration operations after installation to achieve kickstart unattended.
Leave the previous PXE environment unchanged, and install the kickstart package on this basis, enter:
Yum install system-config-kickstart-y
After completing the installation, go to the graphical interface of centos7 and click on the application in the upper left corner of the desktop, and select the system tools → kickstart software.
Next is the creation of the template file.
Basic settings
1. The language is set to simplified Chinese
2. The keyboard is an American keyboard
3. The time zone is Asia / Shanghai.
4. Fill in the root password
5. Check the box to install and restart.
Installation method
1. Select FTP for installation method.
2. Enter "ftp://192.168.100.100/"" in the FTP server
3. Enter "centos7" in the FTP directory.
Boot loader option (important! )
1. Check "install new boot loader" for installation type.
Zoning information
1. Use the add button in the layout to add "/ boot", "swap", "/ home" and "/" partitions to the system
Network equipment
1. Click add Network device
2. Enter "ens33"
3. Click OK to add
Use default settings all
The default settings are retained from validation to pre-installation scripts, no need to change
We will add "package selection" later.
Post-installation script
Check the interpreter "--enter" / bin/bash "
Save
Click on the file in the upper left corner and select Save to / var/ftp directory
At this point, we return to the character interface and type:
Cd ~ / / return to the home directory vim anaconda-ks.cfg / / enter the template file
The paragraph in the image above can be used in our ks.cfg file to return to the place where the file was saved:
Cd / var/ftp/vim ks.cfg / / A pair of files are edited
At the end of the file, paste the copied paragraph.
The light carries on the component package addition, does not boot. The installation is still not recognized at startup and still needs to be installed manually = no component package has been added.
So we need to add a boot to the startup menu default file:
Vim / var/lib/tftpboot/pxelinux.cfg/default
Add the guide of the component package after the original content, as shown below:
All the configurations have been completed, the only thing to do is to press enter. The rest is fully automatic, long live technology!
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.