CN111491039A - IP distribution method, system, terminal and storage medium for distributed file system - Google Patents

IP distribution method, system, terminal and storage medium for distributed file system Download PDF

Info

Publication number
CN111491039A
CN111491039A CN202010231211.1A CN202010231211A CN111491039A CN 111491039 A CN111491039 A CN 111491039A CN 202010231211 A CN202010231211 A CN 202010231211A CN 111491039 A CN111491039 A CN 111491039A
Authority
CN
China
Prior art keywords
available
target nodes
list
ips
addresses
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.)
Withdrawn
Application number
CN202010231211.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 CN202010231211.1A priority Critical patent/CN111491039A/en
Publication of CN111491039A publication Critical patent/CN111491039A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5053Lease time; Renewal aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a distributed file system IP allocation method, a system, a terminal and a storage medium, comprising the following steps: acquiring all available IPs of the cluster; dividing the available IP into two groups according to the available IP types; and respectively and equally distributing the two groups of IP to a plurality of target nodes, and sending IP updating instructions to the target nodes. The invention can ensure that the IPV4 address and the IPV6 address are uniformly distributed on each node when IP allocation is carried out, and further ensure that the addresses are uniformly distributed on each node when a client is mounted.

Description

IP distribution method, system, terminal and storage medium for distributed file system
Technical Field
The invention relates to the technical field of storage, in particular to a distributed file system IP allocation method, a system, a terminal and a storage medium.
Background
Ctdb (cluster triviral database) is a lightweight clustered database that, when combined with a clustered file system, provides a simple and efficient highly available clustering solution. The CTDB schedules other available nodes to take over the originally distributed Public IP when the internal nodes are in a downtime fault, and the drifting Public IP is taken over again after the fault nodes are recovered, so that the service is ensured not to be interrupted.
When the CTDB is highly available to allocate virtual IP, the IPV6 address (Internet IP) and the IPV4 address (local area network IP) are put in a list and allocated together, which may cause the phenomenon that the IPV6 address and the IPV4 address allocated by the node are not uniform.
Disclosure of Invention
In view of the above-mentioned deficiencies of the prior art, the present invention provides a method, a system, a terminal and a storage medium for distributing a distributed file system IP, so as to solve the above-mentioned technical problems.
In a first aspect, the present invention provides a distributed file system IP allocation method, including:
acquiring all available IPs of the cluster;
dividing the available IP into two groups according to the available IP types;
and respectively and equally distributing the two groups of IP to a plurality of target nodes, and sending IP updating instructions to the target nodes.
Further, the dividing of the available IP into two groups according to the available IP types includes:
saving IPV4 addresses in all available IPs to a first list;
the IPV6 addresses in all available IPs are saved to a second list.
Further, the respectively equally distributing the two groups of IPs to the plurality of target nodes includes:
evenly distributing the IPV4 addresses in the first list to a plurality of target nodes;
evenly distributing the IPV6 addresses in the second list to a plurality of target nodes.
In a second aspect, the present invention provides a distributed file system IP allocation system, including:
the IP acquisition unit is configured to acquire all available IPs of the cluster;
the IP dividing unit is configured for dividing the available IP into two groups according to the available IP types;
and the IP distribution unit is configured to evenly distribute the two groups of IPs to a plurality of target nodes respectively and send IP updating instructions to the target nodes.
Further, the IP partitioning unit includes:
the first saving module is configured to save the IPV4 addresses in all available IPs to a first list;
and the second saving module is configured to save the IPV6 addresses in all the available IPs to a second list.
Further, the IP allocation unit includes:
a first assignment module configured to evenly assign IPV4 addresses within the first list to a plurality of target nodes;
a second assignment module configured to evenly assign IPV6 addresses in the second list to a plurality of target nodes.
In a third aspect, a terminal is provided, including:
a processor, a memory, wherein,
the memory is used for storing a computer program which,
the processor is used for calling and running the computer program from the memory so as to make the terminal execute the method of the terminal.
In a fourth aspect, a computer storage medium is provided having stored therein instructions that, when executed on a computer, cause the computer to perform the method of the above aspects.
The beneficial effect of the invention is that,
the method, the system, the terminal and the storage medium for distributing the IP of the distributed file system ensure that the IPV4 address and the IPV6 address are uniformly distributed on each node when the IP is distributed by adopting a mode of separately distributing the IPV4 address and the IPV6 address, and further ensure that the IPV4 address and the IPV6 address can be uniformly distributed on each node when a client is mounted so as to achieve the purpose of load balancing.
In addition, the invention has reliable design principle, simple structure and very wide application prospect.
Drawings
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present invention, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a schematic flow diagram of a method of one embodiment of the invention.
FIG. 2 is a schematic block diagram of a system of one embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, 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 invention.
The following explains key terms appearing in the present invention.
IPv4 was the first widely used, and is the foundational protocol that constitutes today's internet technology.
IPv6, internet protocol version 6, is the next generation IP protocol designed to address the limited freedom of IPv4 network addresses.
FIG. 1 is a schematic flow diagram of a method of one embodiment of the invention. The execution subject in fig. 1 may be a distributed file system IP allocation system.
As shown in fig. 1, the method 100 includes:
step 110, acquiring all available IPs of the cluster;
step 120, dividing the available IP into two groups according to the available IP types;
and step 130, respectively, equally distributing the two groups of IPs to a plurality of target nodes, and sending IP updating instructions to the plurality of target nodes.
In order to facilitate understanding of the present invention, the following describes the distributed file system IP allocation method provided in the present invention further by using the principle of the distributed file system IP allocation method of the present invention and combining the process of allocating the distributed file system IP in the embodiment.
Specifically, the distributed file system IP allocation method includes:
and S1, acquiring all available IPs of the cluster.
When a cluster node fails, the CTDB cluster senses that the failure triggers an IP reallocation request, and after receiving the IP reallocation request, all available IP of the CTDB cluster is obtained.
And S2, dividing the available IP into two groups according to the available IP types.
The IPV4 address and the IPV6 address are separated from the available IP addresses, and the IPV4 address and the IPV6 address are separately stored in different lists, for example, the IPV4 addresses in all the available IPs are saved in a first list, and the IPV6 addresses in all the available IPs are saved in a second list.
And S3, respectively, evenly distributing the two groups of IP to a plurality of target nodes, and sending IP updating instructions to the target nodes.
And allocating the IPs in different address lists, for example, equally allocating the IPV4 address in the first list to a plurality of target nodes, and equally allocating the IPV6 address in the second list to a plurality of target nodes.
And after the allocation is finished, informing the target node in the normal state to release the old IP, and using the allocated new IP address to finish IP reallocation.
As shown in fig. 2, the system 200 includes:
an IP obtaining unit 210 configured to obtain all available IPs of the cluster;
an IP dividing unit 220 configured to divide the available IP into two groups according to the available IP types;
the IP allocating unit 230 is configured to equally allocate the two groups of IPs to a plurality of target nodes, and send IP update instructions to the plurality of target nodes.
Optionally, as an embodiment of the present invention, the IP partitioning unit includes:
the first saving module is configured to save the IPV4 addresses in all available IPs to a first list;
and the second saving module is configured to save the IPV6 addresses in all the available IPs to a second list.
Optionally, as an embodiment of the present invention, the IP allocation unit includes:
a first assignment module configured to evenly assign IPV4 addresses within the first list to a plurality of target nodes;
a second assignment module configured to evenly assign IPV6 addresses in the second list to a plurality of target nodes.
Fig. 3 is a schematic structural diagram of a terminal system 300 according to an embodiment of the present invention, where the terminal system 300 may be used to execute the distributed file system IP allocation method according to the embodiment of the present invention.
The terminal system 300 may include: a processor 310, a memory 320, and a communication unit 330. The components communicate via one or more buses, and those skilled in the art will appreciate that the architecture of the servers shown in the figures is not intended to be limiting, and may be a bus architecture, a star architecture, a combination of more or less components than those shown, or a different arrangement of components.
The memory 320 may be used for storing instructions executed by the processor 310, and the memory 320 may be implemented by any type of volatile or non-volatile storage terminal or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The executable instructions in memory 320, when executed by processor 310, enable terminal 300 to perform some or all of the steps in the method embodiments described below.
The processor 310 is a control center of the storage terminal, connects various parts of the entire electronic terminal using various interfaces and lines, and performs various functions of the electronic terminal and/or processes data by operating or executing software programs and/or modules stored in the memory 320 and calling data stored in the memory. The processor may be composed of an Integrated Circuit (IC), for example, a single packaged IC, or a plurality of packaged ICs connected with the same or different functions. For example, the processor 310 may include only a Central Processing Unit (CPU). In the embodiment of the present invention, the CPU may be a single operation core, or may include multiple operation cores.
A communication unit 330, configured to establish a communication channel so that the storage terminal can communicate with other terminals. And receiving user data sent by other terminals or sending the user data to other terminals.
The present invention also provides a computer storage medium, wherein the computer storage medium may store a program, and the program may include some or all of the steps in the embodiments provided by the present invention when executed. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM).
Therefore, the present invention, by separately allocating IPV4 and IPV6 addresses, ensures that IPV4 addresses and IPV6 addresses are uniformly distributed in each node when performing IP allocation, and further ensures that IPV6 addresses are uniformly distributed in each node when a client is mounted, so as to achieve the purpose of load balancing.
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be embodied in the form of a software product, where the computer software product is stored in a storage medium, 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, and the like, and the storage medium can store program codes, and includes instructions for enabling a computer terminal (which may be a personal computer, a server, or a second terminal, a network terminal, and the like) to perform all or part of the steps of the method in the embodiments of the present invention.
The same and similar parts in the various embodiments in this specification may be referred to each other. Especially, for the terminal embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant points can be referred to the description in the method embodiment.
In the embodiments provided in the present invention, it should be understood that the disclosed system and method can be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, systems or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
Although the present invention has been described in detail by referring to the drawings in connection with the preferred embodiments, the present invention is not limited thereto. Various equivalent modifications or substitutions can be made on the embodiments of the present invention by those skilled in the art without departing from the spirit and scope of the present invention, and these modifications or substitutions are within the scope of the present invention/any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. A distributed file system IP allocation method is characterized by comprising the following steps:
acquiring all available IPs of the cluster;
dividing the available IP into two groups according to the available IP types;
and respectively and equally distributing the two groups of IP to a plurality of target nodes, and sending IP updating instructions to the target nodes.
2. The method of claim 1, wherein the grouping of the availabilities into two groups according to the available IP types comprises:
saving IPV4 addresses in all available IPs to a first list;
the IPV6 addresses in all available IPs are saved to a second list.
3. The method of claim 2, wherein the evenly distributing the two groups of IPs to the plurality of target nodes respectively comprises:
evenly distributing the IPV4 addresses in the first list to a plurality of target nodes;
evenly distributing the IPV6 addresses in the second list to a plurality of target nodes.
4. A distributed file system IP allocation system, comprising:
the IP acquisition unit is configured to acquire all available IPs of the cluster;
the IP dividing unit is configured for dividing the available IP into two groups according to the available IP types;
and the IP distribution unit is configured to evenly distribute the two groups of IPs to a plurality of target nodes respectively and send IP updating instructions to the target nodes.
5. The system of claim 4, wherein the IP partitioning unit comprises:
the first saving module is configured to save the IPV4 addresses in all available IPs to a first list;
and the second saving module is configured to save the IPV6 addresses in all the available IPs to a second list.
6. The system of claim 5, wherein the IP assignment unit comprises:
a first assignment module configured to evenly assign IPV4 addresses within the first list to a plurality of target nodes;
a second assignment module configured to evenly assign IPV6 addresses in the second list to a plurality of target nodes.
7. A terminal, comprising:
a processor;
a memory for storing instructions for execution by the processor;
wherein the processor is configured to perform the method of any one of claims 1-3.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-3.
CN202010231211.1A 2020-03-27 2020-03-27 IP distribution method, system, terminal and storage medium for distributed file system Withdrawn CN111491039A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010231211.1A CN111491039A (en) 2020-03-27 2020-03-27 IP distribution method, system, terminal and storage medium for distributed file system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010231211.1A CN111491039A (en) 2020-03-27 2020-03-27 IP distribution method, system, terminal and storage medium for distributed file system

Publications (1)

Publication Number Publication Date
CN111491039A true CN111491039A (en) 2020-08-04

Family

ID=71812520

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010231211.1A Withdrawn CN111491039A (en) 2020-03-27 2020-03-27 IP distribution method, system, terminal and storage medium for distributed file system

Country Status (1)

Country Link
CN (1) CN111491039A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112468334A (en) * 2020-11-13 2021-03-09 苏州浪潮智能科技有限公司 Server configuration method, device, equipment and computer readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112468334A (en) * 2020-11-13 2021-03-09 苏州浪潮智能科技有限公司 Server configuration method, device, equipment and computer readable storage medium
CN112468334B (en) * 2020-11-13 2022-05-24 苏州浪潮智能科技有限公司 Server configuration method, device, equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
US11704144B2 (en) Creating virtual machine groups based on request
CN111091429A (en) Electronic bill identification distribution method and device and electronic bill generation system
CN111404753B (en) Flat network configuration method, computer equipment and storage medium
CN110719209B (en) Cluster network configuration method, system, equipment and readable storage medium
CN108881512B (en) CTDB virtual IP balance distribution method, device, equipment and medium
CN108111628B (en) Dynamic capacity-expansion storage method and system
CN109889401B (en) Flow statistical method, device, computer equipment and storage medium
US9071612B2 (en) Service providing system
CN114244717B (en) Configuration method and device of virtual network card resources, computer equipment and medium
CN111092921B (en) Data acquisition method, device and storage medium
CN112235136B (en) Network file system backup method, system, terminal and storage medium
CN112351110B (en) ID distribution method and device based on zookeeper
CN113361913A (en) Communication service arranging method, device, computer equipment and storage medium
CN110391940A (en) Response method, device, system, equipment and the storage medium of address of service
CN114500462A (en) Virtual private cloud network address allocation method and device, electronic equipment and medium
CN109120680B (en) Control system, method and related equipment
CN111491039A (en) IP distribution method, system, terminal and storage medium for distributed file system
CN110798507A (en) Method and system for DHCP address allocation memory
CN111338778B (en) Task scheduling method and device, storage medium and computer equipment
CN111736993A (en) Cluster high-availability service configuration method, system, terminal and storage medium
CN112486664A (en) Node capacity expansion method, system, terminal and storage medium
CN111866210A (en) Virtual IP balance distribution method, system, terminal and storage medium
CN111262771B (en) Virtual private cloud communication system, system configuration method and controller
CN114911589A (en) Cross-data-platform fusion computing method, system, terminal and storage medium
CN115826845A (en) Storage resource allocation method and device, storage medium and electronic device

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20200804