Data acquisition method, device, equipment and storage medium
By using a Master-Slave multi-cluster architecture and custom interface commands, the problem of poor data collection performance in cloud platform systems has been solved, achieving automated deployment and efficient data collection, and improving scalability and ease of maintenance.
Patent Information
- Application Number
- CN202310791580.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-29
- Publication Date
- 2026-12-01
- Estimated Expiration
- 2043-06-29
AI Technical Summary
Existing data collection methods suffer from poor collection results in cloud platform systems, especially in multi-cluster environments. Agents require manual maintenance, cannot be automatically deployed, have low scalability, and have high learning costs.
A Master-Slave multi-cluster architecture is adopted. The master node obtains the target interface command and sends it to the corresponding slave node for data collection according to the interface command type. The remote management tool pssh and tools such as Marathon are used to acquire the data, and the data is stored in the OceanBase database through Nginx proxy. Docker images and security access rules are configured to realize customized information collection.
It improves the effectiveness and scalability of data collection, simplifies the maintenance process, supports automated deployment and expansion, eliminates the need for secondary deployment, and reduces operation and maintenance costs.
Smart Images

Figure CN116846944B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a data acquisition method, apparatus, device, and storage medium. Background Technology
[0002] Cloud platform information refers to various data information in a cloud computing environment, including cloud services, cloud resources, and cloud applications. When using a cloud platform, this data information needs to be managed, monitored, maintained, and optimized to ensure the stability, reliability, and efficiency of the cloud platform.
[0003] Currently, when maintaining data information, cloud platform systems need to collect data from host information in multiple clusters. Existing data collection methods typically deploy agents in the system and obtain data information through these agents for cloud platform information maintenance.
[0004] However, existing data collection methods suffer from poor collection results. Summary of the Invention
[0005] This application provides a data acquisition method, apparatus, device, and storage medium to solve the problem of poor acquisition effect in existing data acquisition methods.
[0006] In a first aspect, this application provides a data acquisition method applied to a data acquisition system, the data acquisition system including a master node and slave nodes, the method including:
[0007] The master node obtains the target interface instruction, which is the application programming interface instruction called by the user from the host's software system and used to extend the system's functions. The host is the target host of the target cluster in the multi-cluster system.
[0008] The master node sends the target interface instruction to the target slave node according to the type of the target interface instruction. The target slave node is the slave node corresponding to the type of the target interface instruction.
[0009] If the target interface command is used to collect basic information data, the target slave node will collect data from the host's database through the pssh remote management tool to obtain the host's basic data.
[0010] In this application, after the master node sends the target interface instruction to the target slave node according to the type of the target interface instruction, the method further includes:
[0011] If the target interface command is used to collect host node information, resource capacity, and tag attributes, then the target slave node will collect data from the host's database through the distributed resource manager interface to obtain the host node information, resource capacity, and tag attribute data.
[0012] In this application, after the master node sends the target interface instruction to the target slave node according to the type of the target interface instruction, the method further includes:
[0013] If the target interface command is used to collect Marathon instances, the target slave node will collect data from the host's database through Marathon to obtain the host's Marathon instance data.
[0014] In this application, if the target interface command is a command for collecting basic information data, then after the target slave node collects data from the host's database using the pssh remote management tool to obtain the host's basic data, the method further includes:
[0015] The goal is to encapsulate the host's basic data from the node to obtain the encapsulated data;
[0016] The encapsulated data is stored or updated in the OceanBase database through an Nginx proxy.
[0017] In this application, if the target also obtains target data from the node, and the target data is at least one of the following: host basic data, host node information data, resource capacity data, tag attribute data, and Marathon instance data, the method further includes:
[0018] The host's basic data and target data are encapsulated to obtain encapsulated data;
[0019] The encapsulated data is stored or updated in the OceanBase database through an Nginx proxy.
[0020] In this application, before the master node obtains the target interface instruction, the method further includes:
[0021] Obtain the Docker image of the data acquisition system. The Docker image includes the master node installation package and the slave node installation package.
[0022] In response to the user's installation command, a Docker image is installed on the host machine to obtain the data acquisition system.
[0023] In this application, after installing a Docker image on the host in response to a user's installation command to obtain a data acquisition system, the method further includes:
[0024] Configure the security access rules for the data acquisition system to execute the steps for the master node to obtain the target interface command.
[0025] Secondly, this application provides a data acquisition device for use in a data acquisition system, the data acquisition system including a master node and slave nodes, the device comprising:
[0026] The acquisition module is used by the master node to acquire target interface instructions. The target interface instructions are application programming interface instructions called by the user from the host's software system and used to extend the system's functions. The host is the target host of the target cluster in the multi-cluster system.
[0027] The sending module is used by the master node to send the target interface instruction to the target slave node according to the type of the target interface instruction. The target slave node is the slave node corresponding to the type of the target interface instruction.
[0028] A data acquisition module is used to, if the target interface instruction is an instruction for collecting basic information data, allow the target slave node to collect data from the host's database via the pssh remote management tool to obtain the host's basic data. Thirdly, this application provides an electronic device, including: a processor and a memory communicatively connected to the processor;
[0029] The memory stores instructions that the computer executes;
[0030] The processor executes computer execution instructions stored in memory to implement the method of this application.
[0031] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method of this application.
[0032] The data acquisition method, apparatus, device, and storage medium provided in this application obtain target interface instructions through a master node. These target interface instructions are application programming interface (API) instructions called by the user from the host's software system to extend system functionality. The host is the target host of the target cluster in a multi-cluster system. The master node sends the target interface instructions to target slave nodes based on their type, where each target slave node corresponds to the type of the target interface instruction. If the target interface instruction is for collecting basic information data, the target slave node collects data from the host's database using a pssh remote management tool. This method allows for the configuration of target interface instructions, representing API instructions for secondary development calls, based on data acquisition needs and the host's software system. This enables customized information acquisition based on the target interface instructions, thereby expanding the range of data types collected and improving the data acquisition effect. Attached Figure Description
[0033] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0034] Figure 1 This is an application scenario diagram of the data acquisition method provided in the embodiments of this application;
[0035] Figure 2 A flowchart illustrating another data acquisition method provided in an embodiment of this application;
[0036] Figure 3 This is a schematic diagram of the structure of the data acquisition device provided in the embodiments of this application;
[0037] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;
[0038] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0039] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0040] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0041] In existing technologies, cloud platform systems can obtain information through agent reporting. However, currently, due to the need for extensive manual maintenance of agents, automatic collection and reporting via agents may have the following problems: agents need to be deployed on a large number of hosts, making later maintenance difficult; agent anomalies are frequently encountered, requiring manual intervention and consuming the energy of operations and maintenance personnel; automated deployment is not possible, and for cloud platforms with frequent host expansion, installation is required each time, which does not conform to the concept of intelligent and automated operations and maintenance; agent-reported messages require pre-written code logic, resulting in low scalability, and most systems have complex front-ends, leading to high learning costs.
[0042] To address the aforementioned issues, the data acquisition method provided in this application allows for the configuration of target interface commands, representing API instructions for secondary development calls, based on data acquisition needs and the host software system. This enables customized information acquisition according to the target interface commands, thereby expanding the range of data types collected. Furthermore, it allows for image installation and deployment via a Master-Slave multi-cluster architecture, simplifying maintenance and automatically updating and expanding host information without requiring secondary deployment. The reserved API interface enhances scalability, thus improving the effectiveness of data acquisition.
[0043] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0044] Figure 1 This diagram illustrates an application scenario for the data acquisition method provided in this embodiment. For example... Figure 1 As shown, the data acquisition system applied to the data acquisition method is a Master-Slave multi-cluster architecture, which includes Master nodes and Slave nodes. The Master node is used to control the Slave nodes to perform data acquisition and stores the acquired data to OceanBase through an Nginx proxy.
[0045] The execution entity of the data acquisition method provided in this application embodiment can be a server. The server can be a device such as a mobile phone, tablet, or computer. This embodiment does not impose any particular restrictions on the implementation method of the execution entity, as long as the execution entity can obtain the target interface instruction through the master node. The target interface instruction is an application programming interface instruction called by the user from the host's software system and used to extend system functions. The host is the target host of the target cluster in a multi-cluster system. The master node sends the target interface instruction to the target slave node according to the type of the target interface instruction, where the target slave node is the slave node corresponding to the type of the target interface instruction. If the target interface instruction is an instruction for collecting basic information data, the target slave node collects data from the host's database through a pssh remote management tool to obtain the host's basic data.
[0046] Figure 2 This is a flowchart illustrating the data acquisition method provided in this embodiment. The executing entity of this method can be a server or other servers; this embodiment does not impose any particular limitations. Figure 2 As shown, the method may include:
[0047] S201. The master node obtains the target interface instruction. The target interface instruction is an application programming interface instruction called by the user from the host's software system and used to extend the system's functions. The host is the target host of the target cluster in the multi-cluster system.
[0048] The target interface instruction can refer to the instruction sent by the user to the data acquisition system for data acquisition. In this embodiment, the target interface instruction can be a user-defined API (Application Programming Interface) instruction called by secondary development. That is, the target interface instruction can be an application interface instruction called by the user from the host software system and used to extend the system function.
[0049] A host can refer to a device whose data is being acquired by a data acquisition system. In a multi-cluster system, the host is the target host of the target cluster. A multi-cluster system can refer to a system composed of multiple independent computer clusters, which can be homogeneous or heterogeneous. In a multi-cluster system, different clusters can communicate and collaborate through network connections, thereby achieving resource sharing and load balancing. A target cluster can refer to one or more clusters in a multi-cluster system, and a target host can refer to one or more hosts within that target cluster. In this embodiment, the host can be a specific host within the target cluster, and the target cluster can be a cluster within a multi-cluster system. The data acquisition system is a system that corresponds one-to-one with the host. Therefore, by obtaining target interface instructions, data can be acquired from the host through the data acquisition system.
[0050] In this embodiment of the application, when it is necessary to obtain data from multiple hosts, it is only necessary to install the corresponding data acquisition system on each host and obtain data by sending instructions to each data acquisition system.
[0051] S202. The master node sends the target interface instruction to the target slave node according to the type of the target interface instruction, wherein the target slave node is the slave node corresponding to the type of the target interface instruction.
[0052] The types of target interface instructions can include instruction types for collecting basic information data, instruction types for collecting host node information, resource capacity, and tag attributes, and instruction types for collecting Marathon instances.
[0053] A target slave node can refer to a slave node that collects data through an interface corresponding to the type of the target interface command. Through the target slave node, data corresponding to the target interface command can be obtained quickly and accurately.
[0054] S203. If the target interface command is a command used to collect basic information data, the target slave node will collect data from the host's database through the pssh remote management tool to obtain the host's basic data.
[0055] When the target interface command is a command used to collect basic information data, the target slave node can be selected to collect data from the host's database through the pssh remote management tool.
[0056] pssh remote management tools refer to Python-based remote management tools that can execute commands or scripts on multiple hosts simultaneously. They use the SSH protocol for remote connections and support parallel command execution, thus improving efficiency.
[0057] If the target interface command is used to collect basic information data, the target slave node collects data from the host's database using the pssh remote management tool. After obtaining the host's basic data, the method also includes:
[0058] The goal is to encapsulate the host's basic data from the node to obtain the encapsulated data;
[0059] The encapsulated data is stored or updated in the OceanBase database through an Nginx proxy.
[0060] In this embodiment of the application, if the target node also obtains target data, and the target data is at least one of the following: host basic data, host node information data, resource capacity data, tag attribute data, and Marathon instance data, the method further includes:
[0061] The host's basic data and target data are encapsulated to obtain encapsulated data;
[0062] The encapsulated data is stored or updated in the OceanBase database through an Nginx proxy.
[0063] Data encapsulation refers to the process of organizing and packaging data according to a certain format to obtain encapsulated data, so as to facilitate transmission and processing in the network.
[0064] OceanBase is a distributed relational database system. Due to its high availability, high performance, and high scalability, and its distributed architecture supporting multi-replica synchronous replication, automatic failover, and automatic load balancing, OceanBase can handle large-scale data storage.
[0065] Nginx can act as both a web server and a reverse proxy server, serving various purposes such as load balancing, HTTP caching, SSL endpoint proxy, and virtual hosting. Nginx's proxy function forwards client requests to backend application servers, achieving load balancing and high availability. Nginx supports multiple proxy methods, including forward proxy and reverse proxy. A forward proxy acts as a proxy for the client, while a reverse proxy acts as a proxy for the server. In a reverse proxy, Nginx acts as the proxy server, receiving client requests and forwarding them to the backend application server, then returning the application server's response to the client. This hides the real IP address of the backend server, improving system security. In this embodiment, Nginx proxy can be used to store encapsulated data in an OceanBase database.
[0066] In this embodiment of the application, the method after the master node sends the target interface instruction to the target slave node according to the type of the target interface instruction may further include:
[0067] If the target interface command is used to collect host node information, resource capacity, and tag attributes, then the target slave node will collect data from the host's database through the distributed resource manager interface to obtain the host node information, resource capacity, and tag attribute data.
[0068] In this embodiment of the application, the method after the master node sends the target interface instruction to the target slave node according to the type of the target interface instruction may further include:
[0069] If the target interface command is used to collect Marathon instances, the target slave node will collect data from the host's database through Marathon to obtain the host's Marathon instance data.
[0070] When the target interface command is used to collect data from a Marathon instance, the target slave node can be selected to collect data from the host's database through Marathon. Marathon can be a Mesos framework that supports running long-lived services, manages multi-process clusters, discovers services, provides REST API services for deployment, offers SSL and basic authentication, configuration constraints, service discovery and load balancing through HAProxy and DNS, and allows for customized monitoring strategies to enable automatic scaling of tasks (one application corresponds to multiple tasks).
[0071] When the target interface command is for collecting data from Marathon instances, the target slave node can be selected to collect data from the host's database through the distributed resource manager interface. The distributed resource manager interface (Mesos) can be a cluster management platform. That is, it can be a kernel of a distributed system responsible for allocating cluster resources, which can refer to CPU resources, memory resources, storage resources, network resources, etc. Various frameworks such as Spark, Storm, Hadoop, and Marathon can run in Mesos.
[0072] In this embodiment of the application, the method before the master node obtains the target interface instruction may further include:
[0073] Obtain the Docker image of the data acquisition system. The Docker image includes the master node installation package and the slave node installation package.
[0074] In response to the user's installation command, a Docker image is installed on the host to obtain the data acquisition system.
[0075] The Docker image can be an open-source application container engine. By packaging the data acquisition system's application and its dependencies into a portable image, a Docker image of the data acquisition system can be obtained. This Docker image can then be deployed to any Linux or Windows machine for use by other users.
[0076] In this embodiment of the application, by configuring the master node installation package and the slave node installation package separately, it is possible to make the installation application more compatible with various hosts for data collection when downloading Docker images.
[0077] In this embodiment of the application, the method after installing the Docker image on the host in response to the user's installation command to obtain the data acquisition system may further include:
[0078] Configure the security access rules for the data acquisition system to execute the steps for the master node to obtain the target interface command.
[0079] Security access rules refer to a series of rules and measures established in a network environment to ensure the security of systems and data, used to restrict and manage the access permissions of users or devices. In this embodiment, by configuring security access rules in the data acquisition system, the step of the master node obtaining target interface instructions can be performed, thereby ensuring the security of data acquisition.
[0080] The data collection method provided in this application embodiment can automatically update host information by setting a scheduled task, and collect information comprehensively based on the open-source Mesos and Marathon frameworks, thereby improving the data collection effect.
[0081] Figure 3 This is a flowchart illustrating another data acquisition method provided in an embodiment of this application. Figure 3 As shown, the method may include:
[0082] S301, the Master sends collection commands to each Slave node, including configured collection commands or API commands called by secondary development;
[0083] After receiving the request, the S302 and Slave nodes begin data collection. Host node information, resource capacity, and tag attributes are obtained through the Mesos interface, basic information is obtained remotely via Pssh, and the Marathon instance is obtained through Marathon.
[0084] S303. After data collection, the data is encapsulated and persistently stored or updated through an Nginx proxy.
[0085] The data can be persistently stored or updated to the OceanBase database. Master addresses for each cluster: Mesos-master and Marathon environment information.
[0086] In this embodiment, the data acquisition system can be divided into a Master-Slave architecture. The Master can be deployed on any host (or any cluster Master node), while the slaves are deployed on the Master nodes of each cluster, achieving service communication through networking. The Master system's main code logic primarily collects basic host information, tag attributes, tenant services, resource capacity, and other data. The Slave is responsible for receiving instructions, periodically collecting data from its local cluster, and reporting it. The Slave connects to a database through an Nginx proxy, enabling periodic data updates or persistent storage. After system deployment, by configuring secure access rules, commands can be issued to achieve customized data acquisition.
[0087] The flowchart of another data acquisition method provided in this application embodiment can be used to install and deploy images through a Master-Slave multi-cluster architecture, which is simple to maintain and can automatically update the expansion host information without secondary deployment. In addition, it reserves API interfaces, which can be customized by operation and maintenance users to collect information, thus improving scalability.
[0088] Figure 4This is a schematic diagram of the data acquisition device provided in an embodiment of this application. Figure 4 As shown, the data acquisition device 40 includes: an acquisition module 401, a transmission module 402, and a data acquisition module 403. Wherein:
[0089] The acquisition module 401 is used by the master node to acquire the target interface instruction. The target interface instruction is the application programming interface instruction called by the user from the software system of the host and used to extend the system function. The host is the target host of the target cluster in the multi-cluster system.
[0090] The sending module 402 is used by the master node to send the target interface instruction to the target slave node according to the type of the target interface instruction, wherein the target slave node is the slave node corresponding to the type of the target interface instruction;
[0091] The data acquisition module 403 is used to acquire basic data of the host from the host's database through the pssh remote management tool if the target interface command is a command for acquiring basic information data.
[0092] In this embodiment of the application, the data acquisition module 403 can also be specifically used for:
[0093] If the target interface command is used to collect host node information, resource capacity, and tag attributes, then the target slave node will collect data from the host's database through the distributed resource manager interface to obtain the host node information, resource capacity, and tag attribute data.
[0094] In this embodiment of the application, the data acquisition module 403 can also be specifically used for:
[0095] If the target interface command is used to collect Marathon instances, the target slave node will collect data from the host's database through Marathon to obtain the host's Marathon instance data.
[0096] In this embodiment of the application, the data acquisition module 403 can also be specifically used for:
[0097] The goal is to encapsulate the host's basic data from the node to obtain the encapsulated data;
[0098] The encapsulated data is stored or updated in the OceanBase database through an Nginx proxy.
[0099] In this embodiment of the application, the data acquisition module 403 can also be specifically used for:
[0100] The host's basic data and target data are encapsulated to obtain encapsulated data;
[0101] The encapsulated data is stored or updated in the OceanBase database through an Nginx proxy.
[0102] In this embodiment of the application, the data acquisition module 403 can also be specifically used for:
[0103] Obtain the Docker image of the data acquisition system. The Docker image includes the master node installation package and the slave node installation package.
[0104] In response to the user's installation command, a Docker image is installed on the host machine to obtain the data acquisition system.
[0105] In this embodiment of the application, the data acquisition module 403 can also be specifically used for:
[0106] Configure the security access rules for the data acquisition system to execute the steps for the master node to obtain the target interface command.
[0107] As can be seen from the above, the data acquisition device in this embodiment consists of an acquisition module 401, used by the master node to acquire target interface instructions. The target interface instructions are application programming interface (API) instructions called by the user from the host's software system and used to extend system functions. The host is the target host of the target cluster in the multi-cluster system. A sending module 402 is used by the master node to send the target interface instructions to the target slave nodes according to their type. The target slave nodes are slave nodes corresponding to the type of the target interface instructions. A data acquisition module 403 is used to, if the target interface instructions are for collecting basic information data, allow the target slave nodes to collect data from the host's database using the pssh remote management tool to obtain the host's basic data. This improves the data acquisition efficiency.
[0108] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 As shown, the electronic device 50 includes:
[0109] The electronic device 50 may include a processor 501 with one or more processing cores, a memory 502 with one or more computer-readable storage media, a communication component 503, and other components. The processor 501, memory 502, and communication component 503 are connected via a bus 504.
[0110] In the specific implementation process, at least one processor 501 executes computer execution instructions stored in memory 502, causing at least one processor 501 to execute the data acquisition method described above.
[0111] The specific implementation process of processor 501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0112] In the above Figure 5 In the illustrated embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0113] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0114] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0115] In some embodiments, a computer program product is also provided, including a computer program or instructions that, when executed by a processor, implement the steps in any of the above data acquisition methods.
[0116] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0117] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0118] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the data acquisition methods provided in embodiments of this application.
[0119] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0120] According to one aspect of this application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium.
[0121] Since the instructions stored in the storage medium can execute the steps of any of the data acquisition methods provided in the embodiments of this application, the beneficial effects that can be achieved in any of the data acquisition methods provided in the embodiments of this application can be realized, as detailed in the preceding embodiments, and will not be repeated here.
[0122] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0123] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A data acquisition method, characterized by, Applied to a data acquisition system, the data acquisition system including a master node and slave nodes, the method includes: The master node obtains the target interface instruction, which is an application programming interface instruction called by the user from the software system of the host and used to extend the system function. The host is the target host of the target cluster in the multi-cluster system. The master node sends the target interface instruction to the target slave node according to the type of the target interface instruction, wherein the target slave node is the slave node corresponding to the type of the target interface instruction; If the target interface instruction is an instruction for collecting basic information data, then the target slave node collects data from the host's database through the pssh remote management tool to obtain the host's basic data; If the target interface instruction is an instruction for collecting host node information, resource capacity, and tag attributes, then the target slave node collects data from the host's database through the distributed resource manager interface to obtain the host node information data, resource capacity data, and tag attribute data of the host. If the target interface instruction is an instruction for collecting Marathon instances, then the target slave node collects data from the host's database through Marathon to obtain the host's Marathon instance data.
2. The method of claim 1, wherein, If the target interface instruction is an instruction for collecting basic information data, then after the target slave node collects data from the host's database using the pssh remote management tool to obtain the host's basic data, the method further includes: The target node encapsulates the host's basic data to obtain encapsulated data. The encapsulated data is stored or updated in the OceanBase database via an Nginx proxy.
3. The method of claim 2, wherein, If the target node also obtains target data, and the target data is at least one of host node information data, resource capacity data, tag attribute data, and Marathon instance data, the method further includes: The host's basic data and the target data are encapsulated to obtain encapsulated data; The encapsulated data is stored or updated in the OceanBase database via an Nginx proxy.
4. The method of claim 1, wherein, Before the master node obtains the target interface instruction, the method further includes: Obtain the Docker image of the data acquisition system, the Docker image including a master node installation package and a slave node installation package; In response to the user's installation command, the Docker image is installed on the host to obtain the data acquisition system.
5. The method of claim 4, wherein, After installing the Docker image on the host in response to the user's installation command to obtain the data acquisition system, the method further includes: Configure the security access rules of the data acquisition system to execute the step of the master node obtaining the target interface instruction.
6. A data acquisition device, characterized by Applied to a data acquisition system, the data acquisition system including a master node and slave nodes, the device includes: The acquisition module is used by the master node to acquire target interface instructions, which are application programming interface instructions called by the user from the software system of the host and used to extend the system functions. The host is the target host of the target cluster in the multi-cluster system. The sending module is used by the master node to send the target interface instruction to the target slave node according to the type of the target interface instruction, wherein the target slave node is a slave node corresponding to the type of the target interface instruction; The data acquisition module is used to, if the target interface instruction is an instruction for collecting basic information data, then the target slave node collects data from the host's database through the pssh remote management tool to obtain the host's basic data; The data acquisition module is used to, if the target interface instruction is an instruction for collecting host node information, resource capacity, and tag attributes, then the target slave node collects data from the host's database through the distributed resource manager interface to obtain the host node information data, resource capacity data, and tag attribute data of the host. The data acquisition module is used to, if the target interface instruction is an instruction for acquiring Marathon instances, then the target slave node acquires data from the host's database through Marathon to obtain the host's Marathon instance data.
7. An electronic device, comprising: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Cluster data acquisition method
CN113722263A
