CN112087474B - Cluster-based port information acquisition method and device - Google Patents

Cluster-based port information acquisition method and device Download PDF

Info

Publication number
CN112087474B
CN112087474B CN201910511657.7A CN201910511657A CN112087474B CN 112087474 B CN112087474 B CN 112087474B CN 201910511657 A CN201910511657 A CN 201910511657A CN 112087474 B CN112087474 B CN 112087474B
Authority
CN
China
Prior art keywords
cluster
target
port
port information
equipment
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.)
Active
Application number
CN201910511657.7A
Other languages
Chinese (zh)
Other versions
CN112087474A (en
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.)
Kyland Technology Co Ltd
Original Assignee
Kyland 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 Kyland Technology Co Ltd filed Critical Kyland Technology Co Ltd
Priority to CN201910511657.7A priority Critical patent/CN112087474B/en
Publication of CN112087474A publication Critical patent/CN112087474A/en
Application granted granted Critical
Publication of CN112087474B publication Critical patent/CN112087474B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/75Indicating network or usage conditions on the user display
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

The embodiment of the invention discloses a method and a device for acquiring port information based on a cluster. The method comprises the following steps: the method comprises the steps that working data of at least one port of at least one other cluster device are collected through data communication between a control program installed in the local cluster device and port information acquisition programs installed in other cluster devices in a cluster system, and the working data of at least one port of the other cluster devices are acquired and stored through the port information acquisition programs installed in the local cluster device; and according to the port information acquisition instruction received by the control program, performing data processing on the collected working data of at least one port of at least one other cluster device to obtain target port information, and feeding back the target port information by the control program. The technical scheme of the embodiment of the invention realizes the automatic collection and processing of the port working data of each cluster device in the cluster system, and the quick, simple and accurate determination of the working condition of the port in the cluster system.

Description

Cluster-based port information acquisition method and device
Technical Field
The embodiment of the invention relates to a cluster technology, in particular to a method and a device for acquiring port information based on a cluster.
Background
A cluster is a group of mutually independent computers interconnected by a high-speed network, which form a group and are managed in a single system mode. A client interacts with a cluster, which appears as a stand-alone server.
Since any port in the cluster can only provide data interaction service for one application at a time, when various applications are deployed in the cluster, it is necessary for various deployment architectures to know what port currently occupied by each application previously deployed in the cluster is. In the prior art, generally, a data acquisition instruction is individually input to each server in a cluster by a human to acquire required port working data, and then, a free port which can be currently used for deploying a new application is determined manually according to the acquired working data of all the ports.
In the process of implementing the invention, the inventor finds that the prior art has the following disadvantages: the port working data of each server in the cluster are acquired respectively and independently through manual work, and the idle port is determined through manual work, so that time and labor are wasted, and the time cost and the labor cost are high. Moreover, in the field of cloud computing, application deployment with a huge magnitude order and automatic deployment are involved, and if the working data of the manual detection port in the prior art is used, the deployment of the application becomes infinitely difficult.
Disclosure of Invention
The embodiment of the invention provides a cluster-based port information acquisition method and device, which are used for automatically, quickly, simply, conveniently and accurately determining the working condition of a port in a cluster system.
In a first aspect, an embodiment of the present invention provides a method for acquiring port information, which is applied to a target cluster device in a cluster system, and includes:
collecting working data of at least one port of at least one other cluster device through data communication between a control program installed in a local and port information acquisition programs installed in other cluster devices in the cluster system, wherein the other cluster devices acquire and store the working data of at least one port of the other cluster devices through the port information acquisition programs installed in the local;
and according to a port information acquisition instruction received by the control program installed locally, performing data processing on the collected working data of at least one port of at least one other cluster device to obtain target port information, and feeding back the target port information through the control program installed locally.
In a second aspect, an embodiment of the present invention further provides an apparatus for acquiring port information, where the apparatus is disposed in a target cluster device in a cluster system, and includes:
the data collection module is used for collecting the working data of at least one port of at least one other cluster device through data communication between a control program installed in the local and port information acquisition programs installed in other cluster devices in the cluster system, wherein the other cluster devices acquire and store the working data of at least one port of the other cluster devices through the port information acquisition programs installed in the local;
and the target port information acquisition module is used for carrying out data processing on the collected working data of at least one port of at least one other cluster device according to a port information acquisition instruction received by the control program installed locally to obtain target port information, and feeding back the target port information through the control program installed locally.
In a third aspect, an embodiment of the present invention further provides an apparatus in a cluster system, where the apparatus in the cluster system includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for acquiring the port information according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform the method for acquiring port information according to any embodiment of the present invention.
The embodiment of the invention provides a method and a device for acquiring port information based on a cluster, which are characterized in that cluster equipment in a cluster system acquires and stores working data of at least one port of the cluster equipment based on a port information acquisition program installed in local, then target cluster equipment in the cluster system collects the working data of the port stored by each cluster equipment through a control program installed in local and processes the acquired working data of the port to obtain target port information matched with a port information acquisition instruction, the technical defects that in the prior art, the port working data of each server in the cluster are acquired respectively and independently through manual work, and idle ports are determined through manual work, time and labor are wasted, the time cost and the labor cost are high are overcome, the manual work removal is realized, and the port working data of each cluster equipment in the cluster system are automatically collected and processed, and then the working condition of the ports in the cluster system is determined quickly, simply and accurately.
Drawings
Fig. 1 is a flowchart of a method for acquiring port information according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for acquiring port information according to a second embodiment of the present invention;
fig. 3 is a structural diagram of an apparatus for acquiring port information according to a third embodiment of the present invention;
fig. 4 is a structural diagram of a device in a cluster system according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It should be further noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings, not all of them.
Example one
Fig. 1 is a flowchart of a method for acquiring port information applied to a target cluster device in a cluster system according to an embodiment of the present invention, where this embodiment is applicable to determining a situation of an idle port in the cluster system before a new application is deployed to the cluster system, and the method may be executed by acquiring the port information, the apparatus may be implemented by software and/or hardware, and the apparatus may be integrated in a server. As shown in fig. 1, the method specifically includes the following steps:
s101, collecting working data of at least one port of at least one other cluster device through data communication between a control program installed in a local and port information acquisition programs installed in other cluster devices in the cluster system, wherein the other cluster devices acquire and store the working data of at least one port of the other cluster devices through the port information acquisition programs installed in the local.
In this embodiment, the method for acquiring the port information, which is composed of step 101 and step 102, is executed by the target cluster device in the cluster system based on data communication between the control program installed locally and the port information acquiring programs installed in other cluster devices in the cluster system. Specifically, the target cluster device uses the control program installed in itself, and at the same time, the other cluster devices use the port information acquisition program installed in itself, so that transmission of the working data of the port between the target cluster device and the other cluster devices is achieved, that is, the other cluster devices transmit the working data of the port acquired by themselves to the target cluster device, or the target cluster device actively captures the working data of the port from the other cluster devices.
First, a port information obtaining program may be installed in the target cluster device to obtain working data of at least one port of the target cluster device, and therefore, the working data of at least one port of at least one other cluster device collected in step 101 may be the working data of at least one port of the target cluster device itself; secondly, the cluster system may have only one target cluster device, or may have a plurality of target cluster devices at the same time.
Further, if there are multiple target cluster devices in the cluster system, for the step 110, it may be specific that different target cluster devices correspond to different data collection objects (i.e. correspond to different other cluster devices), for example, if there are a total of 80 cluster devices in one cluster system, where two cluster devices are target cluster devices, then one target cluster device (the number of the target cluster device belongs to 1 to 50) may be responsible for collecting the working data of the ports of the other cluster devices with the numbers 1 to 50, and the other target cluster device (the number of the target cluster device belongs to 51 to 80) may be responsible for collecting the working data of the ports of the other cluster devices with the numbers 51 to 80.
Further, if there are multiple target cluster devices in the cluster system, one target cluster device may be selected as a final port working data collecting device, that is, after acquiring port working data of corresponding other cluster devices, other target cluster devices may send the acquired port working data to the target cluster device of the final port working data collecting device; each target cluster device may perform data processing corresponding to the port information acquisition instruction in step 102 on the collected working data of the port, and then send the result of the data processing to the target cluster device of the collection device serving as the final working data of the port, and the target cluster device of the collection device serving as the final working data of the port obtains final target port information according to the result of the data processing of each target cluster device.
In this embodiment, each of the other cluster devices in the cluster system is installed with a port information obtaining program, and the port information obtaining program may obtain the working data of at least one port of the other cluster device continuously, or according to a set time interval, or when receiving an instruction for collecting the working data of the port, and after obtaining the working data of the port, store the working data into the set storage area of the other cluster device.
Further, in this embodiment, specifically, the target cluster device may actively acquire the working data of the at least one port from at least one other cluster device according to a set time interval, or each other cluster device may actively send the working data of the at least one port to the target cluster device according to the set time interval.
S102, according to a port information acquisition instruction received by a control program installed in the local, data processing is carried out on the collected working data of at least one port of at least one other cluster device to obtain target port information, and the target port information is fed back through the control program installed in the local.
In this embodiment, the target cluster device receives the port information acquisition instruction through the control program installed locally, then selects the to-be-processed working data from the collected working data of the port according to the port information acquisition instruction, performs data processing operation corresponding to the port information acquisition instruction, further obtains the target port information, and feeds back the target port information through the control program installed locally.
For example, if the port information obtaining instruction is to obtain the total number of unoccupied ports, the target cluster device first collects the working data (including the working data of all its ports) of all the ports of all the other cluster devices in the cluster system, then searches and counts the occupation condition data of the ports in the collected working data of all the ports, and finally obtains the total number of unoccupied ports.
It should be further noted that, in this embodiment, the target port information to be acquired by the port information acquisition instruction may be target port information corresponding to any one or any plurality of other cluster devices in the cluster system, or may be target port information corresponding to all other cluster devices in the cluster system.
The embodiment of the invention provides a method for acquiring port information, which acquires and stores the working data of at least one port of other cluster equipment in a cluster system based on a port information acquisition program installed in the local, then enables target cluster equipment in the cluster system to collect the working data of the port stored by each other cluster equipment through a control program installed in the local and processes the acquired working data of the port to obtain the target port information matched with a port information acquisition instruction, solves the technical defects that in the prior art, the port working data of each server in the cluster are acquired respectively and independently through manual work, and idle ports are determined through manual work, so that the time and labor are wasted, the time cost and the labor cost are high, the port working data of each cluster equipment in the cluster system are automatically collected and processed without manual work, and then the working condition of the port in the cluster system is determined quickly, simply and accurately.
On the basis of the above embodiments, the collecting of the working data of at least one port of at least one other cluster device through data communication between the control program installed locally and the port information acquisition programs installed in the other cluster devices in the cluster system is embodied as: the first target cluster equipment collects the working data of at least one port of at least one first cluster equipment through data communication between a control program installed in the local and a port information acquisition program installed in the first cluster equipment in the cluster system, wherein the first cluster equipment corresponds to the first target cluster equipment; the second target cluster equipment collects the working data of at least one port of at least one second cluster equipment through the data communication between the control program installed in the local and the port information acquisition program installed in the second cluster equipment in the cluster system, wherein the second cluster equipment corresponds to the second target cluster equipment; the first target cluster device obtains the working data of the port collected by the second target cluster device through the control program installed in the local and the control program installed in the second target cluster device.
In this embodiment, there are two target cluster devices in the cluster system, that is, a first target cluster device and a second target cluster device. Different target cluster devices correspond to different other cluster devices in the cluster system. And collecting the working data of the port of each other cluster device by the corresponding target cluster device.
Further, in this embodiment, after collecting the working data of the ports of the other cluster devices corresponding to each target cluster device, each target cluster device will send the collected working data of the ports to one target cluster device in a unified manner, i.e., the first target cluster device, such that when the first target cluster device receives the port information obtaining instruction later, the port working data of each other cluster device can be directly and directly processed, and the second target cluster device does not need to perform data processing on the port working data stored in the second target cluster device (of course, the second target cluster device can also send the data processing result to the first target cluster device after processing the stored port working data first), so that the data processing burden of the second target cluster device is reduced, and the second target cluster device can better provide service for the deployed application.
The benefits of this arrangement are: the efficiency of collecting the working data of the port is improved, and the data collecting burden of the first target cluster equipment is relieved.
Example two
Fig. 2 is a flowchart of a method for acquiring port information according to a second embodiment of the present invention. In this embodiment, a specific implementation manner is provided for adding a step of adding another cluster device, adding a step of performing connection detection on another cluster device, embodying an acquisition method of working data and an acquisition method of target port information corresponding to the working data, and adding a port working data replacement step. The same or corresponding terms as those of the above-described embodiments are explained, and the description of the present embodiment is omitted.
Correspondingly, the method of the embodiment specifically includes:
s201, receiving a group entering request of an external device through a control program installed in the local.
In this embodiment, the target cluster device is further configured to receive, through the control program installed locally, a group entry request from an external device. When the cluster system includes a plurality of target cluster devices, one of the target cluster devices may be randomly selected to process the group entering request, or one of the target cluster devices may be fixed to process the group entering request, which is not limited in this embodiment.
S202, judging whether the external equipment meets the grouping rule or not according to the grouping request, if so, executing step 203, and if not, executing step 204.
In this embodiment, the grouping rule may specifically include whether the external device is installed with a port information obtaining program, whether the hardware configuration of the external device meets the requirement, and the like. Accordingly, the group entry request should carry information matching with the group entry rule, and specifically, the group entry request may include hardware configuration information of the external device, and exact information of whether the port information acquisition program is installed in the external device, and the like.
Further, in this embodiment, if it is determined that the external device satisfies the group entry rule according to the group entry request, the external device is added to the present cluster system as one other cluster device; if the external device is determined not to meet the clustering rule according to the clustering request, the external device is not added to the clustering system.
And S203, adding the external equipment into the cluster system as other cluster equipment through the control program installed in the local.
And S204, not adding the external equipment into the cluster system.
And S205, performing connection detection on other cluster equipment through a control program installed in the local.
In this embodiment, the target cluster device is further configured to perform connection detection on each other cluster device in the cluster system through the control program installed locally, and check whether each other cluster device can be normally connected, is another cluster device in the present cluster system, and the like. If there are multiple target cluster devices in the cluster system, any one of the target cluster devices may be selected to perform connection detection on all other cluster devices, or the multiple target cluster devices may perform connection detection on other cluster devices respectively corresponding to the multiple target cluster devices.
And S206, setting other cluster equipment which does not pass the connection detection as external equipment of the cluster system through the control program installed in the local.
In this embodiment, if there is another cluster device that does not pass the connection detection, the another cluster device is set as an external device of the cluster system by the control program installed locally.
Further, if the plurality of target cluster devices respectively perform connection detection on the other cluster devices respectively corresponding to the plurality of target cluster devices, when one target cluster device detects another cluster device that fails in connection detection, the one target cluster device may directly set the other cluster device that fails in connection detection as an external device of the cluster system, or the plurality of target cluster devices may send a detection result of connection detection to one unified target cluster device, and then the target cluster device uniformly sets all the other cluster devices that fail in connection detection as external devices of the cluster system.
And S207, each target cluster device collects working data of at least one port of at least one other cluster device corresponding to the target cluster device through data communication between the control program installed in the local and the port information acquisition programs installed in other cluster devices in the cluster system, wherein different target cluster devices correspond to different other cluster devices.
In this embodiment, the cluster system includes at least two target cluster devices, and each target cluster device has a control program installed therein. Different target cluster devices correspond to different other cluster devices. Illustratively, the cluster system has 100 cluster devices in total, where the cluster system includes 3 target cluster devices, and numbers of the three target cluster devices are 1, 2, and 3, respectively, where the target cluster device No. 1 corresponds to other cluster devices with numbers 4-30, the target cluster device No. 2 corresponds to other cluster devices with numbers 31-60, and the target cluster device No. 3 corresponds to other cluster devices with numbers 61-100.
Further, in this embodiment, the working data of the port of each other cluster device is collected only by the target cluster device corresponding to the port. Taking the above example content as an example, the working data of the ports of the other cluster devices numbered 4-30 will only be collected by the target cluster device No. 1; the working data of the ports of other cluster devices with numbers 31-60 are collected by the target cluster device number 2; the working data of the ports of the other cluster devices with numbers 61-100 will only be collected by the target cluster device number 3.
Further, in this embodiment, after collecting the working data of the ports of the corresponding other cluster devices, each target cluster device may not store the collected working data of the ports in one target cluster device in a unified manner, but each target cluster device only stores the collected working data of the ports in its own memory after collecting the working data of the ports, and does not forward the collected working data of the ports to one unified target cluster device.
In this embodiment, each target cluster device may specifically actively acquire the working data of at least one port from the other corresponding cluster devices according to a set time interval.
The working data of the port may specifically include any one of or any multiple of the occupied state of the port, the firewall rule of the port, the data traffic of the port, the data flow category of the port, and the service object of the port. Accordingly, the target port information may specifically include any one or any multiple of the total number of unoccupied ports in the cluster system, and identification information of the unoccupied ports, firewall rules of the ports, total data traffic of the ports, data flow categories of the ports, and service objects of the ports.
Further, in this embodiment, each target cluster device may simultaneously install a port information obtaining program, and may obtain and store the working data of at least one port of the target cluster device in real time or at set time intervals through the locally installed port information obtaining program.
Illustratively, the port information acquiring program may specifically acquire the working data of the port by: searching all used ports through a netstat command and calculating to obtain the number of the remaining available ports; checking whether the target port is occupied or not by combining a netstat command and a grep command; checking who the target port is occupied by through the lsof command; checking the application connection number of the port by combining a netstat command, a grep command and a wc command; checking the firewall rules corresponding to the ports through iptables commands; acquiring the type of the current flow of the port through a tcpdump command; and counting the data traffic of the port through an iptables command.
And S208, replacing the previously obtained working data of the at least one port of the at least one other cluster device by using the newly obtained working data of the at least one port of the at least one other cluster device.
In this embodiment, after acquiring the working data of the ports of the other cluster devices each time, the target cluster device stores the newly acquired working data of the ports, and deletes the working data of the ports acquired last time. It can be understood that the working data of each port in the cluster system generally has real-time performance, and only the latest working data of the port can correctly reflect the working condition of the port, so that the working condition of each port in the cluster system should be determined by the latest working data of the port without referring to the old working data of the port.
S209, an external target cluster device in the target cluster devices receives the port information obtaining instruction through the control program installed in the local area, and sends the port information obtaining instruction to other target cluster devices.
In the present embodiment, the target port information is acquired through steps 209 to 212. Specifically, in this embodiment, the multiple target cluster devices include one external target cluster device, and the rest are other target cluster devices. The external target cluster device may be specifically configured to obtain an external instruction for operating the cluster system through a control program installed in a local device, and typically may be a query for providing port information in a restful manner to the external device using a python flash, may be a query for providing port information to a user by displaying restful information at a back end in a page by calling the restful information, and may be a query for providing port information in a command line manner to a programmer through a python getot and an optpart module.
Further, in this embodiment, only the external target cluster device in each target cluster device may be used to obtain the external instruction, and only one external target cluster device is in one cluster system. After receiving the port information obtaining instruction through the control program installed in the local, the external target cluster device sends the port information obtaining instruction to the other target cluster devices, so that the other target cluster devices execute the operations in step 210 and step 211.
S210, respectively acquiring an instruction according to the port information by the external target cluster equipment and other target cluster equipment, and performing data processing on the collected working data of at least one port of at least one other cluster equipment corresponding to the external target cluster equipment and the other target cluster equipment to obtain target port information to be integrated.
In this embodiment, the external target cluster device and the other target cluster devices correspond to different other cluster devices, and the external target cluster device and the other target cluster devices respectively collect the working data of the ports of the other cluster devices corresponding to the external target cluster device and the other target cluster devices. After receiving the port information acquisition instruction, the external target cluster device and other target cluster devices perform corresponding data processing on the collected working data of the respective ports according to the port information acquisition instruction to obtain target port information to be integrated corresponding to the stored working data of the respective ports.
And S211, the other target cluster devices send the port information to be integrated, which is obtained by performing data processing on the port information to be integrated, to the external target cluster devices.
In this embodiment, after all other target cluster devices obtain the target port information to be integrated corresponding to the port information obtaining instruction through data processing, the target port information to be integrated is sent to the external target cluster device, so that the external target cluster device performs step 212 to finally obtain the target port information.
S212, the external target cluster equipment obtains target port information according to the port information to be integrated obtained by data processing of the external target cluster equipment and the received target port information to be integrated sent by other target cluster equipment, and the target port information is fed back through a control program installed in the local area.
In this embodiment, the target port information corresponding to the port information obtaining instruction is obtained by the external target cluster device. After receiving target port information to be integrated sent by other target cluster devices, the external target cluster device performs data processing on stored port working data according to the received target port information to be integrated and the external target cluster device itself to obtain target port information to be integrated, performs overall data processing, and finally obtains target port information corresponding to the port information obtaining instruction.
For example, if the port information obtaining instruction is to obtain the total data traffic of all ports in the cluster system, first, each of the other target cluster devices and the external target cluster device may count the data traffic of each port of each other cluster device corresponding to the port information obtaining instruction, obtain the total data traffic of all ports of each other cluster device corresponding to the port information obtaining instruction, and send the total data traffic to the external target cluster device. After receiving the total data traffic of the ports sent by other target cluster devices, the external target cluster device adds the total data traffic of the ports obtained by calculation of the external target cluster device to the received total data traffic of each port, and finally obtains the total data traffic of all the ports of the cluster system.
The embodiment of the invention provides a method for acquiring port information, which adds a step of adding cluster equipment and a step of detecting the connection of the cluster equipment, so that the change of the cluster equipment in a cluster system can be timely and accurately mastered, and further new application can be more accurately deployed.
EXAMPLE III
Fig. 3 is a structural diagram of an apparatus for acquiring port information in a target cluster device in a cluster system according to a third embodiment of the present invention. The same or corresponding terms as those of the above-described embodiments are explained, and the description of the present embodiment is omitted.
As shown in fig. 3, the apparatus includes: a data collection module 301 and a target port information acquisition module 302, wherein:
the data collection module 301 is configured to collect the working data of at least one port of at least one other cluster device through data communication between a control program installed in a local area and port information acquisition programs installed in other cluster devices in the cluster system, where the other cluster devices acquire and store the working data of at least one port of the other cluster devices through the port information acquisition programs installed in the local area;
a target port information obtaining module 302, configured to perform data processing on the collected working data of the at least one port of the at least one other cluster device according to the port information obtaining instruction received by the locally installed control program, to obtain target port information, and feed back the target port information through the locally installed control program.
The embodiment of the invention provides a device for acquiring port information, which firstly collects the working data of at least one port of at least one other cluster device through the data communication between a local control program and port information acquisition programs installed in other cluster devices in a cluster system by a data collection module 301, wherein, other cluster equipment acquires and stores the working data of at least one port of the cluster equipment through a port information acquisition program installed in the local, then by the target port information acquisition module 302 according to the port information acquisition instruction received by the control program installed locally, and performing data processing on the collected working data of at least one port of at least one other cluster device to obtain target port information, and feeding back the target port information through a control program installed locally.
The device solves the technical defects that in the prior art, the port working data of each server in the cluster are respectively and independently acquired manually, the idle port is determined manually, time and labor are wasted, and the time cost and the labor cost are both high, realizes manual removal, automatically collects and processes the port working data of each cluster device in the cluster system, and further quickly, simply and accurately determines the working condition of the port in the cluster system.
On the basis of the above embodiments, the data collection module 301 may include:
the port data acquisition unit is arranged in the first target cluster device and used for acquiring the data communication between the control programs installed in the local and the port information acquisition programs installed in the first cluster device in the cluster system and collecting the working data of at least one port of at least one first cluster device, wherein the first cluster device corresponds to the first target cluster device;
the port data second collecting unit is arranged on a second target cluster device and used for collecting the working data of at least one port of at least one second cluster device through the data communication between a control program installed in the local and a port information acquisition program installed in the second cluster device in the cluster system, wherein the second cluster device corresponds to the second target cluster device;
and the port data transmission unit is respectively arranged in the first target cluster device and the second target cluster device and is used for acquiring the working data of the port collected by the second target cluster device through the control program installed in the local and the control program installed in the second target cluster device by the first target cluster device.
On the basis of the above embodiments, the data collection module 301 may include:
and the port data acquisition unit is arranged in each target cluster device, is used for collecting the working data of at least one port of at least one other cluster device corresponding to the port data acquisition unit through data communication between the control program installed in the local and the port information acquisition programs installed in other cluster devices in the cluster system, and different target cluster devices correspond to different other cluster devices.
On the basis of the foregoing embodiments, the target port information obtaining module 302 may include:
the command acquisition unit is arranged in external target cluster equipment in the target cluster equipment, is used for receiving the port information acquisition command by the external target cluster equipment in the target cluster equipment through a control program installed in the local area, and sends the port information acquisition command to other target cluster equipment;
the data processing unit is respectively arranged in the external target cluster equipment and other target cluster equipment, and is used for respectively acquiring an instruction according to the port information and carrying out data processing on the working data of at least one port of at least one other cluster equipment corresponding to the data processing unit according to the port information acquired by the data processing unit to obtain target port information to be integrated;
the device comprises a to-be-integrated target port information sending unit, a to-be-integrated target port information sending unit and a to-be-integrated target port information sending unit, wherein the to-be-integrated target port information sending unit is arranged in other target cluster equipment and is used for sending the to-be-integrated port information obtained by processing data of the to-be-integrated target port information to the external target cluster equipment by the other target cluster equipment;
and the data integration unit is arranged in the external target cluster equipment and is used for processing data of the external target cluster equipment according to the external target cluster equipment to obtain port information to be integrated and receiving target port information to be integrated sent by other target cluster equipment to obtain target port information, and feeding back the target port information through a control program installed in the local area.
On the basis of the above embodiments, the method may further include:
the cluster entering request receiving module is used for receiving a cluster entering request of the external equipment through a control program installed in the local before collecting working data of at least one port of at least one other cluster equipment;
and the cluster equipment adding module is used for adding the external equipment into the cluster system as other cluster equipment through a control program installed in the local system if the external equipment meets the cluster entering rule according to the cluster entering request.
On the basis of the above embodiments, the method may further include:
the connection detection module is used for detecting the connection of other cluster equipment through a control program installed locally before collecting the working data of at least one port of the other cluster equipment;
and the equipment removing module is used for setting other cluster equipment which does not pass the connection detection as external equipment of the cluster system through a control program installed in the local.
On the basis of the above embodiments, the method may further include:
and the data replacement module is used for performing data processing on the collected working data of the at least one port of the at least one other cluster device according to the port information acquisition instruction received by the locally-installed control program to obtain target port information, and replacing the previously obtained working data of the at least one port of the at least one other cluster device with the newly obtained working data of the at least one port of the at least one other cluster device before the target port information is fed back by the locally-installed control program.
The device for acquiring port information provided by the embodiment of the invention can execute the method for acquiring port information provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. For details of the technology that are not described in detail in this embodiment, reference may be made to a method for acquiring port information provided in any embodiment of the present invention.
Example four
Fig. 4 is a schematic structural diagram of a device in a cluster system according to a fourth embodiment of the present invention. Fig. 4 shows a block diagram of a device 12 in an exemplary cluster system suitable for use to implement an embodiment of the invention. The device 12 in the cluster system shown in fig. 4 is only an example, and should not bring any limitation to the function and the scope of the embodiments of the present invention.
As shown in FIG. 4, the devices 12 in the cluster system are in the form of general purpose computing devices. The components of the device 12 in the cluster system may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
The devices 12 in a clustered system typically include a variety of computer system readable media. These media may be any available media that can be accessed by devices 12 in the cluster system and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The devices 12 in the cluster system may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
The devices 12 in the cluster system may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with the devices 12 in the cluster system, and/or with any devices (e.g., network card, modem, etc.) that enable the devices 12 in the cluster system to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the devices 12 in the cluster system may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with the other modules of the device 12 in the cluster system over the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the devices 12 in the cluster system, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, to implement the port information acquisition method provided by the embodiment of the present invention. Namely:
collecting working data of at least one port of at least one other cluster device through data communication between a control program installed in a local and port information acquisition programs installed in other cluster devices in the cluster system, wherein the other cluster devices acquire and store the working data of at least one port of the other cluster devices through the port information acquisition programs installed in the local; and according to a port information acquisition instruction received by the control program installed locally, performing data processing on the collected working data of at least one port of at least one other cluster device to obtain target port information, and feeding back the target port information through the control program installed locally.
EXAMPLE five
Fifth, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the method for acquiring port information according to any embodiment of the present invention. Namely: collecting working data of at least one port of at least one other cluster device through data communication between a control program installed in the local and port information acquisition programs installed in other cluster devices in the cluster system, wherein the other cluster devices acquire and store the working data of at least one port of the other cluster devices through the port information acquisition programs installed in the local; and according to a port information acquisition instruction received by the control program installed locally, performing data processing on the collected working data of at least one port of at least one other cluster device to obtain target port information, and feeding back the target port information through the control program installed locally.
Computer storage media for embodiments of the present invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for acquiring port information is applied to target cluster equipment in a cluster system, and is characterized by comprising the following steps:
collecting working data of at least one port of at least one other cluster device through data communication between a control program installed in a local and port information acquisition programs installed in other cluster devices in the cluster system, wherein the other cluster devices acquire and store the working data of at least one port of the other cluster devices through the port information acquisition programs installed in the local;
according to a port information acquisition instruction received by the control program installed locally, performing data processing on the collected working data of at least one port of at least one other cluster device to obtain target port information, and feeding back the target port information through the control program installed locally;
the target cluster equipment comprises first target cluster equipment and second target cluster equipment, and different target cluster equipment corresponds to different other cluster equipment in the cluster system; the working data of the port of each other cluster device is collected by the corresponding target cluster device;
after collecting the working data of the ports of the other corresponding cluster devices, each target cluster device uniformly sends the collected working data of the ports to the first target cluster device, so that when the first target cluster device receives the port information acquisition instruction, the first target cluster device directly performs data processing on the port working data of each other cluster device, or after processing the stored working data of the ports, the second target cluster device sends the data processing result to the first target cluster device.
2. The method according to claim 1, wherein the collecting the working data of at least one port of at least one other cluster device through data communication between the locally installed control program and the port information acquiring program installed in the other cluster devices in the cluster system comprises:
the first target cluster equipment collects the working data of at least one port of at least one first cluster equipment through data communication between a control program installed in the local and a port information acquisition program installed in the first cluster equipment in the cluster system, wherein the first cluster equipment corresponds to the first target cluster equipment;
the second target cluster equipment collects the working data of at least one port of at least one second cluster equipment through data communication between the control program installed locally and the port information acquisition program installed in the second cluster equipment in the cluster system, wherein the second cluster equipment corresponds to the second target cluster equipment;
the first target cluster device obtains the working data of the port collected by the second target cluster device through the control program installed locally and the control program installed in the second target cluster device.
3. The method according to claim 1, wherein the collecting the working data of at least one port of at least one other cluster device through data communication between the locally installed control program and the port information acquiring program installed in the other cluster devices in the cluster system comprises:
and each target cluster device collects the working data of at least one port of at least one other cluster device corresponding to the target cluster device through data communication between a control program installed in the local and port information acquisition programs installed in other cluster devices in the cluster system, wherein different target cluster devices correspond to different other cluster devices.
4. The method according to claim 3, wherein the performing, according to a port information obtaining instruction received by the locally installed control program, data processing on the collected working data of at least one port of the at least one other cluster device to obtain target port information, and feeding back the target port information by the locally installed control program includes:
an external target cluster device in the target cluster devices receives a port information acquisition instruction through the control program installed locally, and sends the port information acquisition instruction to other target cluster devices;
the external target cluster equipment and the other target cluster equipment respectively acquire an instruction according to the port information, and perform data processing on the collected working data of at least one port of the other cluster equipment corresponding to the external target cluster equipment and the other target cluster equipment to obtain target port information to be integrated;
the other target cluster equipment sends the port information to be integrated, which is obtained by the data processing of the other target cluster equipment, to the external target cluster equipment;
and the external target cluster equipment obtains target port information according to the port information to be integrated obtained by performing the data processing on the external target cluster equipment and the received target port information to be integrated sent by the other target cluster equipment, and feeds back the target port information through the control program installed locally.
5. The method according to any of claims 1-4, further comprising, prior to said collecting working data of at least one port of at least one of said other cluster devices:
receiving a group entering request of an external device through the control program installed locally;
and if the external equipment meets the group entering rule according to the group entering request, taking the external equipment as the other cluster equipment and adding the other cluster equipment into the cluster system through the control program installed locally.
6. The method according to any of claims 1-4, further comprising, prior to said collecting working data of at least one port of at least one of said other cluster devices:
performing connection detection on each of the other cluster devices through the control program installed locally;
and setting the other cluster equipment which does not pass the connection detection as external equipment of the cluster system through the control program installed locally.
7. The method according to any one of claims 1 to 4, wherein before the performing data processing on the collected working data of at least one port of at least one of the other cluster devices according to the port information obtaining instruction received by the locally installed control program to obtain target port information, and feeding back the target port information by the locally installed control program, the method further includes:
and replacing the previously obtained working data of the at least one port of the at least one other cluster device by using the newly obtained working data of the at least one port of the at least one other cluster device.
8. An apparatus for acquiring port information, which is disposed in a target cluster device in a cluster system, is characterized by comprising:
the data collection module is used for collecting the working data of at least one port of at least one other cluster device through data communication between a control program installed in the local and port information acquisition programs installed in other cluster devices in the cluster system, wherein the other cluster devices acquire and store the working data of at least one port of the other cluster devices through the port information acquisition programs installed in the local;
a target port information obtaining module, configured to perform data processing on the collected working data of at least one port of at least one other cluster device according to a port information obtaining instruction received by the control program installed locally, to obtain target port information, and perform feedback on the target port information through the control program installed locally;
the target cluster equipment comprises first target cluster equipment and second target cluster equipment, and different target cluster equipment corresponds to different other cluster equipment in the cluster system; the working data of the port of each other cluster device is collected by the corresponding target cluster device;
after collecting the working data of the ports of the other cluster devices corresponding to each target cluster device, the target cluster devices uniformly send the collected working data of the ports to the first target cluster device, so that when the first target cluster device receives a port information acquisition instruction, the first target cluster device directly processes the port working data of each other cluster device, or after the second target cluster device processes the stored working data of the ports, the second target cluster device sends the data processing result to the first target cluster device.
9. An apparatus in a cluster system, the apparatus in the cluster system comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method for acquiring port information according to any one of claims 1 to 7.
10. A storage medium containing computer-executable instructions for performing the method of acquiring port information of any one of claims 1-7 when executed by a computer processor.
CN201910511657.7A 2019-06-13 2019-06-13 Cluster-based port information acquisition method and device Active CN112087474B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910511657.7A CN112087474B (en) 2019-06-13 2019-06-13 Cluster-based port information acquisition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910511657.7A CN112087474B (en) 2019-06-13 2019-06-13 Cluster-based port information acquisition method and device

Publications (2)

Publication Number Publication Date
CN112087474A CN112087474A (en) 2020-12-15
CN112087474B true CN112087474B (en) 2022-09-20

Family

ID=73733647

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910511657.7A Active CN112087474B (en) 2019-06-13 2019-06-13 Cluster-based port information acquisition method and device

Country Status (1)

Country Link
CN (1) CN112087474B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102647302A (en) * 2012-04-28 2012-08-22 浪潮电子信息产业股份有限公司 Monitoring and managing method aiming at cluster node network and ports
WO2013001208A1 (en) * 2011-06-29 2013-01-03 Bull Sas Method for assigning logical addresses to the connection ports of devices of a server cluster, and corresponding computer program and server cluster
CN108733527A (en) * 2017-04-24 2018-11-02 北京京东尚科信息技术有限公司 System, method and apparatus for test server function
CN108829509A (en) * 2018-05-03 2018-11-16 山东汇贸电子口岸有限公司 Distributed container cluster framework resources management method based on domestic CPU and operating system
CN109462491A (en) * 2017-09-06 2019-03-12 北京京东尚科信息技术有限公司 System, method and apparatus for testing service device function

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013001208A1 (en) * 2011-06-29 2013-01-03 Bull Sas Method for assigning logical addresses to the connection ports of devices of a server cluster, and corresponding computer program and server cluster
CN102647302A (en) * 2012-04-28 2012-08-22 浪潮电子信息产业股份有限公司 Monitoring and managing method aiming at cluster node network and ports
CN108733527A (en) * 2017-04-24 2018-11-02 北京京东尚科信息技术有限公司 System, method and apparatus for test server function
CN109462491A (en) * 2017-09-06 2019-03-12 北京京东尚科信息技术有限公司 System, method and apparatus for testing service device function
CN108829509A (en) * 2018-05-03 2018-11-16 山东汇贸电子口岸有限公司 Distributed container cluster framework resources management method based on domestic CPU and operating system

Also Published As

Publication number Publication date
CN112087474A (en) 2020-12-15

Similar Documents

Publication Publication Date Title
CN110489391B (en) Data processing method and related equipment
CN108776934B (en) Distributed data calculation method and device, computer equipment and readable storage medium
CN109710615B (en) Database access management method, system, electronic device and storage medium
CN109194736B (en) Message duplicate removal method and device, electronic equipment, medium and unmanned vehicle
CN109542741B (en) Automatic log grouping storage method and device, computer equipment and storage medium
CN109284180B (en) Task scheduling method and device, electronic equipment and storage medium
CN112965879A (en) Data processing method and device, electronic equipment and readable storage medium
CN113765980A (en) Current limiting method, device, system, server and storage medium
CN110647318A (en) Method, device, equipment and medium for creating instance of stateful application
CN111949402A (en) Database request processing method and device, computer equipment and storage medium
CN110706148B (en) Face image processing method, device, equipment and storage medium
CN112882833B (en) Data acquisition method and device, computer equipment and storage medium
CN112087474B (en) Cluster-based port information acquisition method and device
US7680921B2 (en) Management system, management computer, managed computer, management method and program
CN116723198A (en) Multi-node server host control method, device, equipment and storage medium
CN111770208A (en) Control method and device for Internet of things equipment
CN112395141B (en) Data page management method and device, electronic equipment and storage medium
CN112950447B (en) Resource scheduling method, device, server and storage medium
CN112818204A (en) Service processing method, device, equipment and storage medium
CN114218000A (en) Log management method and device, electronic equipment and computer readable storage medium
CN109309583B (en) Information acquisition method and device based on distributed system, electronic equipment and medium
CN109032821B (en) Automatic driving subject message processing method, device, equipment and storage medium
CN113760940A (en) Quota management method, device, equipment and medium applied to distributed system
CN112950833A (en) Authorization method, device, equipment and storage medium of access control equipment
CN106528577B (en) Method and device for setting file to be cleaned

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
GR01 Patent grant
GR01 Patent grant