CN114115920A - Operating system deployment method, system, device and computer-readable storage medium - Google Patents

Operating system deployment method, system, device and computer-readable storage medium Download PDF

Info

Publication number
CN114115920A
CN114115920A CN202111463864.3A CN202111463864A CN114115920A CN 114115920 A CN114115920 A CN 114115920A CN 202111463864 A CN202111463864 A CN 202111463864A CN 114115920 A CN114115920 A CN 114115920A
Authority
CN
China
Prior art keywords
deployment
operating system
token
request
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111463864.3A
Other languages
Chinese (zh)
Inventor
魏江鑫
饶俊明
郑晓腾
杨耿丹
陈扬东
刘生庆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202111463864.3A priority Critical patent/CN114115920A/en
Publication of CN114115920A publication Critical patent/CN114115920A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to the technical field of financial technology (Fintech). The invention discloses a method, a system, equipment and a medium for deploying an operating system.A boot tool is installed before a server generates a mirror image packet of a target operating system, unnecessary files are removed and then the mirror image packet is generated by packaging and sent to a client, so that the size of the mirror image file is effectively reduced, the client can thoroughly get rid of a source installation mode when the target operating system is deployed, the target operating system deployment is completed in a mirror image cloning mode by means of the boot tool, compared with the prior art, the number of restart times in the deployment process can be shortened, the time for occupying DHCP IP resources is reduced, and the deployment efficiency of the whole machine is improved; whether the system deployment request of each client passes or not is confirmed through a token bucket algorithm capable of dynamically recording the time interval generated by the token, a flexible and configurable queuing current limiting function is realized, and the operating system batch deployment tasks of a plurality of clients can be efficiently completed under the condition that an IP pool is limited.

Description

Operating system deployment method, system, device and computer-readable storage medium
Technical Field
The present invention relates to the field of financial technology (Fintech), and in particular, to a method, system, device, and computer storage medium for deploying an operating system.
Background
With the development of computer technology, more and more technologies (big data, distributed, Blockchain, artificial intelligence, and the like) are applied to the financial field, and the traditional financial industry is gradually changing to financial technology (Fintech), but higher requirements are also put forward on the cloud computing technology due to the requirements of security and real-time performance of the financial industry. At present, an ARM server automatically deploys an operating system generally starts by using a PXE (preboot execution environment), and in combination with some other services and configurations, installation and deployment of the operating system can be completed without human intervention.
For a web server, when allocating an IP to an ARM (Advanced RISC Machine, low power consumption and low cost processor using a reduced instruction set) client server that needs to deploy an operating system, each group of TORs has a limited disposable IP pool of a dynamic host configuration protocol, and when there is a deployment demand for the operating system for a large number of ARM servers at the same time, a queuing and current limiting situation occurs, which affects the deployment efficiency of the servers. In an actual application scenario, the data center has many TORs corresponding to the TORs, each group of token buckets is set with a timer, and deployment efficiency may be affected in a high concurrency scenario.
For the ARM client itself, after the IP is allocated, an operating system is usually deployed locally in a ks + ISO manner, and since a source ISO file contains all contents, which is usually large, the file transmission speed is slow, which results in a long IP resource occupation time of a dynamic host configuration protocol DHCP, even if a mainstream P2V (migration of a physical machine to a virtual machine) migration principle is adopted, since the image file only supports a Boot manner of MBR (Master Boot Record), the image file must contain a root partition and MBR. Therefore, when the system disk of the target operating system usually needs to be copied in the whole disk, it is still not beneficial to compress the size of the image file, and further the deployment efficiency of the whole machine is affected.
All the situations reflect that the existing deployment efficiency of operating system deployment modes for large-scale ARM servers is low.
Disclosure of Invention
The invention mainly aims to provide a method, a system, equipment, a computer storage medium and a computer program product for deploying an operating system, and aims to solve the technical problem of low deployment efficiency of the existing operating system deployment mode for large-scale ARM servers.
In order to achieve the above object, the present invention provides an operating system deployment method, which is applied to a web server, and the method includes:
installing a preset starting guide tool in a target operating system, and acquiring a system key file of the target operating system;
removing unnecessary files in the system key files, and compressing and packaging the system key files except the unnecessary files to obtain a system mirror image package;
when a system deployment request sent by an ARM client is received, confirming that the request passes through based on a preset token bucket algorithm, wherein the token bucket algorithm dynamically records a time interval of token generation;
and sending the system image package to the client so that the client can complete the deployment of the target operating system according to the deployment mode of image cloning and based on the boot starting tool.
Optionally, when receiving a system deployment request sent by an ARM client, the step of confirming that the request passes through based on a preset token bucket algorithm includes:
upon receiving a system deployment request sent by the client, querying a remaining token number stored in a remote dictionary service (Redis) database based on the token bucket algorithm, wherein the Redis database stores the remaining token number and a next token generation time of a token bucket group;
judging whether the number of the remaining tokens meets a preset number condition;
if so, passing the request and consuming a specified number of tokens;
and updating the residual token number stored in the Redis database to the residual token number after the request is consumed, and updating the next token generation time according to the current time and the preset token production rate.
Optionally, after the step of determining whether the number of remaining tokens meets a preset number condition, the method further includes:
if not, suspending the request, and inquiring the next token generation time stored in the Redis database;
judging whether the current time is greater than the next token generation time;
if so, passing the request and consuming a specified number of tokens;
updating the next token generation time in the Redis database according to the current time and the token production rate.
Optionally, after the step of determining whether the current time is greater than the next token generation time, the method further includes:
if not, suspending the request until the current time is larger than the next token generation time, executing the step of passing the request, and updating the next token generation time in the Redis database according to the token production rate.
Optionally, the step of excluding unnecessary files in the system key files, and performing compression and packaging on the system key files except the unnecessary files to obtain a system image package includes:
and eliminating unnecessary files in the system key files by using a specified eliminating command, and compressing and packaging the system key files except the unnecessary files into the system image package by using a preset system command tool.
In order to achieve the above object, the present invention further provides an operating system deployment method, where the method is applied to an ARM client, and the method includes:
after entering a pre-boot execution environment PXE, sending a system deployment request to a web server, wherein the server dynamically records a time interval of token generation based on a preset token bucket algorithm;
receiving a system image package of a target operating system fed back by the server after the server passes the request, wherein a boot tool is preinstalled and started by the target operating system, and the system image package is obtained by compressing and packaging system key files only containing necessary files;
decompressing and copying the system image package to a specified file system partition, and executing a deployment process on the decompressed system image package by using the boot tool obtained after decompression so as to complete the deployment of the target operating system.
Optionally, the step of decompressing and copying the system image package to a designated file system partition, and executing a deployment process on the decompressed system image package by using the boot tool obtained after decompression to complete the deployment of the target operating system includes:
decompressing the system image packet to a specified file directory corresponding to the specified file system partition, and copying the decompressed system image packet to the specified file system partition;
binding the system configuration file of the target operating system with the current environment, and installing a system boot program by using the boot tool obtained after decompression, wherein the system configuration file and the system image package are obtained together;
executing the system boot loader to create a boot configuration file for the target operating system;
and after the start configuration file is created, executing restart operation to enter a system, and finishing the deployment of the target operating system.
Optionally, before the step of sending the system deployment request to the web server, the method further includes:
under the PXE environment, creating a disk partition for a first disk sda;
and formatting the disk partition and mounting a file system, wherein the disk partition with the file system mounted is used as the specified file system partition.
In addition, to achieve the above object, the present invention further provides an operating system deployment system, where the system includes an ARM client and a web server, and the system is configured to:
the method comprises the steps that after a preset starting guide tool is installed in a target operating system, a server side obtains a system key file of the target operating system;
the server side excludes unnecessary files in the system key files, and compresses and packs the system key files except the unnecessary files to obtain a system mirror image package;
the client sends a system deployment request to the server after entering a pre-boot execution environment PXE;
when the server side receives the request, the server side confirms that the request passes through based on a preset token bucket algorithm, wherein the token bucket algorithm dynamically records the time interval of token generation;
the server side sends the system mirror image packet to the client side;
and the client receives the system image package, decompresses and copies the system image package to a specified file system partition, and executes a deployment process on the decompressed system image package by using the boot tool obtained after decompression so as to complete the deployment of the target operating system.
In addition, to achieve the above object, the present invention further provides an operating system deployment apparatus, including: a memory, a processor, and an operating system deployment program stored on the memory and executable on the processor, the operating system deployment program when executed by the processor implementing the steps of the operating system deployment method as described above.
In addition, to achieve the above object, the present invention further provides a computer readable storage medium, on which an operating system deployment program is stored, which, when executed by a processor, implements the steps of the operating system deployment method as described above.
Furthermore, to achieve the above object, the present invention also provides a computer program product comprising a computer program which, when being executed by a processor, realizes the steps of the operating system deployment method as described above.
For the ARM client, a boot starting tool is installed before a mirror image package of a target operating system is generated at a server, so that a condition is provided for getting rid of a source installation mode of the client; the method has the advantages that the size of the mirror image file is effectively reduced by removing unnecessary files and then packaging the unnecessary files to generate a mirror image packet to be sent to the client, so that large files do not need to be transmitted in the mirror image cloning process, the target operating system can be more quickly deployed by means of the starting guide tool and the mirror image cloning mode when the subsequent client deploys a local system, the source generation installation mode and the limited MBR guide mode of the client can be thoroughly eliminated, and the time for occupying DHCP IP resources is reduced compared with the source generation installation mode, so that the deployment efficiency of the whole machine is improved;
for a web server, the invention confirms whether to pass through the system deployment request of each client through a token bucket algorithm which can dynamically record the time interval generated by the token, and can realize the flexible and configurable queuing current-limiting function without a timer, so that the batch deployment task of the operating systems of a plurality of clients can be efficiently completed under the condition of limited IP pool;
in conclusion, the invention solves the technical problem of low deployment efficiency of operating system deployment modes of large-scale ARM servers.
Drawings
FIG. 1 is a schematic diagram of an apparatus architecture of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first exemplary method of deploying an operating system according to the present invention;
FIG. 3 is a flow chart of a token bucket algorithm in a first embodiment of a method for deploying an operating system according to the present invention;
FIG. 4 is a diagram illustrating a distributed architecture according to a second embodiment of the operating system deployment method of the present invention;
FIG. 5 is a flowchart illustrating a third exemplary method for deploying an operating system according to the present invention;
FIG. 6 is a functional block diagram of an operating system deployment device (installed on a web server) according to the present invention;
fig. 7 is a schematic diagram of functional modules of the os deployment apparatus (disposed on the ARM client) according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
At present, the technical scheme for automatically deploying the operating system by the ARM server generally adopts a network card PXE (preboot execution environment) to start, and in combination with some other services and configurations, installation and deployment of the operating system can be completed without human intervention. IT architecture in the financial industry is usually based on stability, and therefore, in a network architecture, a group of TORs (Top of Rack, a data center wiring manner) is usually adopted to correspond to an independent small network segment to achieve the purpose of reducing the fault influence range.
For a web server, when allocating an IP to an ARM (Advanced RISC Machine, low power consumption and low cost processor using a reduced instruction set) client server that needs to deploy an operating system, each group of TORs has a limited disposable IP pool of a dynamic host configuration protocol, and when there is a deployment demand for the operating system for a large number of ARM servers at the same time, a queuing and current limiting situation occurs, which affects the deployment efficiency of the servers. In an actual application scenario, the data center has many TORs corresponding to the TORs, each group of token buckets is set with a timer, and deployment efficiency may be affected in a high concurrency scenario.
For the ARM client itself, after the IP is allocated, an operating system is usually deployed locally in a ks + ISO manner, and since a source ISO file contains all contents, which is usually large, the file transmission speed is slow, which results in a long IP resource occupation time of a dynamic host configuration protocol DHCP, even if a mainstream P2V (migration of a physical machine to a virtual machine) migration principle is adopted, since the image file only supports a Boot manner of MBR (Master Boot Record), the image file must contain a root partition and MBR. Therefore, when the system disk of the target operating system usually needs to be copied in the whole disk, it is still not beneficial to compress the size of the image file, and further the deployment efficiency of the whole machine is affected.
All the situations reflect that the existing deployment efficiency of operating system deployment modes for large-scale ARM servers is low.
In order to solve the above problems, the present invention provides a method for deploying an operating system, that is, for an ARM client, the method provides conditions for getting rid of the source installation mode of the client by installing a boot tool before a server generates a mirror package of a target operating system; the method has the advantages that the size of the mirror image file is effectively reduced by removing unnecessary files and then packaging the unnecessary files to generate a mirror image packet to be sent to the client, so that large files do not need to be transmitted in the mirror image cloning process, the target operating system can be more quickly deployed by means of the starting guide tool and the mirror image cloning mode when the subsequent client deploys a local system, the source generation installation mode and the limited MBR guide mode of the client can be thoroughly eliminated, the time for occupying DHCP IP resources is reduced compared with the source generation installation mode, and the deployment efficiency of the whole machine is improved; for a web server, the invention confirms whether to pass through the system deployment request of each client through a token bucket algorithm which can dynamically record the time interval generated by the token, and can realize the flexible and configurable queuing current-limiting function without a timer, so that the batch deployment task of the operating systems of a plurality of clients can be efficiently completed under the condition of limited IP pool; in conclusion, the invention solves the technical problem of low deployment efficiency of operating system deployment modes of large-scale ARM servers.
As shown in fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the operating system deployment system may include: a processor 1001, such as a CPU, a user interface 1003, a network interface 1004, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the apparatus shown in fig. 1 is not intended to be limiting of the apparatus and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and an operating system deployment program.
In the device shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (programmer's end) and performing data communication with the client; and processor 1001 may be configured to call an operating system deployment program stored in memory 1005 and perform the operations of the operating system deployment method described below.
Based on the above hardware structure, an embodiment of the operating system deployment method of the present invention is provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of the method for deploying an operating system according to the present invention, where the method is applied to a web server, and the method includes:
step S10, after installing a preset boot tool in a target operating system, acquiring a system key file of the target operating system;
step S20, excluding unnecessary files in the system key files, and compressing and packaging the system key files except the unnecessary files to obtain a system mirror image package;
in the embodiment, the method is applied to the web server. The start-up guidance tool includes grub2-efi tools. The target operating system (target OS) refers to an operating system that an ARM client requests to deploy. The system key file refers to a key file of the target operating system. Unnecessary files may be pre-specified by the relevant personnel.
It should be noted that, the existing mainstream P2V (physical machine migration to virtual machine) migration principle relates to packed migration of a system, and a simple system image installation process thereof is as follows:
firstly, verifying that the position and the authority of a system key file of a target OS are correct and can be read and written normally;
second, a system command tool dd is used to make a partition copy of the system disk sda, and an image file is exported, such as:
ddif=/dev/sdaof=/mnt/kylin_os.imagebs=1Kcount=$count
the number of partitions to be copied is represented by the number of the $ count, or full disk copying may be selected, the system command tool fdisk may be used to check specific partition information of the system disk sda, the derived mirror image at least needs to include a root partition and an MBR, and a lack of the MBR may cause the system to be unable to be started normally;
thirdly, the client deploys a slave network card to start to enter the PXE environment for the first time;
fourthly, in the PXE environment, the client downloads the image file from the server, such as: image;
fifthly, in the PXE environment, the client reads the content of the image file through a system command tool dd and restores the content of the image file to the sda disk;
and sixthly, the client rebot is restarted to enter a new system, and the whole deployment process is completed.
The present invention considers that the partition copy is performed by using the system command tool dd, and only supports the boot mode of the MBR, and the image file must include the root partition and the MBR. Therefore, when the first hard disk sda of the target OS has no specific partition, the entire disk copy is usually required, which is not favorable for compressing the size of the image file, and only supports the boot mode of the MBR, which is poor in flexibility. A boot toolkit based on a mainstream Extensible Firmware Interface (EFI) mode is installed in a target OS through a server, all system key files of the target OS are obtained, unnecessary files in the system key files are eliminated, then the rest files are compressed and packaged, and the packaged file package is used as a system image package of the target OS. When the ARM client needs to deploy the target OS, the tool can be used for booting in a mainstream EFI mode, and a traditional MBR boot mode is not relied on; and only necessary directories are compressed and packed, so that the size of the mirror image file is effectively reduced.
In addition, before step S10, the server may check whether the key file location and the authority of the target operating system are correct, and may read and write normally, if yes, step S10 is performed; if not, generating and outputting corresponding error notification information.
Step S30, when a system deployment request sent by an ARM client is received, the request is confirmed to pass through based on a preset token bucket algorithm, wherein the token bucket algorithm dynamically records the time interval of token generation;
in the present embodiment, for the token bucket algorithm, as shown in fig. 3. Assuming that there are 10 IP pools for which TOR1 is available to be dominated by DHCP, the upper token limit b of token BUCKET group BUCKET1 is set to 10. Assuming that the DHCP sets an IP lease time of 1800s (which depends on the time required for a single server deployment), the token generation speed r is 1/1800toekn/s, and the time interval t for token generation waiting is 1800 s. When the TOR1 has n servers requesting deployment at the same time, when n < ═ BUCKET1 has the remaining number of tokens, directly entering deployment and deleting n tokens; when n > BUCKET1 has the remaining token number, the exceeding part is in a token generation waiting token wait state, and the others enter deployment; the server in token wait state keeps trying at a time interval t until deployment is entered.
Because the data center has a plurality of TORs corresponding to the TORs, and each group of token buckets is provided with a timer, the performance of the system may be reduced in a high-concurrency scene; the token is put at a certain token production speed and works by depending on the timer, so that the dependence on the time timer is further increased; in addition, under a distributed architecture, consistency is kept among multiple nodes, higher requirements are placed on time accuracy, and program logic is prone to defects due to time errors. Therefore, the embodiment improves the original token bucket algorithm, cancels the setting of the timer, and dynamically records the next token generation time of each group of token buckets, thereby realizing the flexible and configurable queuing current-limiting function, reasonably utilizing the limited resources and realizing the batch concurrent deployment.
Step S40, sending the system image package to the client, so that the client completes the deployment of the target operating system according to the deployment manner of image clone and based on the boot tool.
In this embodiment, the server sends the system image package and other required files to the client, and after acquiring the image package of the target OS, the client decompresses and copies the image package to the designated file system partition, and then executes a subsequent installation process by using a boot startup tool grub2-efi preinstalled in the image package, so as to complete the target OS deployment on the client.
The embodiment provides an operating system deployment method. For the ARM client, a boot starting tool is installed before a mirror image package of a target operating system is generated at a server, so that a condition is provided for getting rid of a source installation mode of the client; the method has the advantages that the size of the mirror image file is effectively reduced by removing unnecessary files and then packaging the unnecessary files to generate a mirror image packet to be sent to the client, so that the larger files do not need to be transmitted in the mirror image cloning process, the subsequent client can complete the deployment of the target operating system more quickly by means of the starting guide tool and according to the mirror image cloning mode when deploying the local system, the source generation installation mode and the limited MBR guide mode of the client can be thoroughly eliminated, the restarting times in the deployment process can be shortened compared with the source generation installation mode, and the time for occupying DHCP IP resources is reduced, so that the deployment efficiency of the whole machine is improved; for a web server, the invention confirms whether to pass through the system deployment request of each client through a token bucket algorithm which can dynamically record the time interval generated by the token, and can realize the flexible and configurable queuing current-limiting function without a timer, so that the batch deployment task of the operating systems of a plurality of clients can be efficiently completed under the condition of limited IP pool; in conclusion, the invention solves the technical problem of low deployment efficiency of operating system deployment modes of large-scale ARM servers.
Further, a second embodiment of the operating system deployment method of the present invention is proposed based on the first embodiment shown in fig. 2. In the present embodiment, step S30 includes:
step S31, when a system deployment request sent by the client is received, querying the residual token number stored in a Redis database of remote dictionary service based on the token bucket algorithm, wherein the Redis database stores the residual token number of the token bucket group and the next token generation time;
step S32, judging whether the number of the remaining tokens meets a preset number condition;
step S33, if yes, passing the request and consuming a specified number of tokens;
and step S34, updating the residual token number stored in the Redis database to the residual token number after the request is consumed, and updating the next token generation time according to the current time and the preset token production rate.
In this embodiment, the server instead uses the redis database record to dynamically record the next token generation time for each group of token buckets. The preset number condition may be that the number of remaining tokens is greater than or equal to a preset number of tokens. The designated number can be flexibly set according to actual conditions.
As an embodiment, a schematic diagram of a distributed architecture is shown in fig. 4. The method comprises the steps that a request sent by a PC end is transmitted to a server end comprising a plurality of service servers through a load balancing strategy, and the server end centrally stores the residual token quantity of each token bucket group and the next token generation time through a Redis database. For example:
Key Value
TOKEN_BUCKET1_NEXT_AVAILABLE_TIME 2021-9-15 10:22:30
TOKEN_BUCKET2_NEXT_AVAILABLE_TIME 2021-9-15 10:32:30
TOKEN_BUCKET1_COUNT 10
TOKEN_BUCKET2_COUNT 8
the server first queries the number of TOKENs TOKEN _ TOKEN 1_ COUNT remaining in the first TOKEN BUCKET group TOKEN 1 when receiving the request:
if TOKEN _ TOKEN 1_ COUNT >1, the request passes, consuming one TOKEN, -the number of remaining TOKENs of TOKEN 1 is decremented by 1(TOKEN _ TOKEN 1_ COUNT-1);
if TOKEN _ TOKEN 1_ COUNT is equal to 1, the request is passed, one TOKEN is consumed, the number of remaining TOKENs of TOKEN 1 is decreased by 1, and the NEXT TOKEN generation TIME of TOKEN 1(TOKEN _ TOKEN 1_ NEXT _ AVAILABLE _ TIME) is updated to the CURRENT TIME CURRENT _ TIME + r (TOKEN/s). Wherein r is a preset token production rate and can be flexibly adjusted according to actual requirements.
Further, after step S32, the method further includes:
step S35, if not, suspending the request and inquiring the next token generation time stored in the Redis database;
step S36, determining whether the current time is greater than the next token generation time;
step S37, if yes, passing the request and consuming a specified number of tokens;
step S38, updating the next token generation time in the Redis database according to the current time and the token production rate.
In this embodiment, with the above embodiments, if TOKEN _ TOKEN 1_ COUNT <0, the request is suspended, and the server queries TOKEN generation TIME TOKEN _ TOKEN 1_ NEXT _ AVAILABLE _ TIME of TOKEN 1;
if the CURRENT TIME CURRENT _ TIME is greater than the NEXT TOKEN generation TIME TOKEN _ TOKEN 1_ NEXT _ AVAILABLE _ TIME of TOKEN 1, directly obtaining the TOKEN and passing the request, and updating TOKEN _ TOKEN 1_ COUNT to be the ratio of the difference between the CURRENT TIME and the NEXT TOKEN generation TIME to the TOKEN generation rate, namely:
TOKEN_BUCKET1_COUNT=(CURRENT_TIME-TOKEN_BUCKET1_NEXT_AVAILABLE_TIME)/r。
further, step S36 is followed by:
step S39, if not, suspending the request until the current time is larger than the next token generation time, executing the step of passing the request, and updating the next token generation time in the Redis database according to the token production rate.
In this embodiment, following the above embodiment, if the CURRENT TIME CURRENT _ TIME is less than TOKEN _ TOKEN 1_ NEXT _ AVAILABLE _ TIME, the request is suspended until the TIME TOKEN _ TOKEN 1_ NEXT _ AVAILABLE _ TIME, and the NEXT TOKEN generation TIME of TOKEN 1 is increased by r, that is:
TOKEN_BUCKET1_NEXT_AVAILABLE_TIME=TOKEN_BUCKET1_NEXT_AVAILABLE_TIME+r。
in the embodiment, the flexible and configurable queuing and flow limiting function is realized through the optimized token bucket algorithm, so that batch deployment is realized under the condition of limited IP pools.
Further, step S20 includes:
and step S21, excluding unnecessary files in the system key files by using the specified exclusion command, and compressing and packaging the system key files except the unnecessary files into the system image package by using a preset system command tool.
In this embodiment, system command tool tar is used instead of dd to exclude unnecessary files in system critical files by excluding command- -exception, such as: tar zcvpf kylin _ os _ image tar, gz-C/- -extra + found/— extra + mnt/— extra ═ dev/— -extra ═ proc/— -extra ═ tmp/— -extra ═ sys/, to further reduce the image file size.
According to the method and the device, the unnecessary files are further eliminated by adopting the specified eliminating command, so that technicians do not need to check the key files of the system one by one and manually delete the unnecessary files, and only a specified eliminating instruction needs to be sent, so that the convenience of file eliminating operation is improved, and the file eliminating efficiency is improved.
Further, referring to fig. 5, fig. 5 is a flowchart illustrating a method for deploying an operating system according to a third embodiment of the present invention, where the method is applied to an ARM client, and the method includes:
step S100, after entering a pre-boot execution environment PXE, sending a system deployment request to a web server, wherein the server dynamically records a time interval of token generation based on a preset token bucket algorithm;
in this embodiment, the client deploys the network card to start to enter the PXE environment for the first time, and after performing the corresponding preparation operation, requests the server to download the image package of the target OS and other required files. The server side may receive concurrent deployment requests from a plurality of client sides, and the original token bucket algorithm is improved, the setting of a timer is cancelled, and the next token generation time of each group of token buckets is dynamically recorded, so that the flexible and configurable queuing current limiting function is realized, the limited resources are reasonably utilized, and the batch concurrent deployment is realized.
Step S200, receiving a system image package of the target operating system fed back by the server after passing the request, wherein the target operating system is preinstalled with a boot tool, and the system image package is obtained by compressing and packaging system key files only containing necessary files;
in this embodiment, the server determines whether the client's request is passed based on the optimized token bucket algorithm, and returns the target OS's image package and other required files to the client upon confirmation of the pass. For the system image package, a server side firstly installs a boot start tool package based on a mainstream EFI mode to a target OS, then acquires all system key files of the target OS, eliminates unnecessary files, then compresses and packages the rest files, and takes the packaged file package as the system image package of the target OS.
And step S300, decompressing and copying the system image package to a specified file system partition, and executing a deployment process on the decompressed system image package by using the boot tool obtained after decompression so as to complete the deployment of the target operating system.
In this embodiment, after acquiring the image package of the target OS, the client decompresses and copies the image package to the designated file system partition, and then performs a subsequent installation process by using the boot tools grub2-efi preinstalled in the image package to complete the target OS deployment on the client.
The embodiment provides an operating system deployment method. For the ARM client, a boot starting tool is installed before a mirror image package of a target operating system is generated at a server, so that a condition is provided for getting rid of a source installation mode of the client; the method has the advantages that the size of the mirror image file is effectively reduced by removing unnecessary files and then packaging the unnecessary files to generate a mirror image packet to be sent to the client, so that large files do not need to be transmitted in the mirror image cloning process, the target operating system can be more quickly deployed by means of the starting guide tool and the mirror image cloning mode when the subsequent client deploys a local system, the source generation installation mode and the limited MBR guide mode of the client can be thoroughly eliminated, the time for occupying DHCP IP resources is reduced compared with the source generation installation mode, and the deployment efficiency of the whole machine is improved; for a web server, the invention confirms whether to pass through the system deployment request of each client through a token bucket algorithm which can dynamically record the time interval generated by the token, and can realize the flexible and configurable queuing current-limiting function without a timer, so that the batch deployment task of the operating systems of a plurality of clients can be efficiently completed under the condition of limited IP pool; in conclusion, the invention solves the technical problem of low deployment efficiency of operating system deployment modes of large-scale ARM servers.
Further, a fourth embodiment of the operating system deployment method of the present invention is proposed based on the third embodiment shown in fig. 5. In this embodiment, step S300 includes:
step S301, decompressing the system image packet to a specified file directory corresponding to the specified file system partition, and copying the decompressed system image packet to the specified file system partition;
step S302, binding the system configuration file of the target operating system with the current environment, and installing a system boot program by using the boot tool obtained after decompression, wherein the system configuration file and the system image package are obtained together;
step S303, executing the system boot loader to create a boot configuration file for the target operating system.
In this embodiment, as a specific implementation manner, the client downloads the mirror image package kylin _ os _ image.tar.gz from the server under the PXE environment; in a PXE environment: decompressing the system mirror image package to/mnt directory; in a PXE environment: copying the mirror image to the corresponding sda partition; in a PXE environment: binding the target OS configuration file obtained together with the mirror image package with the current environment; in a PXE environment: switching the root environment to the decompressed target OS through a system command tool, wherein the command is as follows: chroma/mnt; install efi System Start Bootstrap using grub2 of the target OS, commands: grub2-install (default installed under the/floor/efi partition), grub2-mkconfig-o/boot/grub2/grub.cfg (create boot profile); and finally, restarting to enter a new system, and completing the whole deployment process.
The embodiment further defines the specific step flow of the mirror image cloning, so that the ARM client can quickly and accurately complete the mirror image cloning operation of the operating system based on the operation steps, and the local deployment efficiency of the whole machine is improved.
Further, before the step of sending the system deployment request to the web server in step S100, the method further includes:
step A1, under the PXE environment, creating a disk partition for a first disk sda;
step A2, formatting the disk partition and mounting the file system, so that the disk partition with the file system mounted is used as the specified file system partition.
In this embodiment, after entering the PXE environment, the client needs to create a disk partition for the first disk sda, format and mount the file system, where the first partition sda1 must be in a fat format and mounted to/boot/efi. And then, the client downloads other required files such as the mirror image package, the system configuration file and the like from the server.
After the mirror image deployment is realized through the processes, the deployment efficiency is improved compared with the original deployment mode, the time that a single server occupies the DHCP IP is greatly shortened, the token wait time interval is effectively reduced, and the batch deployment efficiency is improved.
The invention also provides an operating system deployment system, which comprises an ARM client and a web server, and is used for:
the method comprises the steps that after a preset starting guide tool is installed in a target operating system, a server side obtains a system key file of the target operating system;
the server side excludes unnecessary files in the system key files, and compresses and packs the system key files except the unnecessary files to obtain a system mirror image package;
the client sends a system deployment request to the server after entering a pre-boot execution environment PXE;
when the server side receives the request, the server side confirms that the request passes through based on a preset token bucket algorithm, wherein the token bucket algorithm dynamically records the time interval of token generation;
the server side sends the system mirror image packet to the client side;
and the client receives the system image package, decompresses and copies the system image package to a specified file system partition, and executes a deployment process on the decompressed system image package by using the boot tool obtained after decompression so as to complete the deployment of the target operating system.
As shown in fig. 6, the present invention further provides an operating system deployment device, where the operating system deployment device is disposed at a server, and the operating system deployment device includes:
the key file acquisition module 10 is configured to acquire a system key file of a target operating system after a preset boot start tool is installed in the target operating system;
the mirror image compression and packaging module 20 is configured to exclude unnecessary files from the system key files, and compress and package the system key files except the unnecessary files to obtain a system mirror image package;
a token confirmation request module 30, configured to, when receiving a system deployment request sent by an ARM client, confirm that the request passes through based on a preset token bucket algorithm, where the token bucket algorithm dynamically records a time interval during which a token is generated;
and the mirror image clone deployment module 40 is configured to send the system mirror image package to the client, so that the client completes deployment of the target operating system according to a deployment manner of mirror image clone and based on the boot tool.
Optionally, the token confirmation request module 30 includes:
a residual token query unit, configured to query, based on the token bucket algorithm, a residual token number stored in a remote dictionary service (Redis) database when a system deployment request sent by the client is received, where the Redis database stores the residual token number of a token bucket group and a next token generation time;
the residual token judging unit is used for judging whether the residual token number meets a preset number condition or not;
a deployment request passing unit, configured to pass the request and consume a specified number of tokens if yes;
and the residual token updating unit is used for updating the residual token number stored in the Redis database into the residual token number consumed by the request and updating the next token generation time according to the current time and the preset token production rate.
Optionally, the operating system deployment apparatus further includes:
a production time query module, configured to suspend the request if the token is not in the production time range, and query next token production time stored in the Redis database;
the current time judging module is used for judging whether the current time is greater than the next token generation time;
a deployment request passing module, configured to pass the request and consume a specified number of tokens if the request passes;
a generation time update module for updating the next token generation time in the Redis database according to the current time and the token production rate.
Optionally, the operating system deployment apparatus further includes:
and if not, suspending the request until the current time is greater than the next token generation time, executing the step of passing the request, and updating the next token generation time in the Redis database according to the token production rate.
Optionally, the mirror image compression and packaging module 20 includes:
and the image compression and packaging unit is used for eliminating unnecessary files in the system key files by using a specified elimination command and compressing and packaging the system key files except the unnecessary files into the system image package by using a preset system command tool.
As shown in fig. 7, the present invention further provides an operating system deployment device, where the operating system deployment device is disposed on an ARM client, and the device includes:
the deployment request sending module 100 is configured to send a system deployment request to a web server after entering a pre-boot execution environment PXE, where the server dynamically records a time interval of token generation based on a preset token bucket algorithm;
a system image receiving module 200, configured to receive a system image package of the target operating system fed back by the server after passing the request, where the target operating system is preinstalled with a boot tool, and the system image package is obtained by compressing and packaging system key files that only include necessary files;
the operating system deployment module 300 is configured to decompress and copy the system image package to a designated file system partition, and execute a deployment process on the decompressed system image package by using the boot loader obtained after decompression, so as to complete deployment of the target operating system.
Optionally, the operating system deployment module 300 includes:
the mirror image decompression and copying unit is used for decompressing the system mirror image packet to a specified file directory corresponding to the specified file system partition and copying the decompressed system mirror image packet to the specified file system partition;
the environment configuration binding unit is used for binding the system configuration file of the target operating system with the current environment and installing a system boot program by using the boot tool obtained after decompression, wherein the system configuration file and the system image package are obtained together;
a boot file creating unit for executing the system boot bootstrap program to create a boot configuration file for the target operating system;
and the system restarting entering unit is used for executing restarting operation after the starting configuration file is created so as to enter the system and finish the deployment of the target operating system.
Optionally, the deployment request sending module 100 includes:
the device comprises a disk partition creating unit, a data processing unit and a data processing unit, wherein the disk partition creating unit is used for creating a disk partition for a first disk sda in the PXE environment;
and the file system mounting unit is used for formatting the disk partition and mounting the file system, so that the disk partition with the file system mounted is used as the specified file system partition.
The invention also provides operating system deployment equipment.
The operating system deployment device comprises a processor, a memory and an operating system deployment program stored on the memory and capable of running on the processor, wherein the operating system deployment program realizes the steps of the operating system deployment method when being executed by the processor.
The method implemented when the operating system deployment program is executed may refer to various embodiments of the operating system deployment method of the present invention, and details are not described here.
The invention also provides a computer readable storage medium.
The present computer-readable storage medium has stored thereon an operating system deployment program which, when executed by a processor, implements the steps of the operating system deployment method as described above.
The method implemented when the operating system deployment program is executed may refer to various embodiments of the operating system deployment method of the present invention, and details are not described here.
The invention also provides a computer program product comprising a computer program which, when executed by a processor, carries out the steps of the operating system deployment method as described above.
The method implemented when the computer program is executed may refer to various embodiments of the operating system deployment method of the present invention, which are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (11)

1. An operating system deployment method, wherein the method is applied to a web server, and the method comprises:
installing a preset starting guide tool in a target operating system, and acquiring a system key file of the target operating system;
removing unnecessary files in the system key files, and compressing and packaging the system key files except the unnecessary files to obtain a system mirror image package;
when a system deployment request sent by an ARM client is received, confirming that the request passes through based on a preset token bucket algorithm, wherein the token bucket algorithm dynamically records a time interval of token generation;
and sending the system image package to the client so that the client can complete the deployment of the target operating system according to the deployment mode of image cloning and based on the boot starting tool.
2. The method for deploying an operating system according to claim 1, wherein the step of confirming passing of the request based on a preset token bucket algorithm upon receiving a system deployment request sent by an ARM client comprises:
upon receiving a system deployment request sent by the client, querying a remaining token number stored in a remote dictionary service (Redis) database based on the token bucket algorithm, wherein the Redis database stores the remaining token number and a next token generation time of a token bucket group;
judging whether the number of the remaining tokens meets a preset number condition;
if so, passing the request and consuming a specified number of tokens;
and updating the residual token number stored in the Redis database to the residual token number after the request is consumed, and updating the next token generation time according to the current time and the preset token production rate.
3. The method for deploying an operating system according to claim 2, wherein the step of determining whether the remaining token count satisfies a predetermined count condition further comprises:
if not, suspending the request, and inquiring the next token generation time stored in the Redis database;
judging whether the current time is greater than the next token generation time;
if so, passing the request and consuming a specified number of tokens;
updating the next token generation time in the Redis database according to the current time and the token production rate.
4. The method for deploying an operating system according to claim 3, wherein the step of determining whether the current time is greater than the next token generation time further comprises, after the step of determining whether the current time is greater than the next token generation time:
if not, suspending the request until the current time is larger than the next token generation time, executing the step of passing the request, and updating the next token generation time in the Redis database according to the token production rate.
5. The operating system deployment method of any one of claims 1 to 4, wherein the step of excluding unnecessary files in the system key files, and performing compression packaging on the system key files except the unnecessary files to obtain a system image package comprises:
and eliminating unnecessary files in the system key files by using a specified eliminating command, and compressing and packaging the system key files except the unnecessary files into the system image package by using a preset system command tool.
6. A method for deploying an operating system, the method being applied to an ARM client, the method comprising:
after entering a pre-boot execution environment PXE, sending a system deployment request to a web server, wherein the server dynamically records a time interval of token generation based on a preset token bucket algorithm;
receiving a system image package of a target operating system fed back by the server after the server passes the request, wherein a boot tool is preinstalled and started by the target operating system, and the system image package is obtained by compressing and packaging system key files only containing necessary files;
decompressing and copying the system image package to a specified file system partition, and executing a deployment process on the decompressed system image package by using the boot tool obtained after decompression so as to complete the deployment of the target operating system.
7. The method for deploying an operating system according to claim 6, wherein the step of decompressing and copying the system image package to a designated file system partition, and performing a deployment procedure on the decompressed system image package by using the boot loader obtained after the decompression so as to complete the deployment of the target operating system comprises:
decompressing the system image packet to a specified file directory corresponding to the specified file system partition, and copying the decompressed system image packet to the specified file system partition;
binding the system configuration file of the target operating system with the current environment, and installing a system boot program by using the boot tool obtained after decompression, wherein the system configuration file and the system image package are obtained together;
executing the system boot loader to create a boot configuration file for the target operating system;
and after the start configuration file is created, executing restart operation to enter a system, and finishing the deployment of the target operating system.
8. The operating system deployment method of claim 6 or 7, wherein said step of sending a system deployment request to a web server is preceded by the steps of:
under the PXE environment, creating a disk partition for a first disk sda;
and formatting the disk partition and mounting a file system, wherein the disk partition with the file system mounted is used as the specified file system partition.
9. An operating system deployment system, the system comprising an ARM client and a web server, the system configured to:
the method comprises the steps that after a preset starting guide tool is installed in a target operating system, a server side obtains a system key file of the target operating system;
the server side excludes unnecessary files in the system key files, and compresses and packs the system key files except the unnecessary files to obtain a system mirror image package;
the client sends a system deployment request to the server after entering a pre-boot execution environment PXE;
when the server side receives the request, the server side confirms that the request passes through based on a preset token bucket algorithm, wherein the token bucket algorithm dynamically records the time interval of token generation;
the server side sends the system mirror image packet to the client side;
and the client receives the system image package, decompresses and copies the system image package to a specified file system partition, and executes a deployment process on the decompressed system image package by using the boot tool obtained after decompression so as to complete the deployment of the target operating system.
10. An operating system deployment device, the operating system deployment device comprising: a memory, a processor, and an operating system deployment program stored on the memory and executable on the processor, the operating system deployment program when executed by the processor implementing the steps of the operating system deployment method as claimed in any one of claims 1 to 5 or 6 to 8.
11. A computer-readable storage medium, having stored thereon an operating system deployment program which, when executed by a processor, implements the steps of the operating system deployment method of any of claims 1 to 5 or 6 to 8.
CN202111463864.3A 2021-12-02 2021-12-02 Operating system deployment method, system, device and computer-readable storage medium Pending CN114115920A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111463864.3A CN114115920A (en) 2021-12-02 2021-12-02 Operating system deployment method, system, device and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111463864.3A CN114115920A (en) 2021-12-02 2021-12-02 Operating system deployment method, system, device and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN114115920A true CN114115920A (en) 2022-03-01

Family

ID=80366839

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111463864.3A Pending CN114115920A (en) 2021-12-02 2021-12-02 Operating system deployment method, system, device and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN114115920A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114756247A (en) * 2022-03-31 2022-07-15 苏州浪潮智能科技有限公司 System deployment method, device, equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114756247A (en) * 2022-03-31 2022-07-15 苏州浪潮智能科技有限公司 System deployment method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106537338B (en) Self-expanding clouds
CN113296792B (en) Storage method, device, equipment, storage medium and system
CN108089913B (en) Virtual machine deployment method of super-fusion system
CN112506617B (en) Mirror image updating method and device for side car containers in Kubernetes cluster
CN109840096B (en) Installation method and device of operating system
US10728169B1 (en) Instance upgrade migration
CN105278999A (en) Safe and efficient method for deploying virtual machine software
CN103049295A (en) Network installation method for Linux operating systems with godson platforms
CN111966423B (en) Method and equipment for realizing memory operating system
US9141400B2 (en) Technique for deploying operating systems in a virtualized environment
EP3879875A1 (en) Resource change method and device, apparatus, and storage medium
CN112445495B (en) Mirror image and recovery method of high-performance computing cluster node
CN109144523A (en) Software deployment management method and server, management client, normal client end
CN102662884A (en) Device driving program configuration method based on network
CN113282342A (en) Deployment method, device, system, electronic equipment and readable storage medium
CN115357310A (en) System starting method and device, electronic equipment and storage medium
CN113632064A (en) Provisioning services (PVS) cloud streaming with read caching
CN114115920A (en) Operating system deployment method, system, device and computer-readable storage medium
CN117112313B (en) Service disaster tolerance switching method, device, equipment and storage medium
WO2024007800A1 (en) Cloud terminal system upgrade method and apparatus, and cloud terminal and storage medium
WO2023066246A1 (en) Method and system for installing application on cloudphone, and client cloudphone
CN107861761B (en) Starting method and system of physical host
CN115114162A (en) Firmware testing method, device, equipment, storage medium and testing system
CN116932241A (en) Service starting method and related device
CN110795113B (en) Redis cluster service installation method, server and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination