Method, device, electronic equipment and storage medium for deploying domain name resolution service
By using Ansible tools and RPM package management, the deployment of domain name resolution service components is automated, solving the cumbersome and time-consuming deployment problems in existing technologies and achieving efficient and reliable deployment and monitoring of domain name resolution services.
Patent Information
- Application Number
- CN202211666464.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-23
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2042-12-23
AI Technical Summary
In existing technologies, the clustering or multi-machine miniaturized deployment of domain name resolution services is cumbersome, time-consuming, and costly, making it difficult to achieve efficient and automated deployment.
Ansible automated operation and maintenance tools are used, based on RPM packages and yum repository management, to generate and install domain name resolution service components. The deployment is automated through monitoring scripts and configuration files, including the configuration and initialization of components such as nginx, named, fast_cgi, and BGP.
It enables automated deployment of domain name resolution services, improves deployment efficiency, reduces human intervention, lowers the risk of deployment failure, supports batch deployment and scheduled monitoring, and improves deployment success rate.
Smart Images

Figure CN116248506B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a method and device for deploying domain name resolution service, electronic equipment and storage medium. BACKGROUND
[0002] Diversified system deployment refers to deploying a business system on a required operating system. When deploying multiple devices, the deployment work is relatively complicated. Manual deployment is time-consuming and laborious, and the deployment effect is usually difficult to achieve the expected result.
[0003] Domain name resolution service usually needs to be deployed in clusters or multiple small devices. In the deployment process, it is inevitable to have complicated installation steps, operate multiple to-be-deployed nodes, and have difficult-to-troubleshoot deployment problems, which have the disadvantages of long time consumption, complicated process, high cost, etc. SUMMARY
[0004] In view of the above problems, the embodiments of the present application provide a method and device for deploying domain name resolution service, electronic equipment and storage medium, so as to overcome the above problems or at least partially solve the above problems.
[0005] The first aspect of the embodiments of the present application provides a method for deploying domain name resolution service, comprising:
[0006] According to the processor architecture and kernel version of the target server, an rpm package is generated and uploaded to a yum source, wherein the target server is a server to be deployed for domain name resolution service;
[0007] Select a deployment node, and add the IP address, hostname host name and login password information of the target server to the hosts file of the deployment node;
[0008] According to the yum source, each service relied on by the domain name resolution service is installed on the target server;
[0009] Based on the ansible var variable file and the template template file, a network configuration file is generated and run;
[0010] Run a monitoring script, which includes a domain name resolution service running monitoring script, a compressed log monitoring script and a timing log cleaning script;
[0011] In the case that the domain name resolution service running monitoring script queries the network configuration file, the pretreatment before starting the domain name resolution service is started;
[0012] Start the nginx component process, and specify the config file and log saving path;
[0013] Generating a fast_cgi component configuration file, starting a fast_cgi component process;
[0014] In response to monitoring that there is a network configuration file, starting a named component process;
[0015] Configuring the interface IP address, route and vxlan.
[0016] Optionally, the pre-processing before starting the domain name resolution service includes:
[0017] Adding the domain name resolution service bin file path to the PATH environment variable;
[0018] Updating the number of target servers to the network configuration file;
[0019] Generating a named component soft link;
[0020] Updating the network configuration file according to the network parameters in the network configuration file;
[0021] Obtaining the network card type and network card pci, and updating the network configuration file;
[0022] Generating BGP neighbor information.
[0023] Optionally, the starting named component process includes:
[0024] Using the nginx component to collect the configuration information issued by the controller, and forwarding the configuration information to the fast_cgi component;
[0025] Saving the configuration information processed by the fast_cgi component as a network configuration file;
[0026] Generating a quagga configuration file, and starting a BGP process;
[0027] Initializing dpdk;
[0028] Generating a named component configuration file, and starting the named component process.
[0029] Optionally, the number of target servers is multiple, and the target servers support SSH service; the adding of the IP address, hostname host name and login password information of the target servers to the hosts file of the deployment node includes:
[0030] Adding the IP address, hostname host name and login password information of each of the multiple target servers to the hosts file of the deployment node.
[0031] Optionally, the rpm package comprises: domain name resolution system component bin files, dpdk driver files, script files required in the deployment process, and default configuration files of each component.
[0032] Optionally, it further comprises:
[0033] Through a crontab timing task, the running conditions of each component of the domain name resolution service are cyclically executed, and the running conditions comprise network configuration updates, component process startup times, and whether abnormal suspension occurs during running.
[0034] Optionally, it further comprises:
[0035] According to the processor architecture and the network card category of the target server, an rpm upgrade package is generated, and the rpm upgrade package is uploaded to the yum source;
[0036] The fast_cgi component process, the named component process, and the BGP process are closed;
[0037] The rpm upgrade package is installed from the yum source based on an ansible-playbook script file;
[0038] Each component process is restarted.
[0039] Optionally, it further comprises:
[0040] The old version rpm package to be rolled back is uploaded to the yum source;
[0041] The fast_cgi component process, the named component process, and the BGP process are closed;
[0042] The old version rpm package to be rolled back is installed from the yum source based on an ansible-playbook script file;
[0043] Each component process is restarted.
[0044] Optionally, it further comprises:
[0045] An uninstall domain name resolution service operation is performed based on an ansible-playbook script file;
[0046] The fast_cgi component process, the named component process, and the BGP process are closed;
[0047] The network card is unbound, and the installed dpdk driver is uninstalled;
[0048] Files created by the domain name resolution service during running are deleted, and resources are recycled.
[0049] Optionally, the processor architecture of the target server comprises: X86 or ARM.
[0050] In a second aspect, the application provides a device for deploying a domain name resolution service, comprising:
[0051] an uploading module configured to generate an rpm package according to a processor architecture and a kernel version of a target server, and upload the rpm package to a yum source, wherein the target server is a server to which the domain name resolution service is to be deployed;
[0052] a selecting module configured to select a deployment node, and add an IP address, a hostname and a login password of the target server to a hosts file of the deployment node;
[0053] an installing module configured to install various services relied on by the domain name resolution service on the target server according to the yum source;
[0054] a generating module configured to generate and run a network configuration file based on an ansible var variable file and a template file;
[0055] a running module configured to run a monitoring script, wherein the monitoring script comprises a domain name resolution service running monitoring script, a compressed log monitoring script and a log cleaning script;
[0056] a first starting module configured to start a pre-process before the domain name resolution service when the domain name resolution service running monitoring script queries the network configuration file;
[0057] a specifying module configured to start an nginx component process, and specify a config file and a log saving path;
[0058] a second starting module configured to generate a fast_cgi component configuration file, and start a fast_cgi component process;
[0059] a third starting module configured to start a named component process in response to monitoring that the network configuration file exists;
[0060] a configuring module configured to configure an interface IP address, a route and a vxlan.
[0061] Optionally, the first starting module comprises:
[0062] an adding unit configured to add a bin file path of the domain name resolution service to a PATH environment variable;
[0063] a first updating unit configured to update a number of the target servers to the network configuration file;
[0064] The soft connection generating unit is configured to generate a named component soft link.
[0065] The second updating unit is configured to update the network configuration file according to network parameters in the network configuration file.
[0066] The third updating unit is configured to obtain a network card type and a network card PCI, and update the network configuration file.
[0067] The generating unit is configured to generate BGP neighbor information.
[0068] In a third aspect, an electronic device is provided, including: a processor; a memory for storing instructions executable by the processor; and wherein the processor is configured to execute the instructions to implement the method for deploying a domain name resolution service according to the first aspect.
[0069] In a fourth aspect, a computer-readable storage medium is provided, and when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method for deploying a domain name resolution service according to the first aspect.
[0070] In a fifth aspect, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method for deploying a domain name resolution service according to the first aspect is implemented.
[0071] The embodiments of the present application have the following advantages:
[0072] In the embodiment, the network basic configuration file is generated based on an ansible var variable file and a template file; the rpm package of the domain name resolution service is obtained from a yum source, and the rpm package of the domain name resolution service, the service relied on by the domain name resolution service, and the running monitoring script of the domain name resolution service are installed; the dpdk driver installation, the large page memory setting, the network card binding, and the generation of the configuration file of each component of the domain name resolution service are completed through the timing task of executing the running monitoring script of the domain name resolution service, and the processes of each component of the domain name resolution service are started. In this way, the automatic deployment of the domain name resolution service is realized, and the problems of long time consumption, complicated process, high cost and the like in manual deployment are solved. BRIEF DESCRIPTION OF DRAWINGS
[0073] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.
[0074] Figure 1 is a step flow chart of a method for deploying domain name resolution service in the embodiments of the present application;
[0075] Figure 2 is an architecture diagram of various components in the embodiments of the present application;
[0076] Figure 3 is a flow diagram of automatic deployment in the embodiments of the present application;
[0077] Figure 4 is a monitoring automatic script execution flow in the embodiments of the present application;
[0078] Figure 5 is a block diagram of an apparatus for deploying domain name resolution service in the embodiments of the present application. DETAILED DESCRIPTION
[0079] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the following will further describe the present application in combination with the drawings and specific embodiments.
[0080] Domain name resolution is a service of pointing domain name to website space IP address (Internet Protocol Address, Internet Protocol Address) so that users can conveniently access the website through the registered domain name. IP address is a digital address for identifying sites on the network, and domain name is used to replace IP address to identify site address for the convenience of memory. Domain name resolution is the conversion process from domain name to IP address. The resolution of domain name can be completed by DNS (Domain Name System, Domain Name System) server. Domain name resolution is also called domain name pointing, server setting, domain name configuration and reverse IP registration, etc.
[0081] In the deployment process, the executable file of the service needs to be uploaded, the configuration file needs to be modified, and the related services need to be started in sequence. The complex system needs many steps in deployment, and small mistakes can lead to the failure of the whole deployment.
[0082] Ansible is a lightweight automation tool that combines the advantages of many operation and maintenance tools, and realizes functions such as batch system configuration, batch program deployment, and batch command running. Only a server needs to be deployed as a service end to control all server nodes in the cluster, and other server nodes controlled only need to support the SSH (Secure Shell) protocol. Ansible's script execution returns operation logs to the server control node for each step, which can help users judge the execution result and find problems in the deployment process in a timely manner.
[0083] The domain name resolution service involves multiple components such as nginx (a high-performance HTTP and reverse proxy web server), named (a domain name resolution service process), fast_cgi (a scalable and high-speed interface for communication between HTTP servers and dynamic script languages), BGP (a distance vector-based routing protocol), and the deployment process involves multiple steps such as configuration file generation, dpdk (Intel data plane development kit, an Intel-provided data plane development toolset) driver installation, large page memory setting, and network card binding. The process is complex and prone to errors. Moreover, the domain name resolution service often needs to be deployed on multiple devices, and manual deployment is even more difficult. Therefore, it is imperative to improve deployment efficiency, reduce human intervention, and avoid the possibility of deployment success rate being low due to human error in detail operation.
[0084] Referring to Figure 1 As shown in the figure, a method for deploying a domain name resolution service in an embodiment of the application is shown, as shown in Figure 1 The method for deploying a domain name resolution service can specifically include steps S101-S110.
[0085] Step S101: According to the processor architecture and kernel version of the target server, an rpm package is generated, and the rpm package is uploaded to the yum source, wherein the target server is a server to be deployed for domain name resolution service;
[0086] Step S102: Select a deployment node, and add the IP address, hostname, and login password information of the target server to the hosts file of the deployment node;
[0087] Step S103: According to the yum source, install each service dependent on the domain name resolution service on the target server;
[0088] Step S104: Based on the ansible var variable file and the template template file, a network configuration file is generated and run.
[0089] Step S105: running a monitoring script, the monitoring script including a domain name resolution service running monitoring script, a compression log monitoring script and a timing log cleaning script;
[0090] Step S106: in the case that the domain name resolution service running monitoring script queries the network configuration file, starting pre-processing before the domain name resolution service;
[0091] Step S107: starting an nginx component process, specifying a config file and a log saving path;
[0092] Step S108: generating a fast_cgi component configuration file, and starting a fast_cgi component process;
[0093] Step S109: in response to monitoring that there is a network configuration file, starting a named component process;
[0094] Step S110: configuring an interface IP address, a route and a vxlan.
[0095] The processor architecture of the target server can include X86 or ARM.
[0096] The rpm (Red-Hat Package Manager) package contains executable files of each component of the domain name resolution service, dpdk driver files, default configuration files required for starting each component and shell script files used for monitoring the domain name resolution service subsequently.
[0097] The Yum source (Yellow dog Updater, Modifier) is a free and open source command line package management tool based on rpm package management, capable of automatically downloading rpm packages from a specified server and installing, capable of automatically handling dependency relationships and installing all dependent software packages at one time without tedious downloading and installation one by one.
[0098] The deployment node can be any server selected by the backend. The target server supports the SSH protocol and executes an ansible deployment playbook script.
[0099] Hosts is a system file without extension, which can be opened by tools such as Notepad, and its function is to establish a "database" of some commonly used website domain names and their corresponding IP addresses. When the user inputs a website address that needs to be logged in in the browser, the system will first automatically find the corresponding IP address from the Hosts file. Once found, the system will immediately open the corresponding webpage. If not found, the system will then submit the website address to the DNS domain name resolution server for IP address resolution.
[0100] Download the rpm package from the yum source, and install the services that the domain name resolution server depends on according to the shell script in the rpm package, including the components that the domain name resolution server depends on. If the installation is not successful, return an error message.
[0101] The network configuration file is the configuration file required for the operation of the domain name resolution service components. After the domain name resolution service is successfully installed, the domain name resolution service operation monitoring script is installed based on the ansible-playbook script. The compressed log monitoring script can be added to the scheduled task, the log cleaning script can be added to the scheduled task, and the domain name resolution service operation monitoring script can be added to the scheduled task.
[0102] The domain name resolution service monitoring script queries the network basic configuration temporary file, and performs preprocessing before starting the domain name resolution service. Optionally, the domain name resolution service preprocessing includes: adding the domain name resolution service bin file (binary file) path to the PATH environment variable; updating the number of target servers to the network configuration file; generating a named component soft link; updating the network configuration file according to the network parameters in the network configuration file; obtaining the network card type and network card pci, and updating the network configuration file; generating BGP neighbor information.
[0103] PATH is the search path of device executable files. The target server is a node to be deployed, which can be multiple, and the target server supports SSH service. In the case of multiple target servers, the IP addresses, hostname hostnames and login password information of multiple target servers need to be added to the hosts file of the deployment node.
[0104] Soft link, also called symbolic link, is a file containing the path name of another file. It can be any file or directory, and it can link files in different file systems. PCI (Peripheral Component Interconnect) is a standard for defining local buses. This standard allows up to 10 PCI-compliant expansion cards to be installed in a computer. Border Gateway Protocol (BGP) is an autonomous system routing protocol running on TCP. BGP is the only protocol used to handle networks as large as the Internet, and it is the only protocol that can properly handle multiple connections between unrelated routing domains. The main function of the BGP system is to exchange network reachability information with other BGP systems. Network reachability information includes information about listed autonomous systems (AS).
[0105] config is a Web configuration command used by the web browser to pass information to the JSP page when initializing. log is a log, which is a record of a certain process that has been completed. vxlan is a network virtualization tunnel communication technology that can improve the expansion problem of large cloud computing when deployed, and is an extension of VLAN.
[0106] Monitor whether there is a network configuration (inboud / outbound network configuration) file, if there is, start the named process. Start the named component process, including: using the nginx component to collect the configuration information issued by the controller, and forwarding the configuration information to the fast_cgi component; save the configuration information processed by the fast_cgi component as a network configuration file; generate a quagga configuration file and start a BGP process; initialize dpdk; generate a named component configuration file and start the named component process.
[0107] Optionally, the running status of each component of the domain name resolution service can be cyclically monitored by a crontab timing task, the running status including network configuration update, component process startup time, and whether an abnormal suspension occurs during running. The crontab command is used to set instructions that are executed periodically.
[0108] Optionally, the domain name resolution system can also be upgraded, downgraded, and uninstalled based on shell scripts and ansible-playbook scripts.
[0109] The domain name resolution system can be upgraded by the following steps: generating an rpm upgrade package according to the processor architecture and network card category of the target server, and uploading the rpm upgrade package to the yum source; closing the fast_cgi component process, the named component process and the BGP process; installing the rpm upgrade package from the yum source based on the ansible-playbook script file; and restarting each component process.
[0110] The domain name resolution system can be downgraded by the following steps: uploading an old version rpm package to be rolled back to the yum source; closing the fast_cgi component process, the named component process and the BGP process; installing the old version rpm package to be rolled back from the yum source based on the ansible-playbook script file; and restarting each component process.
[0111] The domain name resolution system can be uninstalled by the following steps: performing an uninstall domain name resolution service operation based on the ansible-playbook script file; closing the fast_cgi component process, the named component process and the BGP process; unbinding the network card and uninstalling the installed dpdk driver; and deleting the files created by the domain name resolution service and recycling resources.
[0112] Figure 2 is the architecture diagram of each component in the embodiment of the application. The control plane includes a fast_cgi component and a nginx component, the data plane includes a routing component and a named component, and in addition, a monitoring automation script component is further included.
[0113] Figure 3 is the flowchart of the automatic deployment in the embodiment of the application. An rpm package is generated based on the chip architecture of the target server and uploaded to the yum source, wherein the chip architecture of the target server includes ARM and X86. The ansible hosts file is modified, and the IP, host hostname and login information of all to-be-deployed nodes are added to the hosts file, wherein the to-be-deployed node is the target server. The target deployment node installs the services relied on by the domain name resolution service, and if the installation is unsuccessful, error information is printed and the process is exited. Network configuration files are generated in combination with the ansible var file and the template, and in subsequent scheduled tasks, the domain name resolution service monitors whether there is the file. The domain name resolution service is installed through a yum command. The domain name resolution service monitoring script is installed, and scheduled tasks are added: a log compression monitoring script, a log scheduled cleaning monitoring script and a domain name resolution service monitoring script.
[0114] Figure 4Is the monitoring automation script execution process in the embodiment of the application. In the case of network basis configuration temporary file, preprocessing is carried out. The dns_fcgi configuration file is generated, the dns_fcgi process is started, and the nginx process is started. In the case of no deployment, it is judged whether there is network configuration issuing. In the case of network configuration issuing, the network configuration file is generated, the quaqga configuration file is generated, the bgp process is started, the dpdk related operation is carried out, the network card is taken over, the named process is started, and the route, interface and vxlan are configured.
[0115] The embodiment of the application provides a method and system for automatically deploying a domain name resolution service based on ansible, aiming at solving the problems of low efficiency, difficult maintenance, low deployment success rate and inability to batch deploy in the traditional deployment mode of the domain name resolution service. Batch deployment of the domain name resolution service can be realized, and the running status of the domain name resolution service can be monitored based on a timing monitoring script, log information can be periodically compressed and saved and cleaned up, and the process can be quickly restarted when it is abnormally suspended.
[0116] It should be noted that, for the method embodiment, in order to simply describe, it is expressed as a series of action combinations, but those skilled in the art should know that the embodiment of the application is not limited by the described action sequence, because according to the embodiment of the application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions involved are not necessarily necessary for the embodiment of the application.
[0117] Figure 5 Is a structure schematic diagram of the device for deploying a domain name resolution service according to the embodiment of the application, as shown in Figure 5 The device comprises an uploading module, a selecting module, an installing module, a generating module, a running module, a first starting module, a specifying module, a second starting module, a third starting module and a configuring module, wherein:
[0118] The uploading module is used for generating an rpm package according to the processor architecture and the kernel version of a target server, and uploading the rpm package to a yum source, wherein the target server is a server to be deployed with the domain name resolution service.
[0119] The selecting module is used for selecting a deployment node, and adding the IP address, hostname and login password information of the target server to the hosts file of the deployment node.
[0120] The installing module is used for installing each service relied on by the domain name resolution service on the target server according to the yum source.
[0121] The generating module is configured to generate and run a network configuration file based on an ansible var variable file and a template file;
[0122] The running module is configured to run a monitoring script, which includes a domain name resolution service running monitoring script, a compression log monitoring script and a timing log cleaning script;
[0123] The first starting module is configured to start a pre-process before the domain name resolution service in a case where the network configuration file is queried by the domain name resolution service running monitoring script;
[0124] The specifying module is configured to start an nginx component process, and specify a config file and a log saving path;
[0125] The second starting module is configured to generate a fast_cgi component configuration file, and start a fast_cgi component process;
[0126] The third starting module is configured to start a named component process in response to monitoring that the network configuration file exists;
[0127] The configuration module is configured to configure an interface IP address, a route and a vxlan.
[0128] Optionally, the first starting module includes:
[0129] The adding unit is configured to add the domain name resolution service bin file path to a PATH environment variable;
[0130] The first updating unit is configured to update the number of target servers to the network configuration file;
[0131] The soft link generating unit is configured to generate a named component soft link;
[0132] The second updating unit is configured to update the network configuration file according to network parameters in the network configuration file;
[0133] The third updating unit is configured to obtain a network card type and a network card PCI, and update the network configuration file;
[0134] The generating unit is configured to generate BGP neighbor information.
[0135] Optionally, the third starting module includes:
[0136] The forwarding unit is configured to collect configuration information issued by a controller by using the nginx component, and forward the configuration information to the fast_cgi component;
[0137] A storage unit is configured to store the configuration information processed by the fast_cgi component as a network configuration file.
[0138] A BGP process starting unit is configured to generate a quagga configuration file and start a BGP process.
[0139] An initialization unit is configured to initialize the dpdk.
[0140] A named component process starting unit is configured to generate a named component configuration file and start the named component process.
[0141] Optionally, the target servers are multiple in number and support SSH service.
[0142] An adding unit is configured to add the IP address, hostname and login password information of each target server to the hosts file of the deployment node.
[0143] Optionally, the rpm package includes bin files of each component of the domain name resolution system, dpdk driver files, script files required in the deployment process and default configuration files of each component.
[0144] Optionally, the method further comprises:
[0145] A loop execution module is configured to execute the running status of each component of the domain name resolution service through a crontab timing task, wherein the running status includes the update of network configuration, the starting time of each component process and whether an abnormal suspension occurs in the running process.
[0146] Optionally, the method further comprises:
[0147] An upgrade package generation module is configured to generate an rpm upgrade package according to the processor architecture and the network card category of the target server and upload the rpm upgrade package to the yum source.
[0148] A first closing module is configured to close the fast_cgi component process, the named component process and the BGP process.
[0149] A first installation module is configured to install the rpm upgrade package from the yum source based on an ansible-playbook script file.
[0150] A first re-raising module is configured to re-raise each component process.
[0151] Optionally, the method further comprises:
[0152] A rollback uploading module is configured to upload an old version rpm package to be rolled back to the yum source;
[0153] A second closing module is configured to close the fast_cgi component process, the named component process and the BGP process.
[0154] A second installing module is configured to install the old version rpm package to be rolled back from the yum source based on an ansible-playbook script file.
[0155] A second restarting module is configured to restart the component processes.
[0156] Optionally, the method further comprises:
[0157] An uninstalling module is configured to perform an uninstalling operation of the domain name resolution service based on the ansible-playbook script file.
[0158] A third closing module is configured to close the fast_cgi component process, the named component process and the BGP process.
[0159] An unbonding module is configured to unbind the network card and uninstall the dpdk driver.
[0160] A deleting module is configured to delete files created by the domain name resolution service and recycle resources.
[0161] Optionally, the processor architecture of the target server comprises X86 or ARM.
[0162] It should be noted that the device embodiment is similar to the method embodiment, and thus the description is relatively simple, and the related parts can be referred to the method embodiment.
[0163] Each embodiment in the specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other.
[0164] Those skilled in the art should understand that the embodiments of the present embodiment can be provided as a method, a device or a computer program product. Therefore, the embodiments of the present embodiment can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present embodiment can be in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
[0165] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, electronic device and computer program products according to the embodiments of the present application. It is understood that each flow and / or block in the flowcharts and / or block diagrams, and combinations of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal devices to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal devices, create means for implementing the functions specified in the flowcharts and / or block diagrams block or blocks. Figure 1 one or more flows and / or blocks Figure 1 an apparatus with a function specified in one or more flows and / or blocks.
[0166] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal devices to work in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction apparatus that implements the functions specified in the flowcharts and / or block diagrams block or blocks. Figure 1 one or more flows and / or blocks Figure 1 an apparatus with a function specified in one or more flows and / or blocks.
[0167] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, so that a series of operation steps are performed on the computer or other programmable terminal device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in the flowcharts and / or block diagrams block or blocks. Figure 1 one or more flows and / or blocks Figure 1 an apparatus with a function specified in one or more flows and / or blocks.
[0168] Although the preferred embodiments of the embodiments of the present application have been described, those skilled in the art can make further changes and modifications to these embodiments once they know the basic inventive concept. Therefore, the appended claims are intended to be interpreted as including all the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present application.
[0169] Finally, it is to be understood that the phraseology or terminology such as "first" and "second" etc. used herein is merely intended to differentiate one entity or operation from another entity or operation, without necessarily requiring or implying any actual such relationship or order between such entities or operations. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0170] The above describes in detail the method, device, electronic device and storage medium for deploying a domain name resolution service provided by the present application. The principles and implementation manners of the present application are described by using specific examples. The above description of the embodiments is only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, the specific implementation manners and application ranges can be changed according to the idea of the present application. In summary, the content of the specification should not be understood as a limitation of the present application.
Claims
1. A method of deploying a domain name resolution service, characterized by, The method comprises the following steps: According to the processor architecture and kernel version of the target server, an rpm package is generated and uploaded to a yum source, wherein the target server is a server to be deployed with a domain name resolution service; Selecting a deployment node, adding the IP address, hostname, and login password information of the target server to the hosts file of the deployment node; According to the yum source, installing each service relied on by the domain name resolution service on the target server; Based on the ansible var variable file and the template template file, a network configuration file is generated and run; Running a monitoring script, which includes a domain name resolution service running monitoring script, a compressed log monitoring script, and a scheduled log cleaning script; In the case where the domain name resolution service running monitoring script queries the network configuration file, starting the pre-processing before starting the domain name resolution service; Starting the nginx component process, specifying the config file and log saving path; Generating a fast_cgi component configuration file and starting the fast_cgi component process; In response to monitoring the existence of a network configuration file, starting the named component process; Configuring the interface IP address, route, and vxlan; The named component process includes: Using the nginx component to collect configuration information issued by the controller and forwarding the configuration information to the fast_cgi component; Saving the configuration information processed by the fast_cgi component as a network configuration file; Generating a quagga configuration file and starting a BGP process; Initializing dpdk; Generating a named component configuration file and starting the named component process.
2. The method of claim 1, wherein, The pre-processing before starting the domain name resolution service includes: Adding the domain name resolution service bin file path to the PATH environment variable; Updating the number of target servers to the network configuration file; Generating a named component soft link; Updating the network parameters in the network configuration file; Obtaining the network card type and network card pci and updating the network configuration file; Generating BGP neighbor information.
3. The method of claim 1, wherein, The number of target servers is multiple, and the target servers support SSH service; The IP address, hostname, and login password information of the target server are added to the hosts file of the deployment node, which includes: Adding the IP address, hostname, and login password information of each of the multiple target servers to the hosts file of the deployment node.
4. The method of claim 1, wherein, The rpm package includes: domain name resolution system component bin file, dpdk driver file, script file required during deployment, and default configuration file of each component.
5. The method of claim 1, wherein, Further comprising: Through the crontab timing task, the running status of each component of the domain name resolution service is cyclically executed, including the update of the network configuration, the start time of each component process, and whether an abnormal suspension occurs during running.
6. The method of claim 1, wherein, Further comprising: According to the processor architecture and the network card category of the target server, an rpm upgrade package is generated and uploaded to the yum source; The fast_cgi component process, the named component process and the BGP process are closed; The rpm upgrade package is installed from the yum source based on an ansible-playbook script file; Each component process is restarted.
7. The method of claim 1, wherein, Further comprising: Upload an old version rpm package to be rolled back to the yum source; The fast_cgi component process, the named component process and the BGP process are closed; The old version rpm package to be rolled back is installed from the yum source based on an ansible-playbook script file; Each component process is restarted.
8. The method of claim 1, wherein, Further comprising: Perform an uninstallation domain name resolution service operation based on an ansible-playbook script file; The fast_cgi component process, the named component process and the BGP process are closed; The network card is unbound, and the installed dpdk driver is uninstalled; Files created by the domain name resolution service are deleted, and resources are recycled.
9. The method of claim 1, wherein, The processor architecture of the target server comprises X86 or ARM.
10. An apparatus for deploying a domain name resolution service, the apparatus comprising: Comprising: An upload module for generating an rpm package according to the processor architecture and the kernel version of a target server, and uploading the rpm package to a yum source, wherein the target server is a server to be deployed with a domain name resolution service; A selection module for selecting a deployment node, and adding an IP address, a hostname and a login password of the target server to a hosts file of the deployment node; An installation module for installing each service relied on by the domain name resolution service on the target server according to the yum source; A generation module for generating and running a network configuration file based on an ansible var variable file and a template file; A running module for running a monitoring script, wherein the monitoring script comprises a domain name resolution service running monitoring script, a compressed log monitoring script and a timing log cleaning script; A first starting module for starting a pre-processing before the domain name resolution service when the network configuration file is queried by the domain name resolution service running monitoring script; A specification module for starting an nginx component process, and specifying a config file and a log saving path; A second starting module for generating a fast_cgi component configuration file, and starting a fast_cgi component process; A third starting module for starting a named component process in response to monitoring that the network configuration file exists; A configuration module for configuring an interface IP address, a route and a vxlan; The third starting module comprises: A forwarding unit for collecting configuration information issued by a controller by using an nginx component, and forwarding the configuration information to a fast_cgi component; A saving unit for saving configuration information processed by the fast_cgi component as a network configuration file; The BGP process starting unit is configured to generate a quagga configuration file and start a BGP process. The initialization unit is configured to initialize the dpdk. The named component process starting unit is configured to generate a named component configuration file and start the named component process.
11. The apparatus of claim 10, wherein, The first starting module comprises: The adding unit is configured to add a domain name resolution service bin file path to a PATH environment variable. The first updating unit is configured to update the number of target servers to the network configuration file. The soft link generating unit is configured to generate a named component soft link. The second updating unit is configured to update the network configuration file according to network parameters in the network configuration file. The third updating unit is configured to obtain a network card type and a network card PCI and update the network configuration file. The generating unit is configured to generate BGP neighbor information.
12. An electronic device, comprising: Comprise: A processor; A memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method of claim 1-9.
13. A computer-readable storage medium, characterized in that, When the instructions in the computer readable storage medium are executed by the processor of the electronic device, the electronic device can execute the method of claim 1-9.
14. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the method of claim 1-9.
Citation Information
Patent Citations
Service deployment method and device and storage medium
CN111324412A
Server configuration method, device and equipment and computer readable storage medium
CN112650537A
Method and equipment for automatically building container platform based on ansible
CN114416290A