In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Table of contents:
(1) understand the process of kickstart installation
(2) implementation of network installation system
(3) implementation of unattended installation system
(1) understand the process of kickstart installation
Sometimes it is necessary to install operating systems in bulk within the company. at this time, it is not only time-consuming and inefficient if we install operating systems one by one in the same way as CD-ROM images. For example, if you install 100 machines at the same time, according to the traditional way, you will need to prepare 100 burned CDs and 100 optical drives. The operating system configuration of each machine needs to be configured independently, and it may take several days to work overtime. If we can use batch automation to install the operating system, not only the loss of personnel will be reduced, but also the efficiency will be greatly improved.
Now we will introduce the PXE+Kickstart service program that can realize the unattended installation system, and install and deploy PXE+TFTP+NFS+DHCP+Kickstart and other service programs, so as to build a set of unattended installation system which can install the Linux system in batches.
First of all, we have an application service related to the configuration of the server server, and the client client is the bare metal ready to install the system. Because the network transport implementation configuration is required, the DHCP server needs to be installed on the server side to provide the IP address, subnet mask, gateway and DNS server address required by the client. At the same time, on the client side, we need a bootstrap program pxelinux.0 to boot the kernel vmlinuz and initrd, so that we can see the effect of the system installation interface. On the server side, we need to configure the TFTP server to provide the client with the configuration file of pxelinux.0. After configuring the DHCP server, you also need to indicate the information of next-server in the DHCP server, where next-server points to the path of tftp-server and filename points to the path of pxelinux.0. Because the vmlinuz and initrd used by the client are also downloaded from the server, and it is not clear how the client loads the pxelinux.0 when loading vmlinuz and initrd, the client also downloads the configuration file of pxelinux.cfg from the server to get the configuration parameter information of vmlinuz and initrd. Since the installation of the bare metal operating system requires the installation of a CD image, we also need to install the system for the client by building a shared CD image on our server side, such as NFS, FTP or http services. So far, we have realized the network installation mode which does not need CD-ROM installation of bare metal operating system, and then we can further realize batch automation installation.
(2) implementation of network installation system
(2.1) there are two servers in our environment that are vms001:192.168.26.101,vms002:192.168.26.102. Vms001 provides yum installation warehouse for vms002. We use vms002 as the server side of kickstart unattended installation. Later, we will create a bare metal to complete the experimental effect.
First of all, our server side needs to automatically assign IP address, subnet mask, gateway and DNS server address to bare metal, so we need to build DHCP server on vms002 server side.
Query the template information in example and import it into the / etc/dhcp/dhcpd.conf configuration file.
(2.3) in the dhcpd.conf configuration file, start at the subnet line location and configure as follows.
(2.4) start the DHCP service configured by vms002, and set the boot to start automatically.
(2.5) because the DHCP service of the current vms002 host needs to take effect, the DHCP service that comes with the VMware virtual machine needs to be turned off to prevent conflicts.
After configuring the DHCP service, we begin to configure the TFTP service to provide kernel installation files and pxelinux.0 configuration files for bare metal.
Because the TFTP service is dependent on the xinetd service, it needs to be set up in the xinetd service.
(2.8) then restart the service and set the boot to start automatically.
We set filename to "/ pxelinux.0" in the DHCP server, so we also need to install the relevant software packages on the server.
(2.10) at this point, we need to put two files, vmlinuz and initrd, in the / var/lib/tftpboot/ directory. We can look it up from the CD image.
(2.11) as there may be multiple versions of the system under the / var/lib/tftpboot/ directory at this time, it is necessary to have relevant configuration files to associate different versions, so as to achieve the function that multiple versions of the system can be booted.
(2.12) at the same time, add corresponding permissions to the relevant files copied from the CD to the / var/lib/tftpboot/ directory.
(2.13) then we need to edit the default configuration file in the / var/lib/tftpboot/pxelinux.cfg directory
(2.14) after configuring the default file at this time, the system still needs to provide the mirror content of the CD for the bare metal, so we can build a NFS server to process it.
(2.15) after configuring the NFS server, we need to set it in the default file. At this point, the relevant configuration of the network installation system has been completed.
(2.16) next we create a bare metal and configure the hardware related to the bare metal.
(2.17) since there is no relevant content in boot.msg when booting, the screen is bare after boot, so we install figlet software on the vms002 server.
(2.18) then configure the relevant content information in the boot.msg file and turn on the prompt settings in the default configuration file.
(2.19) at this point, we can use the network boot method to provide the required image files for the bare metal, and enter the interface to start the installation.
(3) implementation of unattended installation system
Above, we have realized that we can provide CD-ROM image files for bare metal through the network to start system installation, but in the process of installing the system, we still need to manually select the relevant configuration of the system step by step for installation operation. it's still tedious and a lot of work. It would be a lot easier if we had an answer file that installed the operating system to do this for us, and here we use kickstart to do it.
First of all, we install the corresponding kickstart software package in the system and start the software.
Then we need to modify the name information of the YUM source of vms002 before we can start the kickstart software normally.
Next, we will make the corresponding settings on the kickstart software according to the general steps of system installation.
Save the ks.cfg file to the root home directory when the configuration is complete.
(3.5) if you do not want to use kickstart graphical software for configuration, you can also use text for configuration. There is an anaconda-ks.cfg template file by default in the root home directory. If you need to configure the operating system installation by text, you can use this file reference.
Now we still use the newly configured ks.cfg answer file for system installation, because we need to allow bare metal to get ks.cfg files, so we set up a FTP server on the vms002 host to share ks.cfg files.
At the same time, we also need to edit the default configuration file in the / var/lib/tftpboot/pxelinux.cfg directory to indicate the address of ks.cfg when installing the system in bare metal.
(3.8) now that all the configurations have been completed, we can implement the process of batch unattended installation of the system.
Note: if the system cannot be installed automatically, you can check whether the directory mounted by the CD image is accessed properly. The timeout parameter in the default file can also be set according to your actual situation.
-this is the end of this article. Thank you for reading-
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.