CN114189496A - IP modification method and device of cluster system and related equipment - Google Patents

IP modification method and device of cluster system and related equipment Download PDF

Info

Publication number
CN114189496A
CN114189496A CN202210139542.1A CN202210139542A CN114189496A CN 114189496 A CN114189496 A CN 114189496A CN 202210139542 A CN202210139542 A CN 202210139542A CN 114189496 A CN114189496 A CN 114189496A
Authority
CN
China
Prior art keywords
cluster
configuration file
modification
global configuration
cluster system
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
CN202210139542.1A
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210139542.1A priority Critical patent/CN114189496A/en
Publication of CN114189496A publication Critical patent/CN114189496A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The application discloses an IP (Internet protocol) modification method of a cluster system, which comprises the steps of traversing cluster components in the cluster system to generate an original global configuration file; modifying the original global configuration file by using a preset IP modification list to obtain a new global configuration file; and regenerating each cluster component according to the new global configuration file, and restarting each cluster component service. By applying the technical scheme provided by the application, the original data of the cluster system can be effectively reserved, and meanwhile, the rapid and efficient IP modification can be realized. The application also discloses an IP modifying device, equipment and a computer readable storage medium of the cluster system, which have the beneficial effects.

Description

IP modification method and device of cluster system and related equipment
Technical Field
The present application relates to the field of cluster system technologies, and in particular, to an IP modification method for a cluster system, and further, to an IP modification apparatus, a device, and a computer-readable storage medium for a cluster system.
Background
K8S (kubernets, a container orchestration scheduling engine) has become increasingly popular for its powerful function and unique design appeal. With the increasing use of K8S, such scenarios occur at the same time: the system IP needs to be modified due to the relocation of the server in the computer room, the migration of data services, the change of network planning, etc. However, since the K8S cluster contains a lot of information related to the IP, such as cluster configuration, cluster certificate, etc., the K8S cluster cannot be adaptively adjusted after the IP is modified, and thus cannot be used. At this time, software engineers often uninstall and reinstall the K8S cluster or server system, and obviously, this implementation is time-consuming, labor-consuming, difficult, and very prone to problems. In addition, unloading and reloading can also result in the original K8S data or jobs being cleaned and not retrieved.
Therefore, how to implement fast and efficient IP modification while effectively retaining original data of the cluster system is an urgent problem to be solved by those skilled in the art.
Disclosure of Invention
The method for modifying the IP of the cluster system can effectively retain original data of the cluster system and simultaneously realize quick and efficient IP modification; another object of the present application is to provide an IP modification apparatus, device and computer readable storage medium for a cluster system, all of which have the above advantages.
In a first aspect, the present application provides an IP modification method for a cluster system, including:
traversing cluster components in a cluster system to generate an original global configuration file;
modifying the original global configuration file by using a preset IP modification list to obtain a new global configuration file;
and regenerating each cluster component according to the new global configuration file, and restarting each cluster component service.
Preferably, before the modifying the original global configuration file by using the preset IP modification list and obtaining a new global configuration file, the method further includes:
judging whether cluster node modification information exists in the preset IP modification list or not;
if so, determining the cluster node to be modified according to the cluster node modification information, and modifying the current IP of the cluster node to be modified into the designated IP.
Preferably, before modifying the current IP of the cluster node to be modified to the designated IP, the method further includes:
judging whether the specified IP meets a preset format specification or not;
if not, outputting an error prompt;
and if so, executing the step of modifying the current IP of the cluster node to be modified into the specified IP.
Preferably, after the modifying the current IP of the cluster node to be modified to the designated IP, the method further includes:
restarting the network service of the cluster system, and judging whether the network service is in a normal running state or not by executing a ping command;
if not, outputting an error prompt;
and if so, executing the step of modifying the original global configuration file by utilizing a preset IP modification list.
Preferably, the regenerating each cluster component according to the new global configuration file includes:
and regenerating the ETCD certificate, the component certificate, the conf configuration file and the guide token according to the new global configuration file.
Preferably, the traversing the cluster component in the cluster system to generate the original global configuration file includes:
and traversing the cluster components in the cluster system by using a kubedm config view tool to generate the original global configuration file.
Preferably, the modifying the original global configuration file by using a preset IP modification list to obtain a new global configuration file includes:
and executing the preset IP modification list by using an ansable tool, and modifying the original global configuration file into the new global configuration file.
In a second aspect, the present application further discloses an IP modification apparatus for a cluster system, including:
the cluster component traversing module is used for traversing the cluster components in the cluster system to generate an original global configuration file;
the configuration file modification module is used for modifying the original global configuration file by utilizing a preset IP modification list to obtain a new global configuration file;
and the cluster component regeneration module is used for regenerating each cluster component according to the new global configuration file and restarting the service of each cluster component.
In a third aspect, the present application further discloses an IP modification device of a cluster system, including:
a memory for storing a computer program;
a processor for implementing the steps of any of the above-described methods for modifying an IP of a cluster system when executing the computer program.
In a fourth aspect, the present application further discloses a computer-readable storage medium having stored thereon a computer program, which when executed by a processor, implements the steps of any of the above-described methods for IP modification of a cluster system.
The IP modification method of the cluster system comprises the steps of traversing cluster components in the cluster system to generate an original global configuration file; modifying the original global configuration file by using a preset IP modification list to obtain a new global configuration file; and regenerating each cluster component according to the new global configuration file, and restarting each cluster component service.
By applying the technical scheme provided by the application, an IP modification list is created in advance for a cluster system, namely, relevant information of a cluster component needing to be subjected to IP modification is set according to actual requirements, so that after an initial global configuration file (namely, the original global configuration file) of the cluster system is obtained through traversal of the cluster component, the original global configuration file can be modified directly by using a preset IP modification list, a new global configuration file is generated, therefore, regeneration of the cluster component can be performed by using the new global configuration file, and the cluster component is subjected to self-adaptive adjustment and is restored to a normal working state through restarting, so that IP modification of the cluster system is realized. Obviously, the implementation mode does not need to uninstall and reinstall the cluster system, original data and operation in the cluster system can be reserved, the IP modification efficiency in the cluster system is effectively improved, the method can perfectly adapt to practical application scenes such as user machine room relocation, server relocation, data service migration and network planning change, and huge economic value is brought to enterprises. In addition, because only the modification of the original global configuration file is carried out, and the regeneration and the restart of the cluster component can be carried out based on the modified new global configuration file, even if facing a cluster system with a more complex structure, the implementation mode can still realize the rapid and efficient IP modification and can effectively ensure the stable operation of the modified cluster system.
The IP modification apparatus, device, and computer readable storage medium of the cluster system provided in the present application all have the above beneficial effects, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the prior art and the embodiments of the present application, the drawings that are needed to be used in the description of the prior art and the embodiments of the present application will be briefly described below. Of course, the following description of the drawings related to the embodiments of the present application is only a part of the embodiments of the present application, and it will be obvious to those skilled in the art that other drawings can be obtained from the provided drawings without any creative effort, and the obtained other drawings also belong to the protection scope of the present application.
Fig. 1 is a schematic flowchart of an IP modification method for a cluster system provided in the present application;
fig. 2 is a schematic structural diagram of an IP modification apparatus of a cluster system provided in the present application;
fig. 3 is a schematic structural diagram of an IP modification device of a cluster system provided in the present application.
Detailed Description
The core of the application is to provide an IP modification method of the cluster system, which can realize quick and efficient IP modification on the original data of the cluster system while effectively retaining the original data of the cluster system; another core of the present application is to provide an IP modification apparatus, device and computer-readable storage medium for a cluster system, which also have the above beneficial effects.
In order to more clearly and completely describe the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides an IP modification method of a cluster system.
Referring to fig. 1, fig. 1 is a schematic flowchart of an IP modification method of a cluster system provided in the present application, where the IP modification method of the cluster system may include:
s101: traversing cluster components in a cluster system to generate an original global configuration file;
the step aims to realize the acquisition of an original global configuration file, wherein the original global configuration file is the global configuration file of each cluster component in the cluster system before the IP information is not modified, so that the IP modification of the cluster system can be realized by modifying the IP information in the global configuration file subsequently. Specifically, each cluster component in the current cluster system may be traversed first, and a corresponding original global configuration file may be generated based on a traversal result. Further, the method can also be saved in a corresponding file for subsequent use.
It is understood that the type of the cluster system does not affect the implementation of the present technical solution, and for example, the cluster system may be a K8S cluster, a database cluster, a file management cluster, and the like, which is not limited in this application. In addition, the cluster component refers to various components in the cluster system, such as various certificates, various server components, and the like, and the specific type of the cluster component can be determined by the structure of the cluster system.
S102: modifying the original global configuration file by using a preset IP modification list to obtain a new global configuration file;
the step aims to modify the original global configuration file, namely, a new global configuration file is obtained by modifying the IP information in the original global configuration file. Specifically, an IP modification list may be created in advance to obtain the preset IP modification list, and then the specific content that needs to be modified in the original global configuration file is determined by using the preset IP modification request and is modified, so that a new modified global configuration file can be obtained.
The preset IP modification list is created by a technician according to actual needs, and related information of various cluster components to be modified in the cluster system, such as names, types, original IPs, and the like of the cluster components, and modified IP information of the cluster components are set, so as to implement IP modification. For example, taking the K8S cluster system as an example, a corresponding preset IP modification list may include: settings modify K8S global configuration files, cluster/etc/hosts information,/etc/etcd. env information,/root/. kube/file information, and/etc/kubernets file information.
S103: and regenerating each cluster component according to the new global configuration file, and restarting each cluster component service.
The step aims to realize regeneration and restart of the cluster components in the cluster system. Specifically, after a new global configuration file is obtained, since the new global configuration file is the global configuration file after IP information is modified, the cluster component corresponding to the new global configuration file can be regenerated, and obviously, the regenerated cluster component is the cluster component with new IP information after IP information is modified; and further, restarting each cluster component in the cluster system, so that each cluster component realizes self-adaptive adjustment and restores to a normal working state, thereby completing IP modification of the cluster system.
Therefore, the IP modification method for the cluster system provided by the application establishes an IP modification list in advance for the cluster system, that is, sets the relevant information of the cluster component that needs to be subjected to IP modification according to the actual requirement, so that after an initial global configuration file (that is, the original global configuration file) of the cluster system is obtained through traversal of the cluster component, the original global configuration file can be modified directly by using a preset IP modification list, so as to generate a new global configuration file, so that the cluster component can be regenerated by using the new global configuration file, and the cluster component can be adaptively adjusted and restored to a normal working state by restarting, so that the IP modification of the cluster system is realized. Obviously, the implementation mode does not need to uninstall and reinstall the cluster system, original data and operation in the cluster system can be reserved, the IP modification efficiency in the cluster system is effectively improved, the method can perfectly adapt to practical application scenes such as user machine room relocation, server relocation, data service migration and network planning change, and huge economic value is brought to enterprises. In addition, because only the modification of the original global configuration file is carried out, and the regeneration and the restart of the cluster component can be carried out based on the modified new global configuration file, even if facing a cluster system with a more complex structure, the implementation mode can still realize the rapid and efficient IP modification and can effectively ensure the stable operation of the modified cluster system.
In an embodiment of the application, before the modifying the original global configuration file by using the preset IP modification list to obtain the new global configuration file, the method may further include: judging whether cluster node modification information exists in a preset IP modification list or not; if so, determining the cluster node to be modified according to the cluster node modification information, and modifying the current IP of the cluster node to be modified into the designated IP.
The method for modifying the IP of the cluster system provided by the embodiment of the application can further realize the IP modification of the cluster nodes, and the modification of the IP information of the cluster nodes can also be realized based on the preset IP modification list. Specifically, in the process of modifying the IP information by the cluster system, in addition to modifying the IP of each cluster component in the cluster system, the IP information of the cluster node may also be modified according to actual requirements, where the cluster node may include a working node (node), a management node (master), and the like. Based on the above, the node information of the cluster node to be modified, the original IP information, the modified IP information, and the like may also be recorded in the preset IP modification list. Therefore, after the preset IP modification list is obtained, before the original global configuration file is modified based on the preset IP modification list, whether modification information aiming at the cluster nodes exists in the preset IP modification list or not can be judged, if yes, the cluster nodes to be modified in the cluster system can be determined according to the cluster node modification information, and then the current IP (namely the original IP) is modified into the specified IP (namely the modified IP). Of course, if the cluster node modification information does not exist in the preset IP modification list, the step of modifying the original global configuration file by using the preset IP modification list to obtain a new global configuration file may be directly performed.
Specifically, a master _ booth _ node _ is _ change (whether to modify a node that is both a master and a node), a master _ only _ is _ change (whether to modify a pure master node), a node _ only _ is _ change (whether to modify a pure node), a keepalive _ VIP _ is _ change (whether to modify a virtual IP, which is a virtual IP of a K8S cluster, and which can access a K8S service by accessing the IP), and the like may be set to determine whether to modify the node; setting master _ only _ change (modifying a pure master node list), master _ both _ node _ change (modifying a node list which is a master and a node), node _ only _ change (modifying a pure node list), and keepalive _ vip _ change (modifying a virtual IP) to distinguish the types of nodes to be modified so that different types of nodes can carry out different operations; the node name + before/after is set to determine the specific modified content. The design structure is clear and all possible situations are considered.
In an embodiment of the application, before modifying the current IP of the cluster node to be modified to the designated IP, the method may further include: judging whether the specified IP meets a preset format specification or not; if not, outputting an error prompt; and if so, executing the step of modifying the current IP of the cluster node to be modified into the specified IP.
In order to further improve the IP modification efficiency, a uniform format specification can be set for the IP information so as to modify the IP of the cluster component into the IP with a preset format specification. Specifically, before modifying the current IP of the cluster node to be modified into the designated IP, it may be determined whether the designated IP in the preset IP modification list meets the preset format specification, if not, an error prompt may be directly output, the IP modification is not continued, and the exit is interrupted, if so, the step of modifying the current IP of the cluster node to be modified into the designated IP may be performed.
The specific type of the preset format specification does not affect the implementation of the present technical solution, for example, in the present application, it may be set as yaml format, which is not limited in the present application. Taking the yaml format as an example, when judging whether the designated IP is the yaml format, judging whether the format of the designated IP is 4 numbers and points of 0-255 by matching using a grep text search tool, and if so, determining that the designated IP meets the yaml format.
In an embodiment of the application, after the modifying the current IP of the cluster node to be modified to the designated IP, the method may further include: restarting the network service of the cluster system, and judging whether the network service is in a normal running state or not by executing a ping command; if not, outputting an error prompt; and if so, executing the step of modifying the original global configuration file by utilizing a preset IP modification list.
In order to effectively ensure that the cluster node can normally operate after IP modification, network service restart can be performed once after IP modification, and the network service of the cluster system can be ensured to enter a normal operation state. Specifically, after restarting the network service of the cluster system, whether the restarted network service is in a normal running state can be judged by executing a ping command, and the running state of the network server can be verified according to a ping command return value; further, when it is determined that the restarted network service is in a normal operation state, the modification of the original global configuration file may be continued, otherwise, if the restarted network service is in an abnormal operation state, an error prompt may be output, the IP modification is not continued, and the quitting is interrupted.
In an embodiment of the present application, the regenerating each cluster component according to the new global configuration file may include: and regenerating the ETCD certificate, the component certificate, the conf configuration file and the guide token according to the new global configuration file.
The embodiment of the application provides specific types of cluster components, namely the ETCD certificate, the component certificate, the conf configuration file, the guide token and the like. Of course, the specific type and number of cluster components are not limited to this, and the IP information of different cluster components may be modified according to the difference of the cluster system structure and the difference of the type, as described above, the specific cluster component type is determined by the cluster system structure itself, which is not limited in this application.
Taking the K8S cluster system as an example, the implementation procedure of performing IP modification on the cluster component thereof may include:
(1) deleting the old certificate file and the conf configuration file, defaulting to/etc/kubernets/pki and/etc/kubernets/. conf;
(2) regenerating the ETCD certificate: the ETCD certificate can be regenerated by using openssl or other methods, and the ETCD service is restarted;
(3) regenerating the conf profile of K8S: the modified IP information may be transmitted using a kubedm init phase kubeconfig command;
(4) regenerating the K8S component-related certificate: the modified IP information can be transmitted by using a kubbeam init phase headers command;
(5) regenerating bootstrap-token to enable the cluster to be capable of normally expanding and contracting;
(6) synchronizing the new certificate information to the K8S configuration center: a kubbeam init phase upload-centers synchronization certificate may be used;
(7) restarting the K8S component service to validate its new configuration;
(8) editing and modifying the IP information in the configmap (service configuration), daemonset (daemon service) and deployment (stateless service), so that the job on the K8S is executed again.
In an embodiment of the present application, traversing the cluster component in the cluster system to generate the original global configuration file may include: and traversing the cluster components in the cluster system by using a kubedm config view tool to generate an original global configuration file.
The embodiment of the application provides a method for generating an original global configuration file, which is realized based on a kubbeeadnfig view tool, wherein the kubbeeadnfig view tool is an operation and maintenance tool of kubbernees, and can be used for generating the global configuration file of a K8S cluster system so as to realize IP modification of the K8S cluster system, and the tool supports the above yaml format.
In an embodiment of the application, the modifying the original global configuration file by using the preset IP modification list to obtain a new global configuration file may include: and executing a preset IP modification list by using an ansable tool, and modifying the original global configuration file into a new global configuration file.
The embodiment of the application provides a method for modifying an original global configuration file into a new global configuration file, namely, automatic modification of IP information can be realized based on an ansable tool, and specifically, IP modification can be performed by using a lineinfile module or sed command of the ansable tool. The ansible tool is an automatic operation and maintenance tool, is used for publishing, managing and arranging a computer system, and can realize batch processing of remote control nodes based on resource lists and script tasks. Moreover, the ansible tool can also perfectly support the above yaml format, and can also realize the restart of the network service of the cluster system.
Please refer to fig. 2, where fig. 2 is a schematic structural diagram of an IP modification apparatus of a cluster system provided in the present application, and the IP modification apparatus of the cluster system may include:
the cluster component traversing module 1 is used for traversing cluster components in a cluster system to generate an original global configuration file;
the configuration file modification module 2 is used for modifying the original global configuration file by using a preset IP modification list to obtain a new global configuration file;
and the cluster component regeneration module 3 is used for regenerating each cluster component according to the new global configuration file and restarting each cluster component service.
It can be seen that, in the IP modification apparatus for a cluster system provided in this embodiment of the present application, an IP modification list is created in advance for the cluster system, that is, relevant information of a cluster component that needs to be subjected to IP modification is set according to actual requirements, so that after an initial global configuration file (that is, the above-mentioned original global configuration file) of the cluster system is obtained through traversal of the cluster component, a preset IP modification list may be directly used to modify the original global configuration file, so as to generate a new global configuration file, so that the cluster component may be regenerated using the new global configuration file, and the cluster component may be adaptively adjusted and restored to a normal working state by restarting the cluster component, so as to implement IP modification of the cluster system. Obviously, the implementation mode does not need to uninstall and reinstall the cluster system, original data and operation in the cluster system can be reserved, the IP modification efficiency in the cluster system is effectively improved, the method can perfectly adapt to practical application scenes such as user machine room relocation, server relocation, data service migration and network planning change, and huge economic value is brought to enterprises. In addition, because only the modification of the original global configuration file is carried out, and the regeneration and the restart of the cluster component can be carried out based on the modified new global configuration file, even if facing a cluster system with a more complex structure, the implementation mode can still realize the rapid and efficient IP modification and can effectively ensure the stable operation of the modified cluster system.
In an embodiment of the present application, the IP modification apparatus of the cluster system may further include a node IP modification module, configured to determine whether cluster node modification information exists in a preset IP modification list before the preset IP modification list is used to modify the original global configuration file to obtain a new global configuration file; if so, determining the cluster node to be modified according to the cluster node modification information, and modifying the current IP of the cluster node to be modified into the designated IP.
In an embodiment of the present application, the node IP modification module may be further configured to determine whether the specified IP meets a preset format specification before modifying the current IP of the cluster node to be modified to the specified IP; if not, outputting an error prompt; and if so, executing the step of modifying the current IP of the cluster node to be modified into the specified IP.
In an embodiment of the present application, the IP modification apparatus of the cluster system may further include a network service checking module, configured to restart the network service of the cluster system after the current IP of the cluster node to be modified is modified to the designated IP, and determine whether the network service is in a normal operating state by executing a ping command; if not, outputting an error prompt; and if so, executing the step of modifying the original global configuration file by utilizing a preset IP modification list.
In an embodiment of the present application, the cluster component regeneration module 3 may be specifically configured to regenerate the etc certificate, the component certificate, the conf configuration file, and the bootstrap token according to the new global configuration file.
In an embodiment of the present application, the cluster component traversal module 1 may be specifically configured to traverse a cluster component in a cluster system by using a kubbe config view tool, and generate an original global configuration file.
In an embodiment of the present application, the configuration file modification module 2 may be specifically configured to execute a preset IP modification list by using an ansable tool, and modify an original global configuration file into a new global configuration file.
For the introduction of the apparatus provided in the present application, please refer to the above method embodiments, which are not described herein again.
Please refer to fig. 3, where fig. 3 is a schematic structural diagram of an IP modification device of a cluster system provided in the present application, where the IP modification device of the cluster system may include:
a memory for storing a computer program;
a processor, configured to implement the steps of the IP modification method of any one of the cluster systems described above when executing the computer program.
As shown in fig. 3, a schematic view of a structure of an IP modification device of a cluster system, the IP modification device of the cluster system may include: a processor 10, a memory 11, a communication interface 12 and a communication bus 13. The processor 10, the memory 11 and the communication interface 12 all communicate with each other through a communication bus 13.
In the embodiment of the present application, the processor 10 may be a Central Processing Unit (CPU), an application specific integrated circuit, a digital signal processor, a field programmable gate array or other programmable logic device, etc.
The processor 10 may call a program stored in the memory 11, and in particular, the processor 10 may perform operations in an embodiment of an IP modification method of a cluster system.
The memory 11 is used for storing one or more programs, the program may include program codes, the program codes include computer operation instructions, in this embodiment, the memory 11 stores at least the program for implementing the following functions:
traversing cluster components in a cluster system to generate an original global configuration file;
modifying the original global configuration file by using a preset IP modification list to obtain a new global configuration file;
and regenerating each cluster component according to the new global configuration file, and restarting each cluster component service.
In one possible implementation, the memory 11 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created during use.
Further, the memory 11 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device or other volatile solid state storage device.
The communication interface 12 may be an interface of a communication module for connecting with other devices or systems.
Of course, it should be noted that the structure shown in fig. 3 does not constitute a limitation to the IP modification apparatus of the cluster system in the embodiment of the present application, and in practical applications, the IP modification apparatus of the cluster system may include more or less components than those shown in fig. 3, or some components in combination.
The present application also provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, can implement the steps of the IP modification method of any one of the cluster systems described above.
The computer-readable storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
For the introduction of the computer-readable storage medium provided in the present application, please refer to the above method embodiments, which are not described herein again.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The technical solutions provided by the present application are described in detail above. The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall into the protection scope of the present application.

Claims (10)

1. An IP modification method for a cluster system, comprising:
traversing cluster components in a cluster system to generate an original global configuration file;
modifying the original global configuration file by using a preset IP modification list to obtain a new global configuration file;
and regenerating each cluster component according to the new global configuration file, and restarting each cluster component service.
2. The IP modification method of a cluster system according to claim 1, wherein before modifying the original global configuration file by using a preset IP modification list and obtaining a new global configuration file, the method further comprises:
judging whether cluster node modification information exists in the preset IP modification list or not;
if so, determining the cluster node to be modified according to the cluster node modification information, and modifying the current IP of the cluster node to be modified into the designated IP.
3. The IP modification method of cluster system according to claim 2, wherein before modifying the current IP of the cluster node to be modified to the designated IP, the method further comprises:
judging whether the specified IP meets a preset format specification or not;
if not, outputting an error prompt;
and if so, executing the step of modifying the current IP of the cluster node to be modified into the specified IP.
4. The IP modification method of cluster system according to claim 2, wherein after modifying the current IP of the cluster node to be modified to the designated IP, the method further comprises:
restarting the network service of the cluster system, and judging whether the network service is in a normal running state or not by executing a ping command;
if not, outputting an error prompt;
and if so, executing the step of modifying the original global configuration file by utilizing a preset IP modification list.
5. The IP modification method of cluster system according to claim 1, wherein said regenerating each cluster component according to the new global configuration file comprises:
and regenerating the ETCD certificate, the component certificate, the conf configuration file and the guide token according to the new global configuration file.
6. The IP modification method of a cluster system according to claim 1, wherein traversing cluster components in the cluster system to generate an original global configuration file comprises:
and traversing the cluster components in the cluster system by using a kubedm config view tool to generate the original global configuration file.
7. The IP modification method of a cluster system according to claim 1, wherein the modifying the original global configuration file by using a preset IP modification list to obtain a new global configuration file comprises:
and executing the preset IP modification list by using an ansable tool, and modifying the original global configuration file into the new global configuration file.
8. An IP modification apparatus of a cluster system, comprising:
the cluster component traversing module is used for traversing the cluster components in the cluster system to generate an original global configuration file;
the configuration file modification module is used for modifying the original global configuration file by utilizing a preset IP modification list to obtain a new global configuration file;
and the cluster component regeneration module is used for regenerating each cluster component according to the new global configuration file and restarting the service of each cluster component.
9. An IP modification apparatus of a cluster system, comprising:
a memory for storing a computer program;
processor for implementing the steps of the IP modification method of the cluster system according to any of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the IP modification method of a cluster system according to any one of the claims 1 to 7.
CN202210139542.1A 2022-02-16 2022-02-16 IP modification method and device of cluster system and related equipment Pending CN114189496A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210139542.1A CN114189496A (en) 2022-02-16 2022-02-16 IP modification method and device of cluster system and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210139542.1A CN114189496A (en) 2022-02-16 2022-02-16 IP modification method and device of cluster system and related equipment

Publications (1)

Publication Number Publication Date
CN114189496A true CN114189496A (en) 2022-03-15

Family

ID=80546035

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210139542.1A Pending CN114189496A (en) 2022-02-16 2022-02-16 IP modification method and device of cluster system and related equipment

Country Status (1)

Country Link
CN (1) CN114189496A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115225612A (en) * 2022-06-29 2022-10-21 济南浪潮数据技术有限公司 Management method, device, equipment and medium for K8S cluster reserved IP

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107547635A (en) * 2017-08-04 2018-01-05 新华三大数据技术有限公司 Big data cluster host IP address amending method and device
CN110764918A (en) * 2019-11-04 2020-02-07 浪潮云信息技术有限公司 Method for managing main nodes in container cluster
CN112055087A (en) * 2020-09-10 2020-12-08 厦门市美亚柏科信息股份有限公司 Method and system for rapid deployment, migration and maintenance of Mongodb cluster
CN112714022A (en) * 2020-12-29 2021-04-27 平安普惠企业管理有限公司 Control processing method and device for multiple clusters and computer equipment
US20210132957A1 (en) * 2019-10-30 2021-05-06 International Business Machines Corporation Configuration after cluster migration
CN112800029A (en) * 2021-01-29 2021-05-14 紫光云技术有限公司 Method for overall migration of ceph cluster

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107547635A (en) * 2017-08-04 2018-01-05 新华三大数据技术有限公司 Big data cluster host IP address amending method and device
US20210132957A1 (en) * 2019-10-30 2021-05-06 International Business Machines Corporation Configuration after cluster migration
CN110764918A (en) * 2019-11-04 2020-02-07 浪潮云信息技术有限公司 Method for managing main nodes in container cluster
CN112055087A (en) * 2020-09-10 2020-12-08 厦门市美亚柏科信息股份有限公司 Method and system for rapid deployment, migration and maintenance of Mongodb cluster
CN112714022A (en) * 2020-12-29 2021-04-27 平安普惠企业管理有限公司 Control processing method and device for multiple clusters and computer equipment
CN112800029A (en) * 2021-01-29 2021-05-14 紫光云技术有限公司 Method for overall migration of ceph cluster

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115225612A (en) * 2022-06-29 2022-10-21 济南浪潮数据技术有限公司 Management method, device, equipment and medium for K8S cluster reserved IP
CN115225612B (en) * 2022-06-29 2023-11-14 济南浪潮数据技术有限公司 Management method, device, equipment and medium for K8S cluster reserved IP

Similar Documents

Publication Publication Date Title
WO2019184164A1 (en) Method for automatically deploying kubernetes worker node, device, terminal apparatus, and readable storage medium
US8719386B2 (en) System and method for providing configuration synchronicity
CN112131099B (en) Version upgrading test method and device
CN106452836B (en) main node setting method and device
CN107181636B (en) Health check method and device in load balancing system
CN110716787A (en) Container address setting method, apparatus, and computer-readable storage medium
CN112783646A (en) Stateful application containerization deployment method and device
CN104793981B (en) A kind of online snapshot management method and device of cluster virtual machine
CN110855746A (en) Middleware management method, electronic device and storage medium
CN114189496A (en) IP modification method and device of cluster system and related equipment
CN111064626A (en) Configuration updating method, device, server and readable storage medium
CN113760461B (en) Version upgrading method and computer readable storage medium
CN111698281B (en) Resource downloading method and device, electronic equipment and storage medium
CN113590595A (en) Database multi-writing method and device and related equipment
CN104104701A (en) Online service configuration updating method and system
CN113268254A (en) Cluster system installation method and device, electronic equipment and storage medium
CN110768812A (en) Server management system and method
CN111431951B (en) Data processing method, node equipment, system and storage medium
CN116662289A (en) Log recording method, device, electronic equipment and computer readable storage medium
CN111064715A (en) Method and device for arranging firewall and computer readable storage medium
CN111769992B (en) Network data management method, cloud platform and storage medium
CN112905699A (en) Full data comparison method, device, equipment and storage medium
CN113300966A (en) Flow control method, device and system and electronic equipment
CN116614323B (en) Cloud storage enterprise network management method and system based on Rclone
CN116088913B (en) Integrated device, method and computer program product for whole vehicle upgrade software

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20220315

RJ01 Rejection of invention patent application after publication