1. Demand The base has 300 new servers, and needs to install the CentOS7.6 operating system by itself. Choose to use PXE for batch installation. 2. Preparation Use a Layer 2 switch to connect servers that do not have an operating system installed to avoid affecting normal servers on the existing network. Upload the operating system image to the server and install the necessary services for the PXE environment. Mount the image file as a local software repository. Environment Preparation systemctl stop firewalld # Turn off the firewall setenforce 0 # Temporarily set SELINUX to loose mode sed -i '/^SELINUX=/s/.*/SELINUX=disabled/' /etc/selinux/config # Permanently disable SELINUX (requires reboot to take effect) mkdir -p /var/www/html/CentOS1810/ mount /tmp/CentOS-7-x86_64-DVD-1810.iso /var/www/html/CentOS1810 mkdir /etc/yum.repos.d/backup mv /etc/yum.repos.d/{*,backup} # ignore the error message cat >/etc/yum.repos.d/local.repo<<EOF [local_repo] name=local_repo baseurl=file:///var/www/html/CentOS1810 gpgcheck=0 EOF yum clean all && yum makecache yum install httpd dhcp xinetd tftp-server syslinux -y 3. Service Configuration Configure DHCP service Modify the dhcp server configuration file mv /etc/dhcp/dhcpd.conf{,.bak} # Back up the default configuration file cat>/etc/dhcp/dhcpd.conf<<EOF subnet 10.0.0.0 netmask 255.255.255.0 { # Define the allocated network segment and mask range 10.0.0.1 10.0.0.252; # Define the allocated address range next-server 10.0.0.253; # Specify the server IP address of the boot file filename "pxelinux.0"; # Specify the boot file name} EOF systemctl start dhcp systemctl enable dhcp ss -nltup |grep :67 Configure tftp-server Edit /etc/xinetd.d/tftp file sed -i '/disable/s/yes/no/' /etc/xinetd.d/tftp systemctl start xinetd systemctl enable xinetd ss -nltup |grep :69 Copy the relevant files to the default home directory of the tftp service mkdir /var/lib/tftpboot/pxelinux.cfg cp -a {/var/www/html/CentOS1810/isolinux/*,/usr/share/syslinux/pxelinux.0} /var/lib/tftpboot/ # Copy the boot menu and boot loader cp -a /var/www/html/CentOS1810/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default Summarize The above is a detailed tutorial on how to automatically install CentOS7.6 using PXE. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Three examples of nodejs methods to obtain form data
The effect to be achieved In many cases, we will ...
For example: Copy code The code is as follows: <...
binlog is a binary log file, which records all my...
I will be learning MySQL next semester. I didn...
Table of contents 1. Picture above 2. User does n...
For several reasons (including curiosity), I star...
Preface Recently, when using MySQL 6.0.x or highe...
Learned ConcurrentHashMap but don’t know how to a...
Preface: Speaking of sandboxes, our minds may ref...
Preface Merging or splitting by specified charact...
mycli MyCLI is a command line interface for MySQL...
I recently used Dreamweaver to make a product pres...
The transaction log records the operations on the...
var() Introduction and Usage Details (MDN) IE is ...
Effect demo.html <html> <head> <me...