In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to complete the unattended installation service under the Linux system, aiming at this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
Beginners in operation and maintenance are often asked to do some work of installing the operating system, which will be quite inefficient if they install the operating system with a mirror CD. So how to improve the efficiency and build an unattended installation system that can install Linux system in batches?
PXE+TFTP+FTP+DHCP+Kickstart services can build an unattended installation system. This unattended installation system can automatically install systems for dozens of servers, rescuing operation and maintenance personnel from repetitive work, and greatly improving the efficiency of system installation.
PXE (Preboot eXecute Environment, pre-boot execution environment) is a technology developed by Intel, which allows the computer to boot the operating system through the network (provided that the network card installed on the computer supports PXE technology). It is mainly used to guide the client host to install the Linux operating system in the unattended installation system. Kickstart is an unattended installation method. Its working principle is to save the parameters that need to be manually filled in by operation and maintenance personnel into a ks.cfg file in advance, and automatically match the files generated by Kickstart when the parameters need to be filled in during the installation process. So as long as the Kickstart file contains all the parameters that need to be filled in manually during the installation process, then theoretically speaking, the installation work can be completed automatically without the intervention of the operation and maintenance staff.
Of course, you need to use the TFTP protocol to help the client get the boot and driver files. The vsftpd service program is used to transfer the complete system installation image to the client over the network. Of course, as long as you can successfully transfer the system installation image to the client, you can also use httpd instead of the vsftpd server.
First, configure the DHCP service program. The DHCP server is used to assign available IP addresses to the client host, and this is the basis for file transfer between the server and the client host, so we configure the DHCP server first.
[root@linuxprobe linuxprobe] # yum install dhcp
[root@linuxprobe ~] # vim / etc/dhcp/dhcpd.conf
Allow booting
Allow bootp
Ddns-update-style interim
Ignore client-updates
Subnet 192.168.10.0 netmask 255.255.255.0 {
Option subnet-mask 255.255.255.0
Option domain-name-servers 192.168.10.10
Range dynamic-bootp 192.168.10.100 192.168.10.200
Default-lease-time 21600
Max-lease-time 43200
Next-server 192.168.10.10
Filename "pxelinux.0"
}
The purpose of this operation is to allow the BOOTP bootstrap protocol, which aims to enable the host that does not have an operating system in the local area network to obtain the static IP address; the boot driver file pxelinux.0 is loaded at the bottom of the configuration file, the purpose of which is to let the client host actively obtain the boot driver file after obtaining the IP address and enter the next step of the installation process. For a specific explanation, see "this is how Linux should learn".
The second step is to configure the TFTP server.
Vsftpd is a feature-rich file transfer service program that allows users to authenticate access in anonymous open mode, local user mode and virtual user mode. However, the current client host does not have an operating system installed, how to login authentication? As a simple file transfer protocol based on UDP protocol, TFTP can obtain the required file resources without user authentication. So next configure the TFTP service program to provide boot and driver files for the client host. When the client host has the basic driver, the complete CD image file is transferred through the vsftpd service program.
[root@linuxprobe ~] # yum install tftp-server
[root@linuxprobe ~ .d] # vim / etc/xinetd.d/tftp
Service tftp
{
Socket_type = dgram
Protocol = udp
Wait = yes
User = root
Server = / usr/sbin/in.tftpd
Server_args =-s / var/lib/tftpboot
Disable = no
Per_source = 11
Cps = 100 2
Flags = IPv4
}
The third step is to configure the SYSLinux server. SYSLinux is a service program used to provide boot loading. SYSLinux is not so much a service program as the boot file inside. After installing the SYSLinux service package, many boot files will appear in the / usr/share/syslinux directory.
[root@linuxprobe ~] # yum install syslinux
[root@linuxprobe ~] # cd / var/lib/tftpboot
[root@linuxprobe tftpboot] # cp / usr/share/syslinux/pxelinux.0.
[root@linuxprobe tftpboot] # cp / media/cdrom/images/pxeboot/ {vmlinuz,initrd.img}.
[root@linuxprobe tftpboot] # cp / media/cdrom/isolinux/ {vesamenu.c32,boot.msg}.
First of all, you need to copy the boot file provided by SYSLinux to the default directory of the TFTP service program, that is, the file pxelinux.0 mentioned earlier, so that the client host can get the boot file smoothly. In addition, there are some boot files that we need to call in the RHEL 7 system CD image. After confirming that the disc image has been mounted to the / media/cdrom directory, use the copy command to copy some of the boot files that come with the disc image to the default directory of the TFTP service program.
[root@linuxprobe tftpboot] # mkdir pxelinux.cfg
[root@linuxprobe tftpboot] # cp / media/cdrom/isolinux/isolinux.cfg pxelinux.cfg/default
Then create a new pxelinux.cfg directory in the directory of the TFTP service program. Although the name of the directory has a suffix, it is still a directory, not a file! Copy the boot options menu from the system CD to this directory and name it default. This default file is the menu of options at boot time, as shown in the figure.
Step 4, configure the vdftpd service program.
[root@linuxprobe ~] # yum install vsftpd
After confirming that the system CD image has been properly mounted to the / media/cdrom directory, copy all the CD image files in the directory to the working directory of the vsftpd service program.
[root@linuxprobe] # cp-r / media/cdrom/* / var/ftp
Finally, create the KickStart reply file.
After all, what we use PXE + Kickstart to deploy is a set of "unattended installation system service" rather than "unattended transmission system CD mirroring service", so we also need to enable the client host to obtain the CD image while automatically filling in the options that appear during the installation process.
In the root administrator's home directory, there is a file called anacondaks.cfg, which is the answer file. Now copy this file to the working directory of the vsftpd service program (the get path to the file has been defined in the configuration file of the boot options menu, that is, the pub subdirectory in the vsftpd service program data directory). Use the chmod command to set the permissions of the file to ensure that everyone has readable permissions to ensure that the client host can successfully get the answer file and its contents:
[root@linuxprobe ~] # cp ~ / anaconda-ks.cfg / var/ftp/pub/ks.cfg
[root@linuxprobe ~] # chmod + r / var/ftp/pub/ks.cfg
So far, our services have been basically deployed. For more information on the collective explanation process, please see "this is how Linux should learn". It is hoped that this article will be of some help to the new operators.
This is the answer to the question about how to complete the unattended installation service under the Linux system. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
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.