In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article focuses on "how to automate the deployment of Linux systems by PXE". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to automate the deployment of Linux systems by PXE".
Background description
In the data center, dozens or even hundreds of servers go online at a time, the system installation will become very troublesome, the system installation, but also will involve a lot of configuration, the workload is very large. Many virtualization platforms, such as VMware,FusionCompute, are generally installed one by one through ISO, or through vendor tools, which is troublesome.
PXE is Pre-Boot Execution Environment # pre-started execution environment
The technology of booting PXE through network card
1.BISO support
two。 Network card support
3. It needs to be opened in BIOS; the server BMC interface opens
Deploy a server and install DHCP+tftp on the server (DHCP provides dynamic acquisition IP)
The network card DCHP acquires information
In addition to assigning an ip address, DHCP can also provide the name of the bootstrap program and the server address of the tftp
The bootstrap is loaded into memory and booted according to the configuration file
Train of thought:
Configure yum Feed
Turn off the firewall and selinux
Install the dhcp,tftp-server,htppd,syslinux package
Configure dhcp,tftp-server and start the service
Install the system-config-kickstart package and generate a ks unattended script
Configure Boot menu
Configure DHCP
Mount the CD
Mount / dev/cdrom / media
Configure yum Feed
. `vim dvd.repo [development] # define name=centos baseurl= file:///media gpgcheck=0 enabled= 1` to edit the DHCP file (dynamic host configuration protocol) cp/ usr/share/doc/dhcp-4.2.5/dhcpd.conf.example / etc/dhcp/dhcpd.conf # copy template, overwrite the conf file vim / etc/dhcp/dhcpd.conf # global configuration and subconfiguration, choose one of the two Global configuration # option definitions common to all supported networks... 7 option domain-name "example.org"; 8 option domain-name-servers ns1.example.org, ns2.example.org; 9 10 default-lease-time 600; 11 max-lease-time 7200; 12 next-server 192.168.100.10; # specify where the tftpserver is 13 filename "/ pxelinux.0"; # Network bootstrap file # subconfiguration A slightly different configuration for an internal subnet. 47 # subnet configuration 48 subnet 192.168.100.0 netmask 255.255.255.0 {49 range 192.168.100.11 192.168.100.30; # DHCP address pool range 50 option domain-name-servers 192.168.100.2; # DNS address (configurable) 51 option domain-name "example.com"; # domain name address 52 option routers 192.168.100.1 # Gateway address 53 option broadcast-address 192.168.100.255; # broadcast address 54 default-lease-time 600; # how long does the ip obtained during the lease period survive 55 max-lease-time 7200 # if the lease expires, you can still use it. Do not automatically reclaim 56} tftp configuration [root@pxeserver] # vim / etc/xinetd.d/tftp # default: off# description: The tftp server serves files using the trivial file transfer\ # protocol. The tftp protocol is often used to boot diskless\ # workstations, download configuration files to network-aware printers \ # and to start the installation process for some operating systems.service tftp {socket_type = dgram protocol = udp wait = yes user = root server = / usr/sbin/in.tftpd server_args =-s / var/lib/tftpboot Disable = no # # yes modified to no per_source = 11 cps = 100 2 flags = IPv4} syslinux configuration yum provides "* / pxelinux.0" # # find out which package this file belongs to yum install-y syslinux # install syslinuxcp / usr/share/syslinux/pxelinux .0 / var/lib/tftpboot/ # copy the pxelinux.0 file to the tftp root directory mkdir-p / var/lib/tftpboot/pxelinux.cfg # install the default configuration file cp / media/isolinux/isolinux.cfg / var/lib/tftpboot/pxelinux.cfg/default # # boot file cp to the pxeLinux.cfg directory record the cp / media/isolinux/* / var/lib/tftpboot/ # cp placement iso file Default to read (the installation menu will display) there is no system configuration default file menu separator # insert an empty linemenu separator # insert an empty line label linux menu label ^ Install CentOS 7.5 # menu directory kernel vmlinuz # kernel file append initrd=initrd.img ks= http://192.168.100.10/ks/ks.cfg configuration httpdyum install-y httpdsystemctl start httpdsystemctl enable httpdmkdir-p / var/www/html/centoscp-rfv / media/* / var/www/html / centos/ [root@pxe-server ~] # cat / etc/yum.repos.d/dvd.repo [development] # define name=centosbaseurl= http://192.168.100.10/centosgpgcheck=0enabled=1 configuration unattended yum install-y system-config-kickstartsystem-config-kickstart # launch
The ks.cfg file is configured as follows:
At this point, I believe you have a deeper understanding of "how to automate the deployment of Linux systems in PXE". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.