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--
Basic overview--
PXE is a network boot technology developed by Inter, which works in Client/Server mode and allows clients to download boot images from remote servers over the network and load installation files or the entire operating system.
-install the services required for bulk installation of PXE-
DHCP+TFTP+DHTP
-Files required to install PXE-
Bootstrap pxelinux.0
Compress kernel vmlinuz
System initialization file initrd.img
Launch menu default
DHCP: automatically assigns IP addresses and locates boot files.
TFTP: stores the boot file of the installation system and loads quickly (because the boot file is small and requires efficient operation)
FTP: store system files with large capacity (TCP protocol, system files need secure and stable transfer)
System environment
CentOS7 as a server: running DHCP services to assign addresses, locate bootstrap programs, run TFTP servers, and provide bootstrap downloads
CentOS7 as a client: the network card supports PXE protocol, and the motherboard supports network startup
Actual operation
1. First deploy the PXE server, knowing that PXE is used in the LAN environment, but because we need to install the software packages required for the service (you can also create a private YUM repository), you need to add a network card to set up the host mode only, so that you can not only install the required software packages, but also boot the service in the LAN.
1. First, we configure the newly added network card, copy a copy of the ens33 network profile template into ens36, then type "vim ifcfg-ens36" to enter the ens36 network configuration file, configure ens36 as static IP, press "/" to enter dhcp, hit enter, press "dw" to delete to "static", change all "ens33" in the configuration file to "ens36", and press "dd" to delete UUID=c9fb678c-82b2-44b7-93ee-ab6d56e066cb. Then configure the gateway address as 192.168.100.1, press "wq" to save and exit, so that the network of ens36 is configured, and then restart to make it take effect.
[root@localhost ~] # cd / etc/sysconfig/network-scripts/ [root@localhost network-scripts] # cp-p ifcfg-ens33 ifcfg-ens36 [root@localhost network-scripts] # vim ifcfg-ens36 [root@localhost network-scripts] # service network restart
2. Use the "ifconfig" command to check whether the modified ens36IP address and MAC address are valid.
[root@localhost network-scripts] # ifconfig
3. After the configuration of the dual network card is finished, we will begin to install the service. First install the DHCP service and type "yum intsall dhpd-y" to start the installation of the DHCP service.
[root@localhost network-scripts] # yum install dhcp-y
4. The following is the process of configuring DHCP. Type "cp- p / usr/share/doc/dhcp-4.2.5/dhcpd.conf.example / etc/dhcp/dhcpd.conf" to copy a template into the DHCP configuration file, and type "yes" to confirm the overwrite.
[root@localhost network-scripts] # cp- p/ usr/share/doc/dhcp-4.2.5/dhcpd.conf.example / etc/dhcp/dhcpd.conf
5. After the template has been copied, go to the configuration file of DHCP to modify it.
Detailed steps
[root@localhost network-scripts] # vim / etc/dhcp/dhcpd.conf subnet 192.168.100.0 netmask 255.255.255.0 {range 192.168.100.20 192.168.100.30; option routers 192.168.100.100; option domain-name-servers 10.10.10.10; filename "pxelinux.0";}
Subnet 192.168.100.0 netmask 255.255.255.0 (the network segment is set to 192.168.100.0 and the MAC address remains unchanged)
Range 192.168.100.20 192.168.100.30; (configure the address range assigned to the client by the DHCP service)
Option routers 192.168.100.100; (gateway is set to point to local)
Option domain-name-servers 10.10.10.10; (assign DNS address)
Net-server 192.168.100.100; (points to TFTP server)
Filename "pxelinux.0"; (point to the boot file location)
6. After configuring the DHCP configuration file, you can install the bootstrap file.
[root@localhost network-scripts] # yum install syslinux-y
7. After installation, you can type "[root@localhost network-scripts] # rpm-ql syslinux | grep pxelinux.0" to see the path location of the file, but we should put it in TFTP, because we pointed to the TFTP path "pxelinux.0" in the configuration file just now.
8. To install the tftp service we need to use, type [root@localhost network-scripts] # yum install tftp-server-y "
[root@localhost network-scripts] # yum install tftp-server-y
9. After the tftp service is secured, we need to know its configuration file and site. Enter "[root@localhost ~] # rpm-ql tftp-server", where "/ etc/xinetd.d/tftp" is the configuration file of the tftp service and "/ var/lib/tftpboot" is the site of the tftp service.
[root@localhost ~] # rpm-ql tftp-server
10. Now put the bootstrapper "pxelinux.0" into the tftp service site
[root@localhost ~] # cp / usr/share/syslinux/pxelinux.0 / var/lib/tftpboot/
11. Enter the configuration file to modify enable to start the tftp service, enter "vim / etc/xinetd.d/tftp", and change the "yes" in the line "enable" in the configuration file to "no".
[root@localhost ~] # vim / etc/xinetd.d/tftp
12. Install the ftp service using the image file inside, and enter "yum install vsftpd-y"
[root@localhost ~] # yum install vsftpd-y
13. Go to the ftp site and create the folder "centos7" as the mount directory. You can choose to copy to "centos7" or mount it directly. Here, you need to connect the image files in the virtual machine before you can mount them.
[root@localhost ~] # cd / var/ftp/ [root@localhost ftp] # mkdir centos7 [root@localhost ftp] # mount / dev/sr0 / var/ftp/centos7
14. Put initialization files and compressed kernel files into "/ var/libtftpboot/ (tftp service station site)."
[root@localhost pxeboot] # cp initrd.img vmlinuz / var/lib/tftpboot/
15. You can see that the startup menu in the tftp service site is configured. The next step is to configure the startup menu and go to "tftpboot" to create a "pxelinux.cfg" directory (the name of this directory must not be wrong).
[root@localhost tftpboot] # mkdir pxelinux.cfg
16. Enter pxelinux.cfg and manually edit the startup menu "default". After editing, "wq" saves and exits.
Detailed configuration
Default autoprompt 1label auto kernel vmlinuz append initrd=initrd.img method= ftp://192.168.100.100/centos7label linux text kernel vmlinuz append text initrd=initrd.img method= ftp://192.168.100.100/centos7label linux rescue kernel vmlinuz append rescue initrd=initrd.img method= ftp://192.168.100.100/centos7
17. After all the files are configured, the last step is left. Turn off the firewall, enhance the security features, and then start all services.
[root@localhost pxelinux.cfg] # systemctl stop firewalld.service (turn off firewall) [root@localhost pxelinux.cfg] # setenforce 0 (disable enhanced security) [root@localhost pxelinux.cfg] # systemctl start dhcpd (start dhcp service) [root@localhost pxelinux.cfg] # systemctl start tftp (start tftp service) [root@localhost pxelinux.cfg] # systemctl start vsftpd (start ftp service)
-unmanned installation service-
1. To realize the installation process without manual operation, we need to install "kickstart" here.
[root@localhost ~] # yum install system-config-kickstart-y
2. After installation, we enter the virtual machine, click on the application and see "Kiskstart" in the system tool, and use it to create a template file.
3. Click to enter to configure the "Kiskstart" program.
Basic configuration
Default language: Chinese (simplified)
Keyboard: U.S.English
Time zone: Asia/Shanghai
Root password:
Check the box to restart after installation
Installation method
Installation method: perform a new installation
Installation method: FTP
Zoning information
Click add
/ boot:500M
/ home:4096M
Swap:4096M
/: use all unallocated space on disk
Network Settin
Click to add a network device
Firewall Settin
Post-installation script
The basic configuration has been satisfied, click the file save in the upper left corner and save the file in the file system "/ var/ftp/"
4. After "Kiskstart" is configured, we need to copy the host installation package in "anaconda-ks.cfg" in the "root" directory to "ks.cfg" as a template. If you do not copy it, the selected components will fail.
[root@localhost ftp] # vim anaconda-ks.cfg [root@localhost ftp] # vim ks.cfg
5. Enter "/ var/lib/tftpboot/" first, and then go to "/ pxelinux.cfg" to see "default", and edit "default" to add the path to the kickstart configuration file in automatic mode.
[root@localhost ~] # cd / var/lib/tftpboot/ [root@localhost tftpboot] # cd pxelinux.cfg/ [root@localhost pxelinux.cfg] # vim default
6. Finally, we create a new virtual machine, choose to install the operating system later during installation, then select host-only mode, and click run Virtual Machine to see the automatic installation of CentOS7.
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.