CN117519778A - System configuration method, device, computer equipment and storage medium - Google Patents

System configuration method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117519778A
CN117519778A CN202311543649.3A CN202311543649A CN117519778A CN 117519778 A CN117519778 A CN 117519778A CN 202311543649 A CN202311543649 A CN 202311543649A CN 117519778 A CN117519778 A CN 117519778A
Authority
CN
China
Prior art keywords
module
configuration
target
version
information
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
CN202311543649.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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202311543649.3A priority Critical patent/CN117519778A/en
Publication of CN117519778A publication Critical patent/CN117519778A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • 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

Abstract

The embodiment of the application discloses a system configuration method, a system configuration device, computer equipment and a storage medium. The method comprises the following steps: responding to a configuration acquisition request of the target machine, acquiring a target service corresponding to the target machine, determining a target module version corresponding to the target machine based on the target service, compiling the target module version to obtain configuration information corresponding to the target machine, and sending the configuration information to the target machine so that the target machine executes system configuration operation based on the configuration information. The embodiment of the application can enable the configuration to be effective according to the granularity of the machine, and realize safe and controllable system configuration.

Description

System configuration method, device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a system configuration method, a device, a computer device, and a storage medium.
Background
Operating systems typically include a large number of configuration parameters, such as configuration in terms of system kernel parameters, system programs, networks, security, permissions, etc., where changes to the configuration parameters may cause a system failure or security breach of the machine. Thus, there is a need for an efficient and secure way of operating system configuration.
The system configuration modes of the existing operating system comprise a system configuration mode based on manpower and a system configuration mode based on a system configuration tool, the system configuration mode based on the manpower has high cost and is easy to generate errors and omissions, the system configuration mode based on the system configuration tool adopts GIT branches to control the effective range of configuration, and the granularity of the system configuration mode is too coarse to carry out safe and controllable system configuration.
Disclosure of Invention
The embodiment of the application provides a system configuration method, a device, computer equipment and a storage medium, which can enable configuration to be effective according to machine granularity and realize safe and controllable system configuration.
In a first aspect, an embodiment of the present application provides a system configuration method, where the method includes:
responding to a configuration acquisition request of a target machine, and acquiring a target service corresponding to the target machine;
determining a target module version corresponding to a target machine based on the target service;
compiling the target module version to obtain configuration information corresponding to the target machine;
the configuration information is sent to the target machine to cause the target machine to perform a system configuration operation based on the configuration information.
In some embodiments, the step of determining a target module version corresponding to the target machine based on the target service includes:
Determining service environment information corresponding to a target machine based on a target service;
and determining a target module version corresponding to the target machine based on the target service and service environment information.
In some embodiments, the step of determining service environment information corresponding to the target machine based on the target service includes:
acquiring gray information corresponding to a target service, and matching a target machine with the gray information;
when the target machine is matched with the gray information, determining that the service environment information corresponding to the target machine is a gray environment;
and when the target machine is not matched with the gray information, determining the service environment information corresponding to the target machine as a formal environment.
In some embodiments, the step of determining a target module version corresponding to the target machine based on the target service and service environment information includes:
based on the target service, acquiring a plurality of candidate environment directories corresponding to the target machine from a service configuration directory constructed in advance;
determining a target environment catalog corresponding to the target machine from a plurality of candidate environment catalogs based on the service environment information;
and determining a target module version corresponding to the target machine based on a reference relation between the target environment directory and the module version in the pre-constructed version library directory.
In some embodiments, before the step of determining the target module version corresponding to the target machine based on the target service, the method includes:
responding to a configuration submitting request, and acquiring a configuration module;
and saving the configuration module into a pre-constructed configuration catalog.
In some embodiments, after the step of saving the configuration module into the pre-built configuration catalog, it comprises:
responding to the module packaging request, and acquiring module information and version information;
and packaging the configuration modules in the configuration catalog based on the module information and the version information to obtain the module versions corresponding to the configuration modules.
In some embodiments, the step of packaging the configuration modules in the configuration catalog based on the module information and the version information to obtain the module versions corresponding to the configuration modules includes:
based on the module information, acquiring a configuration module to be packaged from a configuration catalog;
copying the configuration module to be packaged into a version library catalog constructed in advance;
and modifying the module directory names of the configuration modules to be packaged, which are copied to the version library directory, based on the version information so as to obtain the corresponding module versions of the configuration modules.
In some embodiments, after the step of packaging the configuration modules in the configuration catalog based on the module information and the version information to obtain the module versions corresponding to the configuration modules, the method includes:
Responding to a configuration setting request of a target service, and acquiring first module information, first version information and gray information corresponding to the target service;
based on gray information, adding a service environment catalog corresponding to the target service under a pre-constructed service configuration catalog;
determining a first module version corresponding to the service environment directory from the version library directory based on the first module information and the first version information;
and establishing a reference relation between the service environment directory and the module version in the version library directory based on the first module version.
In some embodiments, after the step of establishing the reference relationship between the service environment directory and the module versions in the version library directory based on the first module version, the method comprises:
responding to a configuration rollback request of the target service, and acquiring second module information and second version information corresponding to the target service;
determining a second module version corresponding to the service environment directory from the version library directory based on the second module information and the second version information;
and adjusting the reference relation between the service environment directory and the module version in the version library directory based on the second module version.
In a second aspect, an embodiment of the present application further provides a system configuration apparatus, where the system configuration apparatus includes:
The first response module is used for responding to the configuration acquisition request of the target machine and acquiring a target service corresponding to the target machine;
the configuration determining module is used for determining a target module version corresponding to the target machine based on the target service;
the configuration compiling module is used for compiling the target module version to obtain configuration information corresponding to the target machine;
and the configuration validation module is used for sending the configuration information to the target machine so that the target machine can execute the system configuration operation based on the configuration information.
The present application also provides a computer readable storage medium storing a computer program adapted to be loaded by a processor to perform the steps in the system configuration method of any of the above embodiments.
The embodiment of the application further provides a computer device, where the computer device includes a memory and a processor, where the memory stores a computer program, and the processor executes the steps in the system configuration method of any of the embodiments above by calling the computer program stored in the memory.
According to the system configuration method, the device, the computer equipment and the storage medium, the target module version corresponding to the target machine is determined based on the target service in the process of executing system configuration, the configuration information corresponding to the target machine is obtained through compiling the target module version, and the configuration information is sent to the target machine, so that the target machine executes system configuration operation based on the configuration information. According to the embodiment of the application, the configuration is isolated according to the service dimension, so that the configuration can be effective according to the granularity of the machine, thereby realizing safe and controllable system configuration, and supporting the system automation configuration and the flexible setting of the system configuration version of mass machines in different service scenes.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a specific application scenario diagram of a system configuration method provided in an embodiment of the present application.
Fig. 2 is a flow chart of a system configuration method according to an embodiment of the present application.
Fig. 3 is a schematic structural diagram of a configuration code directory according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of a configuration module provided in an embodiment of the present application.
Fig. 5 is a schematic flow chart of configuration module submission provided in the embodiment of the present application.
Fig. 6 is a schematic flow chart of configuration module packaging according to an embodiment of the present application.
Fig. 7 is a schematic flow chart of configuration module setting provided in an embodiment of the present application.
Fig. 8 is a schematic flow chart of configuration module rollback according to an embodiment of the present application.
Fig. 9 is a schematic structural diagram of a system configuration device according to an embodiment of the present application.
Fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application. Meanwhile, in the description of the embodiments of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
The embodiment of the application provides a system configuration method, a system configuration device, computer equipment and a storage medium. Specifically, the system configuration method of the embodiment of the application may be executed by an electronic device, where the electronic device may be a device such as a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a game machine, a personal computer (PC, personal Computer), a personal digital assistant (Personal Digital Assistant, PDA) and the like. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, basic cloud computing services such as big data and artificial intelligence platforms, and the like, but is not limited thereto.
Fig. 1 is a specific application scenario diagram of a system configuration method according to an embodiment of the present application, where the system configuration method is performed by a configuration compiling cluster, that is, the system configuration method according to an embodiment of the present application is performed by a server cluster formed by a plurality of physical servers.
The system configuration modes of the existing operating system comprise a system configuration mode based on manpower and a system configuration mode based on a system configuration tool. The system configuration mode is only suitable for scenes with a small quantity of machines, the system configuration requirement of mass machines cannot be met, when the quantity of machines is large, the manual management cost is high, errors and loopholes are easy to occur, and the stability and reliability of the system configuration cannot be guaranteed. The system configuration mode based on the system configuration tool adopts the GIT branch to control the effective range of the configuration, the system configuration tool pushes the configuration to the Production (Production) branch of the GIT, and the configuration is immediately effective to a machine set as a Production (Production) environment label.
Based on this, in the embodiment of the application, in response to a configuration acquisition request of a target machine, a target service corresponding to the target machine is acquired, a target module version corresponding to the target machine is determined based on the target service, compiling processing is performed on the target module version to obtain configuration information corresponding to the target machine, and the configuration information is sent to the target machine, so that the target machine performs a system configuration operation based on the configuration information. According to the embodiment of the application, the configuration is isolated according to the service dimension, so that the configuration can be effective according to the granularity of the machine, thereby realizing safe and controllable system configuration, and supporting the system automation configuration and the flexible setting of the system configuration version of mass machines in different service scenes
A system configuration method, apparatus, computer device, and storage medium in the embodiments of the present application will be described in detail below. The following description of the embodiments is not intended to limit the preferred embodiments.
Referring to fig. 2, fig. 2 is a schematic flow chart of a system configuration method according to an embodiment of the present application, where the flow chart of the system configuration method may be as follows.
101, responding to a configuration acquisition request of a target machine, and acquiring a target service corresponding to the target machine.
The target machine is a machine that needs to perform system configuration, and for example, as shown in fig. 1, the target machine may be a machine 1, a machine 2, a machine 3, or the like. Each machine has a corresponding traffic type, and the target traffic is the traffic type corresponding to the target machine, e.g., as shown with continued reference to fig. 1, when the target machine is machine 1, machine 2, or machine 3, the target traffic is traffic a.
In a specific implementation manner, an Agent (Agent) process is deployed on a target machine, interaction is performed between the target machine and a computer device through the Agent process, the Agent process on the target machine can issue a configuration acquisition request to the computer device in a timing or manual triggering manner, and after the computer device receives the configuration acquisition request, a target service corresponding to the target machine is acquired, so that corresponding configuration information is returned to the target machine based on the target service.
With continued reference to fig. 1, in a specific implementation manner, the computer device is a configuration compiling cluster, the target machine sends a configuration acquisition request to the configuration compiling cluster through the load balancing cluster, and because the configuration compiling cluster and the load balancing cluster have a lateral expansion capability, the configuration acquisition request is sent to the configuration compiling cluster through the load balancing cluster, and the configuration compiling cluster responds to the configuration acquisition request of the target machine, so that the configuration request of service bump can be satisfied, and the stability of system configuration is ensured.
102, determining a target module version corresponding to the target machine based on the target service.
The target module version is a version of a configuration module corresponding to the target machine, for example, as shown in fig. 3, the machine in the service a formal environment corresponds to version 1.0.1 of module 1 and version 1.0.2 of module 2, and the machine in the service a gray environment corresponds to version 1.2.1 of module 1 and version 1.0.2 of module 2.
The configuration module is a configuration module packaged based on atomic resources provided by a system configuration tool Puppet. As shown in fig. 4, the system configuration tool Puppet abstracts a system configuration File into File resources (File resources), for example, file resources for setting the affiliated User, authority, etc. of the File, user resources for adding the system User, service resources for managing services, package resources for installing a software Package. In this embodiment, based on the atomic resource provided by Puppet, the system configuration is packaged into an available configuration module (set), for example, a ssh module for managing ssh login service on the system, a users module for managing system users, and a sysenv module for managing system environments, such as time zones and languages, and the like, and by packaging the system configuration into the configuration module, the publishing and changing efficiency of the system configuration can be improved.
After the target service corresponding to the target machine is obtained, the target module version corresponding to the target machine is determined based on the target service, and the configuration can be validated according to the granularity of the machine by isolating the configuration according to the service dimension, so that the safe and controllable system configuration is realized. For example, when the target machine is a machine in the business a formal environment, the target module version is 1.0.1 version of module 1 and 1.0.2 version of module 2; when the target machine is a machine in the service A gray scale environment, the target module version is 1.2.1 version of the module 1 and 1.0.2 version of the module 2.
In one possible implementation, the target service corresponds to different module versions under different service environments, for example, as shown in fig. 3, the service a formal environment corresponds to version 1.0.1 of module 1 and version 1.0.2 of module 2, and the service a gray environment corresponds to version 1.2.1 of module 1 and version 1.0.2 of module 2. Correspondingly, the step of determining the target module version corresponding to the target machine based on the target service comprises the following steps:
determining service environment information corresponding to a target machine based on a target service;
and determining a target module version corresponding to the target machine based on the target service and service environment information.
The service environment information is a service environment of the target machine under the target service, and the service environment information can be a formal environment or a gray-scale environment, wherein the gray-scale environment refers to a pre-release environment (i.e. a debug environment before release), and the formal environment refers to an environment for providing external services positively. For example, if the target machine is a machine in the formal environment of the service a, the service environment information corresponding to the target machine is the formal environment; and if the target machine is a machine in the service A gray scale environment, the service environment information corresponding to the target machine is the gray scale environment.
After the service environment information corresponding to the target machine is determined, the version of the target module corresponding to the target machine can be determined based on the target service and the service environment information, for example, with continued reference to fig. 3, the target service is service a, the service environment information is the formal environment, and then the version 1.0.1 of the module 1 and the version 1.0.2 of the module 2 are determined as the version of the target module; and if the target service is service A and the service environment information is gray environment, determining the 1.2.1 version of the module 1 and the 1.0.2 version of the module 2 as target module versions.
In one possible implementation manner, the target service has corresponding gray information, and based on the gray information, service environment information of the target machine under the target service can be determined, and the step of determining, based on the target service, the service environment information corresponding to the target machine includes:
Acquiring gray information corresponding to a target service, and matching a target machine with the gray information;
when the target machine is matched with the gray information, determining that the service environment information corresponding to the target machine is a gray environment;
and when the target machine is not matched with the gray information, determining the service environment information corresponding to the target machine as a formal environment.
With continued reference to fig. 1, the gray information corresponding to the target service may be stored in a database, and the computer device (e.g., the configuration compiling cluster) may obtain the gray information corresponding to the target service from the database through the configuration version management module interface.
The gradation information includes a gradation machine list in which machines belonging to the gradation environment of the target service are recorded, and for example, as shown in fig. 1, if machine 1 and machine 2 belong to machines belonging to the gradation environment of service a and machine 3 belongs to machines belonging to the formal environment of service a, then machine 1 and machine 2 are in the gradation machine list of service a and machine 3 is not in the gradation machine list of service a.
The matching of the target machine and the gray information refers to querying whether the target machine is in a gray machine list, and when the target machine is in the gray machine list, determining that the target machine is matched with the gray information, and determining the gray environment as service environment information corresponding to the target machine. For example, in the gray scale machine list of the service a, when the target machine is the machine 1 or the machine 2, the machine 1 and the machine 2 determine that the target machine matches the gray scale information, and determine the gray scale environment as the service environment information corresponding to the target machine.
Otherwise, when the target machine is not in the gray machine list, determining that the target machine is not matched with the gray information, and determining the formal environment as business environment information corresponding to the target machine. For example, when the target device is not in the grayscale device list of the service a, if the target device is the device 3, it is determined that the target device does not match the grayscale information, and the formal environment is determined as the service environment information corresponding to the target device.
With continued reference to FIG. 3, a configuration code directory is included in the computer device, the configuration code directory including a public configuration directory and a business configuration directory. The common configuration directory includes a version library directory, and the version library directory includes a plurality of module versions, for example, 1.0.1 version of module 1, 1.2.1 version of module 1, 1.0.2 version of module 2, and the like. The service configuration catalog comprises a plurality of environment catalogs of different services, such as a service A formal environment catalogs, a service A gray environment catalogs, a service B formal environment catalogs and the like. A reference relationship is pre-established between each service environment directory under the service configuration directory and the module version under the version library directory, for example, the service a formal environment directory references the 1.0.1 version of the module 1 and the 1.0.2 version of the module 2 in the version library directory through a soft chain, the service a gray environment directory references the 1.2.1 version of the module 1 and the 1.0.2 version of the module 2 in the version library directory through a soft chain, and the service B formal environment directory references the 2.0.1 version of the module 2 and the 1.0.1 version of the module 3 in the version library directory through a soft chain. Correspondingly, the step of determining the version of the target module corresponding to the target machine based on the target service and service environment information comprises the following steps:
Based on the target service, acquiring a plurality of candidate environment directories corresponding to the target machine from a service configuration directory constructed in advance;
determining a target environment catalog corresponding to the target machine from a plurality of candidate environment catalogs based on the service environment information;
and determining a target module version corresponding to the target machine based on a reference relation between the target environment directory and the module version in the pre-constructed version library directory.
The plurality of candidate environment directories are environment directories corresponding to the target service in the service configuration directory, for example, when the target service is service a, the plurality of candidate environment directories include a service a formal environment directory and a service a gray environment directory.
The target environment catalog is an environment catalog matched with the service environment information in the plurality of candidate environment catalogues, for example, the plurality of candidate environment catalogues comprise a service A formal environment catalog and a service A gray scale environment catalog, and when the service environment information is the formal environment, the target environment catalog is the service A formal environment catalog; when the service environment information is a gray environment, the target environment catalog is a service A gray environment catalog.
The target module version is a module version with a reference relation with the target environment directory in the version library directory, and the reference relation is pre-established between each service environment directory under the service configuration directory and the module version under the version library directory, so that after the target environment directory corresponding to the target machine is determined, the target module version corresponding to the target machine can be determined based on the reference relation between the target environment directory and the module version in the version library directory. For example, the target environment directory is a service a formal environment directory, and the service a formal environment directory refers to version 1.2.1 of the module 1 and version 1.0.2 of the module 2 in the version library directory through a soft chain, and then the target module version is version 1.2.1 of the module 1 and version 1.0.2 of the module 2; for another example, the target environment directory is a service a gray environment directory, and the service a gray environment directory refers to version 1.2.1 of the module 1 and version 1.0.2 of the module 2 in the version library directory through a soft chain, and then the target module version is version 1.2.1 of the module 1 and version 1.0.2 of the module 2.
And 103, compiling the target module version to obtain configuration information corresponding to the target machine.
Since the target module version is a configuration module encapsulated based on atomic resources provided by the system configuration tool Puppet, the target module version cannot be directly executed by the target machine to take effect. After determining the target module version corresponding to the target machine, the embodiment compiles the target module version into configuration information executable by the target machine, so that the configuration information can be executed on the target machine to take effect, for example, a compiling mechanism of Puppet is adopted to compile version 1.0.1 of module 1 and version 1.0.2 of module 2 into configuration information executable by machine 1; for another example, the compiling mechanism of Puppet is employed to compile version 1.2.1 of module 1 and version 1.0.2 of module 2 into configuration information executable by machine 3.
104, sending the configuration information to the target machine, so that the target machine performs the system configuration operation based on the configuration information.
After compiling the target module version into the configuration information executable by the target machine, the configuration information can be sent to the target machine, and after receiving the configuration information, the target machine can execute system configuration operation based on the configuration information, so that the configuration information is only executed on the target machine to be effective. Compared with the prior technical scheme of controlling the effective range of the configuration by adopting the GIT branch, the configuration can be effective according to the granularity of the machine, thereby realizing safe and controllable system configuration.
In one possible implementation manner, as shown in fig. 5, before the step of determining the target module version corresponding to the target machine based on the target service, the following steps are included.
201, responding to a configuration submitting request, and acquiring a configuration module;
202, saving the configuration module into a pre-built configuration catalog.
With continued reference to fig. 1 and 2, the common configuration directory further includes a configuration directory in which the latest configuration module uploaded by the system administrator is stored. When a system administrator needs to issue or update an existing configuration module, the configuration module can be submitted to the computer equipment through a code warehouse management tool (such as a GitLab), the computer equipment responds to a configuration submitting request of the system administrator, acquires the configuration module, and stores the configuration module into a configuration catalog.
In one possible implementation, as shown in fig. 6, the step of saving the configuration module into the pre-built configuration catalog includes the following steps.
301, responding to a module packaging request, and acquiring module information and version information;
and 302, packaging the configuration modules in the configuration catalog based on the module information and the version information to obtain the module versions corresponding to the configuration modules.
The module version is a different version of the configuration module obtained by packaging the configuration module, for example, with continued reference to fig. 3, the module 1 is packaged into a 1.0.1 version of the module 1 and a 1.2.1 version of the module 1.
With continued reference to fig. 1, the system administrator may also send a module packaging request to the computer device through the code warehouse management tool and the configuration version management module interface, where the computer device may obtain module information and version information in response to the module packaging request sent by the system administrator, and package the configuration modules in the configuration catalog based on the module information and the version information, so as to obtain a module version corresponding to the configuration module.
In one possible implementation manner, the step of packaging the configuration modules in the configuration catalog based on the module information and the version information to obtain the module versions corresponding to the configuration modules includes:
based on the module information, acquiring a configuration module to be packaged from a configuration catalog;
copying the configuration module to be packaged into a version library catalog constructed in advance;
and modifying the module directory names of the configuration modules to be packaged, which are copied to the version library directory, based on the version information so as to obtain the corresponding module versions of the configuration modules.
The to-be-packaged configuration module is a configuration module to be packaged in the configuration catalog, for example, the to-be-packaged module may be the module 1, the module 2, the module 3 in fig. 3, and so on. The module information may be a module name corresponding to the configuration module to be packaged, and the step of obtaining the configuration module to be packaged from the configuration catalog based on the module information specifically includes: based on the module name, the configuration module to be packaged is obtained from the configuration catalog.
When the configuration module to be packaged is packaged, the configuration module to be packaged can be copied into a version library directory of the public configuration directory, and then the module directory name of the configuration module to be packaged, which is copied into the version library directory, is modified based on the version information, so that a module version corresponding to the configuration module is obtained. For example, modifying the module directory name of the module 1 copied into the version library directory to 1.0.1 can obtain the 1.0.1 version of the module 1; the 1.2.1 version of the module 1 can be obtained by modifying the module directory name of the module 1 copied into the version library directory to 1.2.1.
In one possible implementation manner, as shown in fig. 7, after the step of packaging the configuration modules in the configuration catalog based on the module information and the version information to obtain the module versions corresponding to the configuration modules, the following steps are included.
401, responding to a configuration setting request of a target service, and acquiring first module information, first version information and gray information corresponding to the target service;
402, adding a service environment catalog corresponding to a target service under a pre-constructed service configuration catalog based on gray information;
403, determining a first module version corresponding to the service environment directory from the version library directory based on the first module information and the first version information;
404, based on the first module version, establishing a reference relationship between the service environment directory and the module version in the version library directory.
With continued reference to fig. 1, when a service administrator needs to set a version of a service system configuration for a target service, a configuration setting request may be sent to a computer device (such as a configuration compiling cluster) through a configuration management website and a configuration version management module interface.
After receiving a configuration setting request for a target service sent by a service manager, the computer equipment responds to the configuration setting request to acquire first module information, first version information and gray information corresponding to the target service, and adds service environment information corresponding to the target service under a service configuration directory based on the gray information. For example, if the gray information of the service a includes a gray machine list, adding a service a formal environment directory and a service a gray environment directory in the service configuration directory; in another example, the gray level information of the service B does not include the gray level machine list, and the service B formal environment directory is added only under the service configuration directory.
The first module version is a module version matched with the first module information and the first version information in the version library catalog, and after the service environment catalog corresponding to the target service is added under the service configuration catalog, the first module version corresponding to the service environment catalog is determined from the version library catalog based on the first module information and the first version information. For example, with continued reference to fig. 2, the first module version corresponding to the service a formal environment directory is version 1.0.1 of module 1 and version 1.0.2 of module 2; the first module version corresponding to the service A gray environment directory is 1.2.1 version of the module 1 and 1.0.2 version of the module 2.
Establishing a reference relationship between the service environment directory and the module version in the version library directory based on the first module version refers to establishing a reference relationship between the service environment directory and the first module version in the version library directory, for example, establishing a reference relationship between the service a formal environment directory and the 1.0.1 version of module 1 and the 1.0.2 version of module 2 through a soft chain, and establishing a reference relationship between the service a gray environment directory and the 1.2.1 version of module 1 and the 1.0.2 version of module 2 through a soft chain.
In one possible implementation manner, as shown in fig. 8, after the step of establishing the reference relationship between the service environment directory and the module version in the version library directory based on the first module version, the method includes:
501, responding to a configuration rollback request of a target service, and acquiring second configuration module information and second configuration version information corresponding to the target service;
502, determining a second module version corresponding to the service environment directory from the version library directory based on the second configuration module information and the second configuration version information;
503, adjusting the reference relation between the service environment catalog and the module version in the version library catalog based on the second module version.
The second module version is a module version matched with the second module information and the second version information in the version library catalogue.
When a service manager needs to reset a module version and a gray machine for a target service, a configuration setting request can be sent to a configuration compiling cluster through a configuration management website and a configuration version management module interface, the configuration compiling cluster can respond to a configuration rollback request of the target service, second configuration module information and second configuration version information corresponding to the target service are obtained, a second module version corresponding to a service environment directory is determined from the version library directory based on the second configuration module information and the second configuration version information, and a reference relation between the service environment directory and the module version in the version library directory is adjusted based on the second module version. That is, after configuration rollback, the reference relationship between the service environment directory and the first module version is changed to the reference relationship between the service environment directory and the second module version.
For example, a reference relationship is established between the service a formal environment directory and the 1.0.1 version of the module 1 and the 1.0.2 version of the module 2 through a soft chain, and when the second module version corresponding to the service a formal environment directory is determined to be the 1.2.1 version of the module 1 and the 1.0.2 version of the module 2, the reference relationship between the service a formal environment directory and the 1.0.1 version of the module 1 and the 1.0.2 version of the module 2 is canceled, and the reference relationship between the service a formal environment directory and the 1.2.1 version of the module 1 and the 1.0.2 version of the module 2 is established.
After the computer device obtains the gray information corresponding to the target service in step 401, the gray information is stored in the database, after receiving the configuration rollback request of the target service in step 501, the computer device also obtains the updated gray information corresponding to the target service, stores the updated gray information in the database, and deletes the gray information corresponding to the target service stored in the database, thereby realizing the update of the gray information corresponding to the target service.
It should be noted that, in the existing system configuration mode based on the system configuration tool, in the multi-system compatible scenario, once the configuration of a certain system has a problem, all the systems need to be configured and rolled back, for example, a certain configuration needs to be compatible with a system such as Debian, freeBSD, centos, ubuntu, and when the configuration of a Debian system has a problem, the systems such as Debian, freeBSD, centos, ubuntu need to be configured and rolled back, so that the problem configuration cannot be rolled back quickly and effectively. According to the embodiment, the quick rollback of the system configuration according to the service dimension is supported according to the service dimension isolation configuration, the abnormal configuration can be quickly recovered, and the configuration stability is ensured.
All the above technical solutions may be combined to form an optional embodiment of the present application, which is not described here in detail.
In order to facilitate better implementation of the system configuration method of the embodiment of the application, the embodiment of the application also provides a system configuration device. Referring to fig. 9, fig. 9 is a schematic structural diagram of a system configuration device according to an embodiment of the present application. The system configuration device may include a first response module 601, a configuration determination module 602, a configuration compiling module 603, and a configuration validation module 604.
The first response module 601 is configured to respond to a configuration acquisition request of a target machine, and acquire a target service corresponding to the target machine.
The configuration determining module 602 is configured to determine, based on the target service, a target module version corresponding to the target machine.
In one embodiment, when the configuration determining module 602 performs the step of determining the target module version corresponding to the target machine based on the target service, the configuration determining module specifically performs: determining service environment information corresponding to a target machine based on a target service; and determining a target module version corresponding to the target machine based on the target service and service environment information.
In one embodiment, when the configuration determining module 602 performs the step of determining service environment information corresponding to the target machine based on the target service, the configuration determining module specifically performs: acquiring gray information corresponding to a target service, and matching a target machine with the gray information; when the target machine is matched with the gray information, determining that the service environment information corresponding to the target machine is a gray environment; and when the target machine is not matched with the gray information, determining the service environment information corresponding to the target machine as a formal environment.
In one embodiment, the configuration determining module 602 specifically performs, when performing the step of determining the target module version corresponding to the target machine based on the target service and service environment information: based on the target service, acquiring a plurality of candidate environment directories corresponding to the target machine from a service configuration directory constructed in advance; determining a target environment catalog corresponding to the target machine from a plurality of candidate environment catalogs based on the service environment information; and determining a target module version corresponding to the target machine based on a reference relation between the target environment directory and the module version in the pre-constructed version library directory.
And the configuration compiling module 603 is configured to compile the target module version to obtain configuration information corresponding to the target machine.
The configuration validation module 604 is configured to send configuration information to the target machine, so that the target machine performs a system configuration operation based on the configuration information.
In an embodiment, the system configuration device further includes:
the second response module is used for responding to the configuration submitting request and acquiring the configuration module;
and the configuration storage module is used for storing the configuration module into a pre-constructed configuration catalog.
In an embodiment, the system configuration device further includes:
The third response module is used for responding to the module packaging request and acquiring module information and version information;
and the configuration packaging module is used for packaging the configuration modules in the configuration catalog based on the module information and the version information so as to obtain the module versions corresponding to the configuration modules.
In an embodiment, when the configuration packaging module performs the step of packaging the configuration module in the configuration catalog based on the module information and the version information to obtain the module version corresponding to the configuration module, the configuration packaging module specifically performs: based on the module information, acquiring a configuration module to be packaged from a configuration catalog; copying the configuration module to be packaged into a version library catalog constructed in advance; and modifying the module directory names of the configuration modules to be packaged, which are copied to the version library directory, based on the version information so as to obtain the corresponding module versions of the configuration modules.
In an embodiment, the system configuration device further includes:
the fourth response module is used for responding to the configuration setting request of the target service and acquiring first module information, first version information and gray information corresponding to the target service;
the catalog adding module is used for adding a service environment catalog corresponding to the target service under a pre-constructed service configuration catalog based on the gray information;
The first determining module is used for determining a first module version corresponding to the service environment catalog from the version library catalog based on the first module information and the first version information;
and the relation reference module is used for establishing a reference relation between the service environment directory and the module version in the version library directory based on the first module version.
In an embodiment, the system configuration device further includes:
the fifth response module is used for responding to the configuration rollback request of the target service and acquiring second module information and second version information corresponding to the target service;
the second determining module is used for determining a second module version corresponding to the service environment catalog from the version library catalog based on the second module information and the second version information;
and the reference adjustment module is used for adjusting the reference relation between the service environment directory and the module version in the version library directory based on the second module version.
All the above technical solutions may be combined to form an optional embodiment of the present application, which is not described here in detail.
Correspondingly, the embodiment of the application also provides computer equipment, which can be a terminal or a server. Fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application, as shown in fig. 10. The computer device 700 includes a processor 701 having one or more processing cores, a memory 702 having one or more computer readable storage media, and a computer program stored on the memory 702 and executable on the processor. The processor 701 is electrically connected to the memory 702. It will be appreciated by those skilled in the art that the computer device structure shown in the figures is not limiting of the computer device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The processor 701 is a control center of the computer device 700, connects various parts of the entire computer device 700 using various interfaces and lines, and performs various functions of the computer device 700 and processes data by running or loading software programs (computer programs) and/or modules stored in the memory 702, and calling data stored in the memory 702, thereby performing overall monitoring of the computer device 700.
In the embodiment of the present application, the processor 701 in the computer device 700 loads the instructions corresponding to the processes of one or more application programs into the memory 702 according to the following steps, and the processor 701 executes the application programs stored in the memory 702, so as to implement various functions:
responding to a configuration acquisition request of a target machine, and acquiring a target service corresponding to the target machine; determining a target module version corresponding to a target machine based on the target service; compiling the target module version to obtain configuration information corresponding to the target machine; the configuration information is sent to the target machine to cause the target machine to perform a system configuration operation based on the configuration information.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Optionally, as shown in fig. 10, the computer device 700 further includes: a touch display 703, a radio frequency circuit 704, an audio circuit 705, an input unit 706, and a power supply 707. The processor 701 is electrically connected to the touch display 703, the radio frequency circuit 704, the audio circuit 705, the input unit 706, and the power supply 707, respectively. Those skilled in the art will appreciate that the computer device structure shown in FIG. 10 is not limiting of the computer device and may include more or fewer components than shown, or may be combined with certain components, or a different arrangement of components.
The touch display 703 may be used to display a graphical user interface and receive operation instructions generated by a user acting on the graphical user interface. The touch display screen 703 may include a display panel and a touch panel. Wherein the display panel may be used to display information entered by a user or provided to a user as well as various graphical user interfaces of a computer device, which may be composed of graphics, text, icons, video, and any combination thereof. Alternatively, the display panel may be configured in the form of a liquid crystal display (LCD, liquid Crystal Display), an Organic Light-Emitting Diode (OLED), or the like. The touch panel may be used to collect touch operations on or near the user (such as operations on or near the touch panel by the user using any suitable object or accessory such as a finger, stylus, etc.), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. The touch panel may overlay the display panel, and upon detection of a touch operation thereon or thereabout, the touch panel is transferred to the processor 701 to determine the type of touch event, and the processor 701 then provides a corresponding visual output on the display panel based on the type of touch event. In the embodiment of the present application, the touch panel and the display panel may be integrated into the touch display screen 703 to implement the input and output functions. In some embodiments, however, the touch panel and the touch panel may be implemented as two separate components to perform the input and output functions. I.e. the touch display 703 may also implement an input function as part of the input unit 706.
In the embodiment of the present application, the touch display screen 703 is used for presenting a graphical user interface and receiving an operation instruction generated by a user acting on the graphical user interface.
The radio frequency circuitry 704 may be configured to transceive radio frequency signals to establish wireless communication with a network device or other computer device via wireless communication.
Audio circuitry 705 may be used to provide an audio interface between a user and a computer device through speakers, microphones, and so forth. The audio circuit 705 may transmit the received electrical signal converted from audio data to a speaker, where it is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signals into electrical signals, which are received by the audio circuit 705 and converted into audio data, which are processed by the audio data output processor 701 for transmission to, for example, another computer device via the radio frequency circuit 704, or which are output to the memory 702 for further processing. Audio circuitry 705 may also include an ear bud jack to provide communication of a peripheral headset with a computer device.
The input unit 706 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), as well as to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The power supply 707 is used to power the various components of the computer device 700. Alternatively, the power supply 707 may be logically connected to the processor 701 through a power management system, so as to perform functions of managing charging, discharging, and power consumption management through the power management system. The power supply 707 may also include one or more of any components, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown in fig. 10, the computer device 700 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, etc., which will not be described herein.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer readable storage medium having stored therein a plurality of computer programs that can be loaded by a processor to perform steps in any of the system configuration methods provided by embodiments of the present application. For example, the computer program may perform the steps of:
Responding to a configuration acquisition request of a target machine, and acquiring a target service corresponding to the target machine; determining a target module version corresponding to a target machine based on the target service; compiling the target module version to obtain configuration information corresponding to the target machine; the configuration information is sent to the target machine to cause the target machine to perform a system configuration operation based on the configuration information.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The steps in any system configuration method provided in the embodiments of the present application may be executed by the computer program stored in the storage medium, so that the beneficial effects that any system configuration method provided in the embodiments of the present application may be achieved, which are detailed in the previous embodiments and are not repeated herein.
The foregoing describes in detail a system configuration method, apparatus, computer device and storage medium provided in the embodiments of the present application, and specific examples are applied to illustrate the principles and implementation of the present application, where the foregoing examples are only used to help understand the method and core idea of the present application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.

Claims (12)

1. A system configuration method, the method comprising:
responding to a configuration acquisition request of a target machine, and acquiring a target service corresponding to the target machine;
determining a target module version corresponding to the target machine based on the target service;
compiling the target module version to obtain configuration information corresponding to the target machine;
and sending the configuration information to the target machine so that the target machine performs system configuration operation based on the configuration information.
2. The system configuration method according to claim 1, wherein the step of determining a target module version corresponding to the target machine based on the target service includes:
determining service environment information corresponding to the target machine based on the target service;
and determining a target module version corresponding to the target machine based on the target service and the service environment information.
3. The system configuration method according to claim 2, wherein the step of determining service environment information corresponding to the target machine based on the target service includes:
acquiring gray information corresponding to the target service, and matching the target machine with the gray information;
When the target machine is matched with the gray level information, determining that the service environment information corresponding to the target machine is a gray level environment;
and when the target machine is not matched with the gray information, determining that the service environment information corresponding to the target machine is a formal environment.
4. The system configuration method according to claim 2, wherein the step of determining a target module version corresponding to the target machine based on the target service and the service environment information includes:
based on the target service, acquiring a plurality of candidate environment catalogs corresponding to the target machine from a service configuration catalog constructed in advance;
determining a target environment catalog corresponding to the target machine from the plurality of candidate environment catalogs based on the service environment information;
and determining a target module version corresponding to the target machine based on a reference relation between the target environment directory and the module version in the pre-constructed version library directory.
5. The system configuration method according to claim 1, wherein before the step of determining a target module version corresponding to the target machine based on the target service, the method comprises:
Responding to a configuration submitting request, and acquiring a configuration module;
and storing the configuration module into a pre-constructed configuration catalog.
6. The system configuration method according to claim 5, wherein after the step of saving the configuration module in a pre-built configuration catalog, comprising:
responding to the module packaging request, and acquiring module information and version information;
and packaging the configuration modules in the configuration catalog based on the module information and the version information to obtain module versions corresponding to the configuration modules.
7. The system configuration method according to claim 6, wherein the step of packaging the configuration modules in the configuration catalog based on the module information and the version information to obtain the module versions corresponding to the configuration modules includes:
based on the module information, acquiring a configuration module to be packaged from the configuration catalog;
copying the configuration module to be packaged into a version library catalog constructed in advance;
and modifying the module directory names of the configuration modules to be packaged, which are copied to the version library directory, based on the version information so as to obtain the module versions corresponding to the configuration modules.
8. The system configuration method according to claim 7, wherein after the step of packaging the configuration modules in the configuration catalog based on the module information and the version information to obtain the module versions corresponding to the configuration modules, the method comprises:
responding to a configuration setting request of a target service, and acquiring first module information, first version information and gray information corresponding to the target service;
based on the gray information, adding a service environment catalog corresponding to the target service under a pre-constructed service configuration catalog;
determining a first module version corresponding to the service environment directory from the version library directory based on the first module information and the first version information;
and establishing a reference relation between the service environment directory and the module version in the version library directory based on the first module version.
9. The system configuration method according to claim 8, wherein after the step of establishing a reference relationship between the service environment directory and the module versions in the version library directory based on the first module version, the method comprises:
responding to the configuration rollback request of the target service, and acquiring second module information and second version information corresponding to the target service;
Determining a second module version corresponding to the service environment directory from the version library directory based on the second module information and the second version information;
and adjusting the reference relation between the service environment directory and the module version in the version library directory based on the second module version.
10. A system configuration apparatus, characterized in that the system configuration apparatus comprises:
the first response module is used for responding to a configuration acquisition request of a target machine and acquiring a target service corresponding to the target machine;
the configuration determining module is used for determining a target module version corresponding to the target machine based on the target service;
the configuration compiling module is used for compiling the target module version to obtain configuration information corresponding to the target machine;
and the configuration validation module is used for sending the configuration information to the target machine so that the target machine can execute system configuration operation based on the configuration information.
11. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program adapted to be loaded by a processor for performing the steps in the system configuration method according to any of the claims 1-9.
12. A computer device, characterized in that it comprises a memory in which a computer program is stored and a processor which performs the steps in the system configuration method according to any one of claims 1-9 by calling the computer program stored in the memory.
CN202311543649.3A 2023-11-16 2023-11-16 System configuration method, device, computer equipment and storage medium Pending CN117519778A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311543649.3A CN117519778A (en) 2023-11-16 2023-11-16 System configuration method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311543649.3A CN117519778A (en) 2023-11-16 2023-11-16 System configuration method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117519778A true CN117519778A (en) 2024-02-06

Family

ID=89764061

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311543649.3A Pending CN117519778A (en) 2023-11-16 2023-11-16 System configuration method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117519778A (en)

Similar Documents

Publication Publication Date Title
CN102804132B (en) Catalog-based software component management
CN106502703B (en) Function calling method and device
CN112162795B (en) Plug-in starting method and device, computer equipment and storage medium
US9747449B2 (en) Method and device for preventing application in an operating system from being uninstalled
CN114205365B (en) Application interface migration system, method and related equipment
CN113034189A (en) Attribution method, attribution device, computer equipment and storage medium
CN110574006B (en) System and method for automatically synchronizing responses and conditions on a device
CN112650804B (en) Big data access method, device, system and storage medium
CN114042310A (en) Game operation data collection method and device, computer equipment and storage medium
CN113220366A (en) Sub-application starting method and device, terminal and server
CN111090442A (en) Application updating method and device and storage medium
CN117519778A (en) System configuration method, device, computer equipment and storage medium
CN114676371A (en) Page element information replacement method and device, computer equipment and storage medium
CN113742716A (en) Code running method, device, electronic equipment, storage medium and program product
CN112426722A (en) Node map hot updating method and device, storage medium and computer equipment
CN114422535B (en) Method, apparatus, computer device and storage medium for distributing contracts in blockchain
EP3872630A2 (en) Request processing method and apparatus, electronic device, and computer storage medium
CN115858652A (en) Data conversion method and device, computer equipment and storage medium
CN116578546A (en) Data processing method, system, device and storage medium based on database
CN114217833A (en) Application updating method and device, computer equipment and computer-readable storage medium
CN116028099A (en) Method for generating installation package, related device, equipment and storage medium
CN116450598A (en) Resource data processing method and device, electronic equipment and storage medium
CN117640160A (en) Security identification method, device, equipment and storage medium for access request
CN114138721A (en) Junk file processing method and device, computer equipment and storage medium
CN115587035A (en) Source code debugging method and device, storage medium and computer equipment

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