Internet protocol address configuration method, device and equipment and readable storage medium

By preconfiguring the single network port IP addresses of each node in the server cluster, and using the processor to send the network port configuration file, determining and modifying the target network protocol address, the problems of low efficiency and high error rate in the existing technology are solved, and efficient and accurate IP address configuration is achieved.

CN119697158APending Publication Date: 2025-03-25INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202412000365.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

There is a lack of a mature IP address configuration method in the prior art, which leads to the inefficient and error-prone IP address configuration of nodes in the server cluster, and requires manual configuration.

Method used

By pre-configuring the IP address of each node in the server cluster with a single network port, and using the processor to send the network port configuration file to the network port to be configured by each node. After determining the target network protocol address, modify the network protocol address in the network port configuration file to complete the IP address configuration.

Benefits of technology

It reduces the workload of manually configuring the IP address of the network port, improves the efficiency of IP address configuration, and reduces the probability of errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119697158A_ABST
    Figure CN119697158A_ABST
Patent Text Reader

Abstract

The invention discloses an internet protocol address configuration method, an internet protocol address configuration device, internet protocol address configuration equipment and a readable storage medium, which belong to the field of server clusters, and consider that (1) a server has a network communication function after an IP address is configured at a single internet port, and (2) IP address configuration can be realized through remote modification of the IP address in an internet port configuration file. Therefore, the IP address configuration of the single network port can be performed on each node in the server cluster in advance, then the network port configuration file is sent to the network port to be configured of each node through the processor, and after the target network protocol address corresponding to each node is determined, the network port configuration file is sent to any node. According to the invention, the network protocol address in the network port configuration file corresponding to the to-be-configured network port in the node can be modified into the target network protocol address corresponding to the node, so that the IP address configuration of each to-be-configured network port is completed, the workload of manually configuring the IP address of the network port is reduced, the IP address configuration efficiency is improved, and the error probability is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of server clusters, and in particular to an Internet Protocol address configuration method, device, equipment and readable storage medium. Background Art

[0002] For a server cluster, it is necessary to configure an IP (Internet Protocol) address for each node (server) in the server cluster in order to realize the network communication function of each node. However, there is a lack of a mature IP address configuration method in the relevant technology. It is often necessary to manually configure the IP address of each node in the server cluster, which is not only inefficient but also prone to errors due to carelessness.

[0003] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve at present. Summary of the invention

[0004] The purpose of the present invention is to provide an Internet Protocol address configuration method, device, equipment and readable storage medium. In the present invention, the IP address of a single network port of each node in a server cluster can be configured in advance, and then a network port configuration file is sent to the network port to be configured of each node through a processor. After the target network protocol address corresponding to each node is determined, for any node, the network protocol address in the network port configuration file corresponding to the network port to be configured in the node can be modified to the target network protocol address corresponding to the node, thereby completing the IP address configuration of each network port to be configured, reducing the workload of manually configuring the network port IP address, which is beneficial to improving the efficiency of IP address configuration and reducing the error probability.

[0005] In order to solve the above technical problems, the present invention provides a network protocol address configuration method, which is applied to a processor and includes:

[0006] Determine the network port to be configured for each node in the server cluster;

[0007] For any node in the server cluster, a network port configuration file corresponding to the network port to be configured of the node is sent to the node, wherein each node in the server cluster has a network port pre-configured with a network protocol address for network communication;

[0008] Determine a first corresponding relationship, and determine the target network protocol address corresponding to each node in the server cluster according to the first corresponding relationship, wherein the first corresponding relationship is: a corresponding relationship between a node identifier and a target network protocol address, and the node identifier is an identity identifier of the node;

[0009] For any node in the server cluster, the network protocol address in the network port configuration file corresponding to the network port to be configured in the node is modified to the target network protocol address corresponding to the node, so as to complete the network protocol address configuration of the network port to be configured of the node.

[0010] On the other hand, the network ports to be configured for each node in the server cluster are determined to include:

[0011] Determine the serial number of the network port to be configured of each node in the server cluster, wherein the serial number of the network port to be configured refers to: the serial number of the network port to be configured;

[0012] For any node in the server cluster, sending a network port configuration file corresponding to the network port to be configured of the node to the node includes:

[0013] For any node in the server cluster, a network port configuration file corresponding to the serial number of the network port to be configured of the node is sent to the node;

[0014] For any node in the server cluster, modifying the network protocol address in the network port configuration file corresponding to the network port to be configured in the node to the target network protocol address corresponding to the node includes:

[0015] For any node in the server cluster, the network protocol address in the network port configuration file corresponding to the network port number to be configured in the node is modified to the target network protocol address corresponding to the node, so as to complete the network protocol address configuration of the network port to be configured of the node.

[0016] On the other hand, the network port of the designated serial number of each node in the server cluster is pre-configured with a network protocol address;

[0017] Determine the network port numbers to be configured for each node in the server cluster, including:

[0018] Determine the unified serial number of the network port to be configured in the server cluster;

[0019] For any node in the server cluster, sending a network port configuration file corresponding to the serial number of the network port to be configured of the node to the node includes:

[0020] The network port configuration file corresponding to the network port number to be configured is sent to each node in the server cluster through the network port with the specified serial number of each node in the server cluster.

[0021] On the other hand, any node in the server cluster has multiple network ports to be configured;

[0022] Determine the unified network port numbers to be configured in the server cluster, including:

[0023] Determine the unified serial number of the network port to be configured in the current round of the server cluster;

[0024] The network port configuration file corresponding to the network port number to be configured is sent to each node in the server cluster through the network port with the specified serial number of each node in the server cluster, including:

[0025] Determine the network port configuration file corresponding to the network port sequence number to be configured in the current round;

[0026] The network port configuration file corresponding to the network port number to be configured in the current round is sent to each node in the server cluster through the network port with the specified serial number of each node in the server cluster;

[0027] The first corresponding relationship refers to: the first corresponding relationship corresponding to the sequence number of the network port to be configured in the current round;

[0028] For any node in the server cluster, modifying the network protocol address in the network port configuration file corresponding to the serial number of the network port to be configured in the node to the target network protocol address corresponding to the node includes:

[0029] For any node in the server cluster, modify the network protocol address in the network port configuration file corresponding to the serial number of the network port to be configured in the current round in the node to the target network protocol address corresponding to the node in the current round;

[0030] Determine whether there are remaining rounds of network port numbers to be configured;

[0031] If it exists, then the step of determining the unified serial number of the network port to be configured in the current round of the server cluster is executed;

[0032] If it does not exist, then end.

[0033] On the other hand, the processor is a central processing unit of a designated node in a server cluster.

[0034] On the other hand, determining the first corresponding relationship includes:

[0035] Obtaining a node identification sequence and a target address sequence of the server cluster, wherein the node identification sequence includes the node identification of each node in the server cluster, and the target address sequence includes the target network protocol address of the network port to be configured of each node;

[0036] A first corresponding relationship is determined according to the node identification sequence and the target address sequence.

[0037] On the other hand, obtaining the node identification sequence and target address sequence of the server cluster includes:

[0038] Obtaining a node identification sequence and a target address sequence of the server cluster, wherein at least one of the node identification sequence and the target address sequence is a string expression in curly brace expansion;

[0039] Before determining the first corresponding relationship according to the node identification sequence and the target address sequence, the network protocol address configuration method further includes:

[0040] The node identification sequence and the target address sequence in the string expression form of the curly brace expansion are expanded to obtain a complete node identification sequence and a complete target address sequence.

[0041] In order to solve the above technical problems, the present invention further provides a network protocol address configuration device, which is applied to a processor and includes:

[0042] A first determination module is used to determine the network port to be configured of each node in the server cluster;

[0043] A first sending module is used to send a network port configuration file corresponding to a network port to be configured of any node in the server cluster to the node, wherein each node in the server cluster has a network port pre-configured with a network protocol address for network communication;

[0044] A second determination module is used to determine a first corresponding relationship, and determine a target network protocol address corresponding to each node in the server cluster according to the first corresponding relationship, wherein the first corresponding relationship is: a corresponding relationship between a node identifier and a target network protocol address, and the node identifier is an identity identifier of the node;

[0045] The first action module is used to modify the network protocol address in the network port configuration file corresponding to the network port to be configured in any node in the server cluster to the target network protocol address corresponding to the node, so as to complete the network protocol address configuration of the network port to be configured of the node.

[0046] In order to solve the above technical problems, the present invention also provides a network protocol address configuration device, comprising:

[0047] Memory for storing computer programs;

[0048] A processor is used to implement the steps of the above-mentioned network protocol address configuration method when executing the computer program.

[0049] In order to solve the above technical problem, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the network protocol address configuration method described above are implemented.

[0050] Beneficial effect: The present invention provides a method for configuring a network protocol address. Considering that (1) after a single network port is configured with an IP address, the server has a network communication function and (2) the IP address configuration can be achieved by remotely modifying the IP address in the network port configuration file, the present invention can pre-configure the IP address of a single network port for each node in a server cluster, and then send the network port configuration file to the network port to be configured of each node through the processor. After determining the target network protocol address corresponding to each node, for any node, the network protocol address in the network port configuration file corresponding to the network port to be configured in the node can be modified to the target network protocol address corresponding to the node, thereby completing the IP address configuration of each network port to be configured, reducing the workload of manually configuring the network port IP address, and thus helping to improve the efficiency of IP address configuration and reduce the probability of error.

[0051] The present invention also provides a network protocol address configuration device, equipment and computer-readable storage medium, which have the same beneficial effects as the above network protocol address configuration method. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the relevant technologies and the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0053] Figure 1 A schematic diagram of a flow chart of a network protocol address configuration method provided by the present invention;

[0054] Figure 2 A schematic diagram of a flow chart of another network protocol address configuration method provided by the present invention;

[0055] Figure 3 A schematic diagram of the structure of a node network port of a server cluster provided by the present invention;

[0056] Figure 4 A schematic diagram of a flow chart of a network protocol address configuration device provided by the present invention;

[0057] Figure 5 A schematic diagram of the structure of a network protocol address configuration device provided by the present invention;

[0058] Figure 6 A schematic diagram of the structure of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION

[0059] The core of the present invention is that the IP address of a single network port of each node in the server cluster can be pre-configured, and then the network port configuration file can be sent to the network port to be configured of each node through the processor. After the target network protocol address corresponding to each node is determined, for any node, the network protocol address in the network port configuration file corresponding to the network port to be configured in the node can be modified to the target network protocol address corresponding to the node, thereby completing the IP address configuration of each network port to be configured, reducing the workload of manually configuring the network port IP address, which is beneficial to improving the efficiency of IP address configuration and reducing the probability of error.

[0060] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0061] Please refer to Figure 1 , Figure 1 A flowchart of a network protocol address configuration method provided by the present invention is provided. The network protocol address configuration method is applied to a processor, including:

[0062] S101: Determine the network port to be configured of each node in the server cluster;

[0063] Specifically, considering the technical problems in the above background technology, and considering that (1) after a single network port is configured with an IP address, the server has a network communication function and (2) the IP address configuration can be achieved by remotely modifying the IP address in the network port configuration file, the embodiment of the present invention intends to automatically configure the IP address of each network port in the server cluster that is not configured with an IP address through a processor. Therefore, in this step, the network port to be configured of each node in the server cluster can be first determined so that it can be used as the data basis for subsequent steps.

[0064] S102: For any node in the server cluster, a network port configuration file corresponding to the network port to be configured of the node is sent to the node, wherein each node in the server cluster has a network port pre-configured with a network protocol address for network communication;

[0065] Specifically, considering the configuration work of the IP address of the network port to be configured, it can be regarded as: according to the physical characteristics of the network port to be configured, the network port configuration file of the network port is set in the node, and it is ensured that the network port configuration file has the target IP address of the network port, and through the remote sending of the network port configuration file and the remote modification of the target IP address in the network port configuration file, it can support "completing the preparation of the network port configuration files required for each network port to be configured and the modification of the target IP address at the device where the processor is located". Therefore, the processor in this step can send the network port configuration file corresponding to the network port to be configured of the node to any node in the server cluster, so as to modify the IP address in the network port configuration file in each node subsequently.

[0066] The premise of this configuration method is that each node in the server cluster is pre-configured with at least a single network port IP address, so as to facilitate network communication between the processor and each node.

[0067] S103: Determine a first corresponding relationship, and determine a target network protocol address corresponding to each node in the server cluster according to the first corresponding relationship, wherein the first corresponding relationship is: a corresponding relationship between a node identifier and a target network protocol address, and the node identifier is an identity identifier of the node;

[0068] Specifically, considering that in the same server cluster, the IP addresses of different nodes should be distinguished, and the target IP address corresponding to each node can be quickly and accurately determined through the first correspondence, the first correspondence can be determined in this step, and the target network protocol address corresponding to each node in the server cluster can be determined based on the first correspondence, so as to serve as the data basis for subsequent steps.

[0069] S104: For any node in the server cluster, modify the network protocol address in the network port configuration file corresponding to the network port to be configured in the node to the target network protocol address corresponding to the node, so as to complete the network protocol address configuration of the network port to be configured of the node.

[0070] Specifically, after determining the target IP address corresponding to each node, for any node in the server cluster, the network protocol address in the network port configuration file corresponding to the network port to be configured in the node can be modified to the target network protocol address corresponding to the node, so as to complete the network protocol address configuration of the node's network port to be configured.

[0071] Among them, in addition to pre-configuring the IP address of a single network port of each node, the IP address configuration method in the embodiment of the present invention can all be executed by the processor, avoiding excessive manual participation, reducing labor costs, improving configuration efficiency and reducing the probability of errors.

[0072] The present invention provides a method for configuring a network protocol address. Considering that (1) after a single network port is configured with an IP address, the server has a network communication function and (2) the IP address configuration can be realized by remotely modifying the IP address in the network port configuration file, the present invention can pre-configure the IP address of a single network port for each node in a server cluster, and then send the network port configuration file to the network port to be configured of each node through a processor. After determining the target network protocol address corresponding to each node, for any node, the network protocol address in the network port configuration file corresponding to the network port to be configured in the node can be modified to the target network protocol address corresponding to the node, thereby completing the IP address configuration of each network port to be configured, reducing the workload of manually configuring the network port IP address, and thus facilitating improving the efficiency of IP address configuration and reducing the probability of error.

[0073] Based on the above embodiments:

[0074] As an optional embodiment, determining the network port to be configured of each node in the server cluster includes:

[0075] Determine the serial number of the network port to be configured of each node in the server cluster, wherein the serial number of the network port to be configured refers to: the serial number of the network port to be configured;

[0076] For any node in the server cluster, sending the network port configuration file corresponding to the network port to be configured of the node to the node includes:

[0077] For any node in the server cluster, the network port configuration file corresponding to the serial number of the network port to be configured of the node is sent to the node;

[0078] For any node in the server cluster, modify the network protocol address in the network port configuration file corresponding to the network port to be configured in the node to the target network protocol address corresponding to the node, including:

[0079] For any node in the server cluster, modify the network protocol address in the network port configuration file corresponding to the serial number of the network port to be configured in the node to the target network protocol address corresponding to the node, so as to complete the network protocol address configuration of the network port to be configured of the node.

[0080] Specifically, considering that when designing a server cluster, the physical characteristics of each node are usually consistent, for example, the physical characteristics of the network port with the same serial number in different nodes are usually the same, and the network port configuration files required for the network ports with the same physical characteristics are also the same. Therefore, in the server cluster, the network port configuration file required by the network port can be pointed to by the serial number of the network port. Not only is the amount of data required small, but the required network port configuration file can also be accurately determined. Therefore, in the embodiment of the present invention, the network port configuration file corresponding to the network port to be configured can be determined by the serial number of the network port to be configured and sent to the corresponding node.

[0081] Of course, in addition to this method, the method of determining the "network port configuration file sent to each node" may also be other types, which are not limited in the embodiment of the present invention.

[0082] As an optional embodiment, the network port with a specified serial number of each node in the server cluster is pre-configured with a network protocol address;

[0083] Determine the network port numbers to be configured for each node in the server cluster, including:

[0084] Determine the unified serial number of the network port to be configured in the server cluster;

[0085] For any node in the server cluster, sending the network port configuration file corresponding to the serial number of the network port to be configured of the node to the node includes:

[0086] The network port configuration file corresponding to the network port number to be configured is sent to each node in the server cluster through the network port with the specified serial number of each node in the server cluster.

[0087] Specifically, as introduced above, the network ports with the same serial number of each node in the server cluster have the same physical characteristics. If the serial numbers of the network ports to be configured are unified, then preparing a single type of network port configuration file can meet the needs of the network port configuration files of each node. This also requires that the serial numbers of the pre-configured network ports of each node be unified. Therefore, in the embodiment of the present invention, on the one hand, the network ports with specified serial numbers of each node are pre-configured with network protocol addresses. On the other hand, after determining the unified serial numbers of the network ports to be configured in the server cluster, the network port configuration files corresponding to the serial numbers of the network ports to be configured can be sent to each node in the server cluster through the network ports with specified serial numbers of each node in the server cluster, so as to facilitate subsequent IP address modification actions.

[0088] Among them, based on the fact that the physical characteristics of the network ports with the same serial number of each node in the server cluster are consistent and the required network port configuration file types are the same, since the serial numbers of the network ports to be configured are unified, it is sufficient to prepare a single type of network port configuration file corresponding to the serial number of the network port to be configured, in which the IP address can be a default IP address or can be empty, and then the network port configuration file is sent to each node respectively, and then the IP address of the network port configuration file in each node is modified to the target IP address corresponding to the node, which reduces the workload of accurate work on the network port configuration file and further reduces the probability of error.

[0089] As an optional embodiment, any node in the server cluster has multiple network ports to be configured;

[0090] Determine the unified network port numbers to be configured in the server cluster, including:

[0091] S201: Determine the unified serial number of the network port to be configured in the current round of the server cluster;

[0092] The network port configuration file corresponding to the network port number to be configured is sent to each node in the server cluster through the network port with the specified serial number of each node in the server cluster, including:

[0093] S202: Determine a network port configuration file corresponding to the serial number of the network port to be configured in the current round;

[0094] S203: sending the network port configuration file corresponding to the network port number to be configured in the current round to each node in the server cluster through the network port with the designated number of each node in the server cluster;

[0095] The first correspondence refers to: the first correspondence corresponding to the serial number of the network port to be configured in the current round;

[0096] For any node in the server cluster, modify the network protocol address in the network port configuration file corresponding to the network port number to be configured in the node to the target network protocol address corresponding to the node, including:

[0097] S205: For any node in the server cluster, modify the network protocol address in the network port configuration file corresponding to the serial number of the network port to be configured in the current round in the node to the target network protocol address corresponding to the node in the current round;

[0098] S206: Determine whether there are remaining rounds of network port numbers to be configured;

[0099] If it exists, then the step of determining the unified serial number of the network port to be configured in the current round of the server cluster is executed;

[0100] S207: If it does not exist, then end.

[0101] Specifically, in order to better illustrate the embodiments of the present invention, please refer to Figure 2 , Figure 2 This is a flow chart of another network protocol address configuration method provided by the present invention, wherein S204 is the same as S103.

[0102] Specifically, considering that even if a single network port with a specified serial number has been pre-configured, each node in the server cluster may still have multiple network ports to be configured. For this situation, in order to efficiently and accurately implement the configuration work of each network port to be configured in the node, in an embodiment of the present invention, the IP address configuration work of the network port to be configured with the same serial number of each node in the server cluster can be performed in rounds, that is, each time a unified serial number of the network port to be configured in the current round of the server cluster is determined, and then the network port configuration file corresponding to the serial number of the network port to be configured in the current round is sent to each node. After determining the first corresponding relationship corresponding to the serial number of the network port to be configured in the current round, the network protocol address in the network port configuration file corresponding to the serial number of the network port to be configured in the current round in each node can be modified to the target network protocol address corresponding to the node in the current round.

[0103] After the IP address configuration of the current round is completed, it can be determined whether there are network port numbers to be configured in the remaining rounds. If so, the process returns to the step of determining the unified network port numbers to be configured in the current round of the server cluster.

[0104] Specifically, in order to better illustrate the embodiments of the present invention, please refer to Figure 3 , Figure 3 A structural schematic diagram of a node network port of a server cluster provided by the present invention, the server cluster in the figure may include three nodes, any node includes four network ports from the first to the fourth, any node is pre-configured with network ports in a specified order, for example, the specified order is 1, that is, the first network port of each node is pre-configured with an IP address, then a single node includes three network ports from the second to the fourth to be configured, and the configuration of the network port IP address can be completed in three rounds, for example, the network port with sequence number 2 can be configured first, then the network port with sequence number 3 can be configured, and finally the network port with sequence number 4 can be configured, etc. The embodiment of the present invention is not limited here.

[0105] As an optional embodiment, the processor is a central processing unit of a designated node in the server cluster.

[0106] Specifically, considering that the nodes in the server cluster themselves are equipped with a central processing unit and can also complete the above-mentioned network protocol address configuration method, the processor in the embodiment of the present invention can be the central processing unit of a specified node in the server cluster. That is, the network port configuration work of each node in the server cluster can be implemented through the central processing unit of the specified node in the server cluster, thereby eliminating the need to use additional equipment and reducing costs.

[0107] Specifically, in order to smoothly implement inter-node communication, the nodes of the server cluster may be configured to be password-free, or a password may be set for each node and the corresponding relationship between the password and the pre-configured node IP address may be recorded.

[0108] Among them, you can use expect or sshpass (non-interactive SSH (Secure Shell) password verification tool) and other password verification tools to implement a functional script for non-interactive remote replication and remote command execution. If the nodes are configured to be password-free, no steps are required.

[0109] As an optional embodiment, determining the first corresponding relationship includes:

[0110] Obtaining a node identification sequence and a target address sequence of the server cluster, wherein the node identification sequence includes the node identification of each node in the server cluster, and the target address sequence includes the target network protocol address of the network port to be configured of each node;

[0111] A first corresponding relationship is determined according to the node identification sequence and the target address sequence.

[0112] Specifically, considering that the first correspondence involves two types of key data, including the node identification of each node in the server cluster and the target network protocol address of the network port to be configured of each node, and these two types of key data can be respectively reflected in the form of data sequences, these two types of key data can be set in the form of data sequences in the embodiment of the present invention. Therefore, in the embodiment of the present invention, the node identification sequence and the target address sequence of the server cluster can be obtained, and the first corresponding relationship can be determined based on the node identification sequence and the target address sequence.

[0113] Of course, in addition to this method, the first corresponding relationship may be determined in many other ways, which are not limited in the embodiment of the present invention.

[0114] In addition, as an optional embodiment, determining the first corresponding relationship according to the node identification sequence and the target address sequence includes:

[0115] The node identification sequence and the target address sequence are combined into one parameter, wherein the node identification sequence and the target address sequence are located in different lines in the parameter;

[0116] The parameters are converted into rows and columns to obtain a first correspondence relationship including a plurality of data correspondence groups, wherein any row in the parameters after the row-column conversion is used as a data correspondence group, and the data correspondence group includes a single node identifier and its corresponding target network protocol address.

[0117] Specifically, considering that the node identification sequence and the target address sequence are placed in a row respectively, and then multiple rows of data corresponding groups (including a single node identification and its corresponding target network protocol address) can be obtained through row-column conversion, thereby determining a first corresponding relationship including several data corresponding groups. Therefore, in an embodiment of the present invention, the node identification sequence and the target address sequence can be first merged into one parameter, wherein the node identification sequence and the target address sequence are located in different rows in the parameter, and then the parameter is converted into rows and columns to obtain a first corresponding relationship including several data corresponding groups.

[0118] Of course, in addition to this specific form, "determining the first corresponding relationship according to the node identification sequence and the target address sequence" may also be other forms, which are not limited in the embodiments of the present invention.

[0119] In addition, it is worth mentioning that the execution methods of various actions used in the embodiments of the present invention can all use Shell conventional syntax as parameters to reduce learning costs, and can access other nodes through SSH. When expanding the sequence, the sequence represented by the brace expansion can be expanded using echo in the sh-c execution command mode; the awk script can be used to convert the parameters into rows and columns.

[0120] Among them, shell is a command interpreter that interprets the commands entered by the user and sends them to the kernel. SSH is a protocol used for secure remote login and other secure network services on an insecure network. It can execute commands remotely. SCP (Secure Copy Protocol) is a remote file transfer tool based on SSH.

[0121] As an optional embodiment, obtaining the node identification sequence and the target address sequence of the server cluster includes:

[0122] Obtaining a node identification sequence and a target address sequence of the server cluster, wherein at least one of the node identification sequence and the target address sequence is a string expression in curly brace expansion;

[0123] Before determining the first corresponding relationship according to the node identification sequence and the target address sequence, the network protocol address configuration method further includes:

[0124] The node identification sequence and the target address sequence in the string expression form of the curly brace expansion are expanded to obtain a complete node identification sequence and a complete target address sequence.

[0125] Specifically, considering that the string expression form of curly brace expansion can represent a longer data sequence in a more concise form, at least one of the node identification sequence and the target address sequence in the embodiment of the present invention is a string expression form expanded by curly braces. Accordingly, before determining the first corresponding relationship based on the node identification sequence and the target address sequence, the node identification sequence and the target address sequence in the string expression form expanded by curly braces can be expanded to obtain a complete node identification sequence and target address sequence.

[0126] For example, assuming that the node identification sequence includes A, B, C, and D respectively, then the curly brace expansion form of the node identification sequence can be {A...D}, where the node identification can be in the form of numbers or letters, and the embodiment of the present invention is not limited here. Assuming that the target address sequence includes 192.168.0.1, 192.168.0.2, ..., 192.168.0.127 respectively, then the target address sequence can have an expression form of extracting the common part and an expression form of not extracting the common part. The expression form of extracting the common part is 192.168.0.{0..127}, and the expression form of not extracting the common part is {192.168.0.1..192.168.0.127}, and the curly brace expansion can be enclosed in quotation marks to prevent its expansion.

[0127] Please refer to Figure 4 , Figure 4 A schematic diagram of the structure of a network protocol address configuration device provided by the present invention, wherein the network protocol address configuration device is applied to a processor, comprising:

[0128] A first determining module 41 is used to determine the network port to be configured of each node in the server cluster;

[0129] A first sending module 42 is used to send a network port configuration file corresponding to the network port to be configured of any node in the server cluster to the node, wherein each node in the server cluster has a network port pre-configured with a network protocol address for network communication;

[0130] The second determination module 43 is used to determine a first corresponding relationship, and determine the target network protocol address corresponding to each node in the server cluster according to the first corresponding relationship, wherein the first corresponding relationship is: a corresponding relationship between a node identifier and a target network protocol address, and the node identifier is an identity identifier of the node;

[0131] The first action module 44 is used to modify the network protocol address in the network port configuration file corresponding to the network port to be configured in the node to the target network protocol address corresponding to the node for any node in the server cluster, so as to complete the network protocol address configuration of the network port to be configured of the node.

[0132] Based on the above embodiments:

[0133] As an optional embodiment, the first determining module 41 is specifically configured to:

[0134] Determine the serial number of the network port to be configured of each node in the server cluster, wherein the serial number of the network port to be configured refers to: the serial number of the network port to be configured;

[0135] The first sending module 42 is specifically used for:

[0136] For any node in the server cluster, the network port configuration file corresponding to the serial number of the network port to be configured of the node is sent to the node;

[0137] The first action module 44 is specifically used for:

[0138] For any node in the server cluster, modify the network protocol address in the network port configuration file corresponding to the serial number of the network port to be configured in the node to the target network protocol address corresponding to the node, so as to complete the network protocol address configuration of the network port to be configured of the node.

[0139] As an optional embodiment, the network port with a specified serial number of each node in the server cluster is pre-configured with a network protocol address;

[0140] The first determining module 41 is specifically used for:

[0141] Determine the unified serial number of the network port to be configured in the server cluster;

[0142] The first sending module 42 is specifically used for:

[0143] The network port configuration file corresponding to the network port number to be configured is sent to each node in the server cluster through the network port with the specified serial number of each node in the server cluster.

[0144] As an optional embodiment, any node in the server cluster has multiple network ports to be configured;

[0145] The first determining module 41 is specifically used for:

[0146] Determine the unified serial number of the network port to be configured in the current round of the server cluster;

[0147] The first sending module 42 includes:

[0148] The third determination module is used to determine the network port configuration file corresponding to the sequence number of the network port to be configured in the current round;

[0149] The second sending module is used to send the network port configuration file corresponding to the serial number of the network port to be configured in the current round to each node in the server cluster through the network port with the specified serial number of each node in the server cluster;

[0150] The first correspondence refers to: the first correspondence corresponding to the serial number of the network port to be configured in the current round;

[0151] The first action module 44 includes:

[0152] The first action submodule is used to modify, for any node in the server cluster, the network protocol address in the network port configuration file corresponding to the serial number of the network port to be configured in the current round in the node to the target network protocol address corresponding to the node in the current round;

[0153] The first judging module is used to judge whether there are remaining rounds of network port numbers to be configured, and if so, trigger the first determining module 41, and if not, end.

[0154] For an introduction to the network protocol address configuration device provided in an embodiment of the present invention, please refer to the aforementioned embodiment of the network protocol address configuration method, and the embodiment of the present invention will not be described in detail here.

[0155] Please refer to Figure 5 , Figure 5 A schematic diagram of the structure of a network protocol address configuration device provided by the present invention, the network protocol address configuration device comprising:

[0156] A memory 51, used for storing computer programs;

[0157] The processor 52 is used to implement the steps of the network protocol address configuration method in the above-mentioned embodiment when executing the computer program.

[0158] For an introduction to the network protocol address configuration device provided in the embodiment of the present invention, please refer to the aforementioned embodiment of the network protocol address configuration method, and the embodiment of the present invention will not be described in detail here.

[0159] Please refer to Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer-readable storage medium provided by the present invention. A computer program 62 is stored on the computer-readable storage medium 61. When the computer program 62 is executed by the processor, the steps of the network protocol address configuration method in the aforementioned embodiment are implemented.

[0160] For an introduction to the computer-readable storage medium provided in an embodiment of the present invention, please refer to the aforementioned embodiment of the network protocol address configuration method, and the embodiment of the present invention will not be described in detail here.

[0161] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the network protocol address configuration method in the above embodiment when executed by a processor.

[0162] For an introduction to the computer program product provided by the embodiment of the present invention, please refer to the aforementioned embodiment of the network protocol address configuration method, and the embodiment of the present invention will not be described in detail here.

[0163] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the element.

[0164] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for configuring a network protocol address, characterized in that: Applicable to processors, including: Determine the network port to be configured for each node in the server cluster; For any node in the server cluster, a network port configuration file corresponding to the network port to be configured of the node is sent to the node, wherein each node in the server cluster has a network port pre-configured with a network protocol address for network communication; Determine a first corresponding relationship, and determine the target network protocol address corresponding to each node in the server cluster according to the first corresponding relationship, wherein the first corresponding relationship is: a corresponding relationship between a node identifier and a target network protocol address, and the node identifier is an identity identifier of the node; For any node in the server cluster, the network protocol address in the network port configuration file corresponding to the network port to be configured in the node is modified to the target network protocol address corresponding to the node, so as to complete the network protocol address configuration of the network port to be configured of the node.

2. The network protocol address configuration method according to claim 1, characterized in that: Determine the network ports to be configured for each node in the server cluster, including: Determine the serial number of the network port to be configured of each node in the server cluster, wherein the serial number of the network port to be configured refers to: the serial number of the network port to be configured; For any node in the server cluster, sending a network port configuration file corresponding to the network port to be configured of the node to the node includes: For any node in the server cluster, a network port configuration file corresponding to the serial number of the network port to be configured of the node is sent to the node; For any node in the server cluster, modifying the network protocol address in the network port configuration file corresponding to the network port to be configured in the node to the target network protocol address corresponding to the node includes: For any node in the server cluster, the network protocol address in the network port configuration file corresponding to the network port number to be configured in the node is modified to the target network protocol address corresponding to the node, so as to complete the network protocol address configuration of the network port to be configured of the node.

3. The network protocol address configuration method according to claim 2, characterized in that: The network port with a specified serial number of each node in the server cluster is pre-configured with a network protocol address; Determine the network port numbers to be configured for each node in the server cluster, including: Determine the unified serial number of the network port to be configured in the server cluster; For any node in the server cluster, sending a network port configuration file corresponding to the serial number of the network port to be configured of the node to the node includes: The network port configuration file corresponding to the network port number to be configured is sent to each node in the server cluster through the network port with the specified serial number of each node in the server cluster.

4. The network protocol address configuration method according to claim 3, characterized in that: Any node in the server cluster has multiple network ports to be configured; Determine the unified network port numbers to be configured in the server cluster, including: Determine the unified serial number of the network port to be configured in the current round of the server cluster; The network port configuration file corresponding to the network port number to be configured is sent to each node in the server cluster through the network port with the specified serial number of each node in the server cluster, including: Determine the network port configuration file corresponding to the network port sequence number to be configured in the current round; The network port configuration file corresponding to the network port number to be configured in the current round is sent to each node in the server cluster through the network port with the specified serial number of each node in the server cluster; The first corresponding relationship refers to: the first corresponding relationship corresponding to the sequence number of the network port to be configured in the current round; For any node in the server cluster, modifying the network protocol address in the network port configuration file corresponding to the serial number of the network port to be configured in the node to the target network protocol address corresponding to the node includes: For any node in the server cluster, modify the network protocol address in the network port configuration file corresponding to the serial number of the network port to be configured in the current round in the node to the target network protocol address corresponding to the node in the current round; Determine whether there are remaining rounds of network port numbers to be configured; If it exists, then the step of determining the unified serial number of the network port to be configured in the current round of the server cluster is executed; If it does not exist, then end.

5. The network protocol address configuration method according to claim 1, characterized in that: The processor is a central processing unit of a designated node in the server cluster.

6. The network protocol address configuration method according to any one of claims 1 to 5, characterized in that: Determining the first corresponding relationship includes: Obtaining a node identification sequence and a target address sequence of the server cluster, wherein the node identification sequence includes the node identification of each node in the server cluster, and the target address sequence includes the target network protocol address of the network port to be configured of each node; A first corresponding relationship is determined according to the node identification sequence and the target address sequence.

7. The network protocol address configuration method according to claim 6, characterized in that: Obtaining the node identification sequence and target address sequence of the server cluster includes: Obtaining a node identification sequence and a target address sequence of the server cluster, wherein at least one of the node identification sequence and the target address sequence is a string expression in curly brace expansion; Before determining the first corresponding relationship according to the node identification sequence and the target address sequence, the network protocol address configuration method further includes: The node identification sequence and the target address sequence in the string expression form of the curly brace expansion are expanded to obtain a complete node identification sequence and a complete target address sequence.

8. A network protocol address configuration device, characterized in that: Applicable to processors, including: A first determination module is used to determine the network port to be configured of each node in the server cluster; A first sending module is used to send a network port configuration file corresponding to a network port to be configured of any node in the server cluster to the node, wherein each node in the server cluster has a network port pre-configured with a network protocol address for network communication; A second determination module is used to determine a first corresponding relationship, and determine a target network protocol address corresponding to each node in the server cluster according to the first corresponding relationship, wherein the first corresponding relationship is: a corresponding relationship between a node identifier and a target network protocol address, and the node identifier is an identity identifier of the node; The first action module is used to modify the network protocol address in the network port configuration file corresponding to the network port to be configured in any node in the server cluster to the target network protocol address corresponding to the node, so as to complete the network protocol address configuration of the network port to be configured of the node.

9. A network protocol address configuration device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the network protocol address configuration method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the network protocol address configuration method according to any one of claims 1 to 7 are implemented.