In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
I. Overview of PXE:
PXE,Pre-boot-eXcution Environment
Pre-start the execution environment, running before the operating system
It can be used for remote installation and construction of diskless working station.
Server side
Run the DHCP service to assign addresses and locate bootstrappers
Run the TFTP server to provide bootstrap downloads
Client
The network card supports PXE protocol.
The motherboard supports network startup
2. Advantages of PXE:
Scale: 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
Key points of service deployment: 1. DHCP service (automatically assigning IP address to locate boot file) next-server / / pointing to TFTP path filename / / bootstrap file location 2, TFTP service (simple File transfer Protocol) (UDP69 port efficient capacity is small) (bootstrap pxelinnx.0 (syslinux package), compressed kernel vmlinuz, system initialization file initrd.img Startup menu default) 3, FTP (vsftp) File transfer Protocol system Image (centos7) {Security capacity large TCP 20 (data transfer), 21 (connection)} 4, installation package: dhcp, tftp-server, vsftp, syslinux 4, experimental steps:
1. With centos7 as the server, the dual network card mode is established. One network card is NAT connection mode, and the other is host-only connection mode.
2. Execute the "cd / etc/sysconfig/network-scripts/" command to enter the configuration file directory.
3. Execute the "cp-p ifcfg-ens33 ifcfg-ens36" command to copy the configuration file of the ens33 network card as the configuration file of ens36, and execute the "vim ifcfg-ens36" command to edit the configuration file.
4. Modify the configuration file contents of ens36.
5. Use the "yum install dhcp-y" command to install the dhcp service package.
6. After installing the service, use the "cp/ usr/share/doc/dhcp-4.2.5/dhcpd.conf.example / etc/dhcp/dhcpd.conf" command to copy the template file to modify as the dhcp configuration file, and execute the "vim / etc/dhcp/dhcpd.conf" command to edit the configuration file.
7. Write IP address network segment, subnet mask, IP address pool range, gateway (pointing to server IP address), DNS server address, TFTP service path and boot file in the configuration file.
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 114.114.114; next-server 192.168.100.100; filename "pxelinux.0";}
8. Use the "yum install syslinux-y" command to install the boot file package.
9. Use the "rpm-ql syslinux | grep pxelinux.0" command to filter and query file locations.
10. Use the "yum install tftp-server-y" command to install the TFTP package.
Use the "rpm-ql tftp-server" command to query the software package of the service.
12. Use the "cp / usr/share/syslinux/pxelinux.0 / var/lib/tftpboot" command to copy the boot file to the site directory, and execute the "ls / var/lib/tftpboot/" command to view the files in the site.
Use the "vim / etc/xinetd.d/tftp" command to edit the TFTP configuration file.
14. In the configuration file, change "yes" after the "disable" entry to "no" to start the TFTP service.
Use the "yum install vsftpd-y" command to install the ftp service package.
16. Use the "cd / var/ftp" command to enter the site directory and execute the "mkdir centos7" command to create the centos7 directory.
17. Put the image file into the driver side to connect the driver.
Use the "mount / dev/sr0 / var/ftp/centos7/" command to mount the image file directly to the centos7 directory.
19. Enter the centos7/images/pxeboot/ command to see the system initialization file and the compressed kernel file.
Use the "cp initrd.img vmlinuz / var/lib/tftpboot/" command to copy the system initialization file and compress the kernel file to the tftpboot directory.
21. Use the "cd / var/lib/tftpboot/" command to enter the tftpboot directory, and execute the "mkdir pxelinux.cfg" command to create the pxelinux.cfg directory.
22. Use the "cd pxelinux.cfg/" command to enter the directory and execute "vim default" to edit the default startup menu.
23. Write the following in the startup menu.
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
24. Use "systemctl stop firewalld.service" to turn off the firewall; use the "setenforce 0" command to turn off enhanced security features.
25. Use "systemctl start dhcpd" to open the dhcp service; use "systemctl start tftp" to open the tftp service; then use "systemctl start vsftpd" to open the ftp service.
Create a virtual host without a system.
27, when it starts to load, install the Esc key to enter the "Boot Menu" interface and choose to start from the network.
28. Press the enter key when loading to "boot_" to enter the installation boot.
However, PXE deployment does not completely liberate your hands, so let's demonstrate kickstart unattended technology! Kickstart unattended technology:
creates an answer file (ks.cfg) with predefined numbers for various installation settings
eliminates the interactive setup process, thus achieving fully automated installation
completes various configuration operations after installation by adding% post script
The steps of the experiment:
1. Use the "yum install system-config-kickstart-y" command to install the kickstart package.
2. Open the kickstart in the application program in the graphical interface to configure.
3. Select the language and time zone in the basic settings, set the administrator password and restart after installation.
4. The installation method chooses to specify the FTP server address and FTP directory location in the way of FTP.
5. In the bootloader option, select install bootloader. For security, you can also set the GRUB password.
6. Click add in the partition information, create the / boot partition first, and specify the size as 500MB.
7. Create the / home partition and specify the size as 4096MB.
8. Create a swap partition and specify the size as 4096MB.
9. Finally, create / partition and allocate the remaining usage space on the disk to it.
10. In the network settings, enter the network device name "ens33".
11. Select disable SELinux in the firewall configuration, and the security level is disabled by default.
Finally, in the post-installation script, select "use interpreter" and specify the program as "/ bin/bash".
13. After completing the above operation, click the file in the upper left corner to save it.
Save the file to the / var/ftp directory of the file system.
15. Use "ls / var/ftp" to go to the saved file visible in the ftp directory; execute the "cd / root" command to enter the root directory to see the template file named "anaconda-ks.cfg", and execute "vim anaconda-ks.cfg" to edit the file.
16. Copy the package entries in the file.
Use "vim / var/ftp/ks.cfg" to edit the answer file.
18. Paste the previously copied package entry in the answer file.
19. Use the "cd / var/lib/tftpboot/pxelinux.cfg/" command to enter the pxelinux.cfg directory and execute "vim default" to edit the boot menu file.
Append "ks= ftp://192.168.100.100/ks.cfg" content" to specify the path to the answer file.
Create a virtual host without a system.
22. When it starts to load, install the Esc key to enter the "Boot Menu" interface and choose to start from the network.
23. The automatic installation of the combination of PXE and kickstart can be realized.
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.