In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
System boot is the beginning of the operation of the operating system. Before the user can log in to the system normally, the boot process of the Linux operating system will complete a series of initialization tasks and load the necessary programs and command terminals to prepare for user login.
1. Preview the boot process
As shown in the figure:
1. Post
After the server host is powered on, the CPU, memory, graphics card, keyboard and other devices will be initially tested according to the settings in the motherboard BIOS. After successful detection, the control of the system will be transferred according to the preset boot sequence, and the local hard disk will be handed over most of the time.
2.MBR boot
When booting the system from the local hard disk, first transfer the system control to the partition containing the operating system boot file according to the setting of the MBR (master boot record) in the first sector of the hard disk, or call the boot menu directly according to the boot information in the MBR record (such as GRUB)
3.GRUB menu
For Linux operating system, GRUB (Unified Boot Loader) is the most widely used multi-system bootstrap program. After system control is passed to GRUB, a boot menu will be displayed for the user to choose, and the Linux kernel file will be loaded according to the selected option (or default), and then system control will be transferred to the kernel. It is important to note that Centos 7 uses the GRUB2 boot loader.
4. Load the Linux kernel
The Linux is a pre-compiled special binary file, which is between various hardware resources and system programs, and is responsible for resource allocation and scheduling. After the kernel takes over the control of the system, it will fully control the running process of the entire Linux operating system. On Centos systems, the default kernel file is "/ boot/vmlinuz-3.10.0-514.el7.x86_64".
5.init process initialization
In order to further boot the system, the Linux kernel first loads the "/ sbin/init" program in the system to run in memory, and the init process completes a series of system initialization processes, and finally waits for the user to log in.
2. System initialization process and file 1.init process
Processes in the Linux operating system are marked with numbers, and the identity number of each process is PID, in the process of booting the Linux operating system. "/ sbin/init" is the first program loaded by the kernel, so the PID number for the init process is always 1.
After the init process runs, other programs in the system will be executed one after another and new processes will be generated continuously. These processes are called child processes of the init process.
The init process is the "ancestor" of all processes that maintain the entire Linux operating system. Therefore, the init process is not allowed to be terminated easily.
Introduction to 2.Systemd
Systemd is a kind of init software of Linux operating system. Centos 7 system uses a brand-new Systemd startup mode to replace the traditional SysVint. Systemd startup mode enables many services to start in parallel during system initialization, which greatly improves the boot efficiency. "/ sbin/init" in the Centos 7 system is a link file for "/ lib/systemd/systemd".
[root@localhost] # ll / sbin/init lrwxrwxrwx. 1 root root 22 July 14 18:54 / sbin/init->.. / lib/systemd/systemd
The systemd daemon is responsible for the systems and services of Linux, and systemctl is used to control the state of the systems and services managed by Systemd.
Systemd organizes the resources it manages into various types of Unit. As shown in the figure:
The SysVint mechanism in the early Linux operating system. By default, there are seven different service collocation methods, each of which is called the running level, which is similar to the normal startup and safe mode in the Windows system. The Linux system is represented by numbers, as shown in the figure:
Third, optimize the startup process
The Linux operating system contains a large number of service planners, and these service programs start or terminate according to the preset state when switching runlevels.
1. Common system services
Whether these services are turned on or off should be decided according to the actual situation.
two。 Optimize the auto-loading service on boot 1) use the ntsysv tool [root@localhost ~] # ntsysv
Services at a specified run level can be managed by using the "--level" option. For example:
[root@localhost ~] # ntsysv-- level 35Universe / adjust for the default state of running various services at levels 3 and 5 2) use the systemctl tool
Common options:
Enable: boot self-boot
Disable: power on and shut down automatically
Is-enable: check boot status
[root@localhost ~] # systemctl list-units-- type=service// views all activated system services in the current system
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.