CN109639752B - Method and device for scheduling agent, computer equipment and storage medium - Google Patents

Method and device for scheduling agent, computer equipment and storage medium Download PDF

Info

Publication number
CN109639752B
CN109639752B CN201811237324.1A CN201811237324A CN109639752B CN 109639752 B CN109639752 B CN 109639752B CN 201811237324 A CN201811237324 A CN 201811237324A CN 109639752 B CN109639752 B CN 109639752B
Authority
CN
China
Prior art keywords
redis
agent
agents
host
hosts
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
CN201811237324.1A
Other languages
Chinese (zh)
Other versions
CN109639752A (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.)
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN201811237324.1A priority Critical patent/CN109639752B/en
Publication of CN109639752A publication Critical patent/CN109639752A/en
Application granted granted Critical
Publication of CN109639752B publication Critical patent/CN109639752B/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/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/04Network management architectures or arrangements
    • H04L41/046Network management architectures or arrangements comprising network management agents or mobile agents therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

Abstract

The invention discloses a method, a device, computer equipment and a storage medium for scheduling an agent for monitoring a redis service by a server, belonging to the technical field of system data monitoring, wherein the method comprises the following steps: reading all redis hosts in the network from an object configuration table; polling all agents for the redis hosts connected to the agents; if a plurality of agents are determined to be simultaneously connected with a redis host according to all polled redis hosts connected with the agents, distributing the redis host to one agent of the agents, and releasing the connection between the other agents and the redis host; and if the read redis hosts and all polled redis hosts connected with the agents determine that the redis hosts are not connected with any agents, selecting one agent from the agents in the network to be connected with the redis hosts not connected with any agents. Therefore, monitoring omission is avoided while the quality, the efficiency and the timeliness of the redis service monitoring are improved.

Description

Method and device for scheduling agent, computer equipment and storage medium
Technical Field
The present invention relates to the technical field of system data monitoring, and in particular, to a method, an apparatus, a computer device, and a storage medium for scheduling an agent monitoring a redis service by a server.
Background
The redis is widely applied to a business system cache service as an efficient memory database, and a large amount of real-time interaction with the redis service exists in an online synchronous business scene, so that the running state monitoring of the redis service is very important. For example, when the redis is deployed to an enterprise for operation, each client in the enterprise network can use the redis service, and the client using the redis every day is regarded as a redis host.
In the traditional monitoring method, after the build and delivery of the redis service, due to the characteristics of distributed deployment of different network areas in an enterprise (different network areas of different redis hosts in the enterprise belong to different network areas, for example, an office belongs to one network area, and a firewall is arranged between different network areas), in this way, operation and maintenance personnel need to take the different network areas into consideration during operation and maintenance, specially write monitoring scripts for each network area for monitoring, report and summarize the content of the scripts monitored in each network area, and comprehensively evaluate the operation condition of the entire redis. Operation and maintenance personnel need to manually identify a network area and configure a shell monitoring script to acquire redis running state data, the whole process is very inefficient, and the conditions of untimely monitoring implementation and even monitoring omission exist.
Disclosure of Invention
Based on the above, in order to solve the technical problems of low efficiency, untimely monitoring and even omission of the manual monitoring process in the related art, the invention provides a method, a device, computer equipment and a storage medium for scheduling an agent for monitoring a redis service by a server.
In a first aspect, a method for scheduling an agent monitoring a redis service by a server is provided, where the method is applied to a network in which a redis host, an agent and a server using the redis service are connected, where the agent monitors an operating state of the responsible redis host, and reports the monitored operating state to the server, and the method includes:
reading all redis hosts in the network from an object configuration table;
polling all agents for the redis hosts connected to the agents;
if a plurality of agents are determined to be simultaneously connected with one redis host according to all polled redis hosts connected with the agents, the redis host is distributed to one agent of the agents, and the connection between the rest agents and the redis host is released;
if the redis hosts which are not connected with any proxy are determined according to all read redis hosts and all polled redis hosts connected with the proxy, selecting one proxy from the proxies in the network to be connected with the redis hosts which are not connected with any proxy;
if it is determined that a plurality of agents are simultaneously connected to one redis host according to all polled redis hosts connected with the agents, allocating the redis host to one of the agents, the method specifically comprises the following steps:
determining a processing load for each of the plurality of agents;
selecting an agent from the plurality of processes according to the processing load;
assigning the redis host to the selected agent.
In one embodiment, the selecting an agent from the plurality of agents according to the processing load includes:
and selecting one agent from the plurality of agents according to the processing load and the distance between the agent and the redis host.
In one embodiment, the selecting an agent from the plurality of agents according to the processing load and the distance from the redis host specifically includes:
selecting the agent with the smallest weighted sum of the processing load and the distance from the redis host from the plurality of agents.
In one embodiment, before reading all redis hosts within the network from an object configuration table, the method includes:
and in response to a registration request of a redis host which is not registered in the network, writing the redis host into the object configuration table.
In one embodiment, the processing load of the agent comprises:
the number of connected redis hosts or the total storage capacity of the connected redis hosts of the proxy.
In one embodiment, the step of selecting an agent to connect to the redis host that is not connected to any agent comprises:
determining a processing load of the agent or a distance to the redis host or a weighted sum of the processing load and the distance;
and according to the processing load or the distance or the weighted sum, selecting the agent with the minimum processing load or the closest processing load or the weighted sum to be connected with the redis host which is not connected with any agent.
In one embodiment, the number of redis hosts of the proxy connection has a predetermined threshold, and if the number of redis hosts of the proxy connection exceeds the threshold, the method further includes:
extracting the redis hosts connected with the agents with the host numbers exceeding the threshold value, and disconnecting the redis hosts from the agents to ensure that the number of the redis hosts connected with the agents does not exceed the threshold value;
determining a distance of the agent from the redis host;
and selecting one agent from the agents in the network to be connected with the redis host according to the distance between the selected agent and the redis host.
In one embodiment, the selecting, according to the processing load, one agent from agents in a network to connect with the redis host includes:
and selecting one agent from the agents in the network to be connected with the redis host according to the processing load and the distance between the selected agent and the redis host.
In one embodiment, selecting an agent from agents in a network to connect to the redis host according to the processing load and the distance from the redis host, specifically includes:
selecting the agent with the smallest weighted sum of the processing load and the distance from the redis host from the agents in the network.
In one embodiment, the processing load according to the agent includes:
the number of connected redis hosts or the total storage capacity of connected redis hosts.
In one embodiment, after determining that there is a redis host not connected to any agent according to all read redis hosts and all polled redis hosts connected to the agent, and selecting an agent from the agents in the network to connect to the redis host not connected to any agent, the method further includes:
receiving redis host data which are reported by the agent, wherein the redis host data comprise various information of a redis host connected with the agent;
and visually displaying the redis host data collected and reported by the agent on an interface, wherein the interface comprises the position of the redis host connected with the agent and the running state of the redis host.
In one embodiment, the agent collects reported redis host data and further includes occupied storage capacity of a redis host connected to the agent, and after receiving the reported redis host data collected by the agent, the method further includes:
generating a change curve of the occupied storage capacity of the redis host according to the reported occupied storage capacity of the redis host;
and displaying the change curve on the interface.
In a second aspect, an apparatus for scheduling, by a server, an agent monitoring a redis service is provided, including:
the host reading unit is used for reading all redis hosts in the network from an object configuration table;
the host polling unit is used for polling the redis host connected with the proxy to all the proxies;
a connection releasing unit, configured to determine that a plurality of agents are simultaneously connected to one redis host according to all polled redis hosts connected to the agents, assign the redis host to one of the agents, and release the connection between the other agents and the redis host;
and the agent distribution unit is used for selecting one agent from the agents in the network to be connected with the redis host which is not connected with any agent if the redis host which is not connected with any agent is determined according to all read redis hosts and all polled redis hosts which are connected with the agents.
In a third aspect, a computer device is provided, which includes a memory and a processor, wherein the memory stores computer readable instructions, and the computer readable instructions, when executed by the processor, cause the processor to execute the steps of the method for scheduling, by a server, an agent monitoring a redis service.
In a fourth aspect, a storage medium storing computer-readable instructions is provided, which when executed by one or more processors, cause the one or more processors to perform the above-described steps of the method for scheduling, by a server, an agent monitoring a redis service.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
the method, the device, the computer equipment and the storage medium for scheduling the agent for monitoring the redis service by the server are applied to a network which is connected with the redis host, the agent and the server using the redis service, wherein the agent monitors the running state of the responsible redis host, reports the monitored running state to the server to replace manpower, and polls the redis host connected with the agent to all the agents after reading all the redis hosts in the network from an object configuration table. And if determining that a plurality of agents are simultaneously connected with one redis host according to all polled redis hosts connected with the agents, distributing the redis host to one agent of the plurality of agents, and removing the connection between the rest agents and the redis host so as to avoid the waste of resources. And if the redis hosts which are not connected with any proxy are determined according to all read redis hosts and all polled redis hosts connected with the proxy, selecting one proxy from the proxies in the network to be connected with the redis hosts which are not connected with any proxy, so as to avoid the situation of monitoring omission. Therefore, the quality, the efficiency and the timeliness of the redis service monitoring are improved, and meanwhile, the monitoring omission is avoided.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
Fig. 1 is an implementation environment diagram of a method for scheduling, by a server, an agent monitoring a redis service provided in one embodiment.
Fig. 2 is a flowchart illustrating a method of scheduling an agent monitoring a redis service by a server according to an exemplary embodiment.
Fig. 3 is a flowchart illustrating a specific implementation of step S130 in a method for scheduling an agent monitoring a redis service by a server according to a corresponding embodiment of fig. 2.
Fig. 4 is a flowchart illustrating another method for scheduling an agent monitoring a redis service by a server according to a corresponding embodiment of fig. 2.
Fig. 5 is a flowchart illustrating a specific implementation of step S140 in a method for scheduling, by a server, an agent monitoring a redis service according to the corresponding embodiment of fig. 2.
Fig. 6 is a flowchart illustrating another method for scheduling an agent monitoring a redis service by a server according to a corresponding embodiment of fig. 2.
Fig. 7 is a flowchart illustrating another method for scheduling an agent monitoring a redis service by a server according to a corresponding embodiment of fig. 2.
Fig. 8 is a flowchart illustrating another method for scheduling, by a server, an agent monitoring a redis service according to a corresponding embodiment of fig. 2.
Fig. 9 is a block diagram illustrating an apparatus for scheduling, by a server, an agent monitoring a redis service according to an example embodiment.
Fig. 10 schematically illustrates an example block diagram of an electronic device for implementing the above-described method for scheduling, by a server, an agent monitoring a redis service.
Fig. 11 schematically illustrates a computer-readable storage medium for implementing the above-described method for scheduling, by a server, an agent monitoring a redis service.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
Fig. 1 is a diagram of an implementation environment in which a server schedules an agent monitoring a redis service, as provided in an embodiment, and as shown in fig. 1, the implementation environment includes a server 100, a plurality of agents 200, and a plurality of redis hosts 300. The server 100, the plurality of agents 200, and the plurality of redis hosts 300 are connected to a network.
The server 100 is a monitoring and scheduling device, such as a computer, a server, etc. for monitoring and scheduling the use of maintenance personnel. The agent 200 may be a virtual machine, for example, a computer or a server used by an agent maintenance person. The redis host 300 has a redis database installed thereon, and can use a redis service.
When the server 100 monitors and schedules the agents 200 and the redis hosts 300, all the redis hosts 300 in the network are read from the object configuration table, and then the redis hosts 300 connected to the agents are polled to all the agents 200. If it is determined that a plurality of agents 200 are simultaneously connected to one redis host 300 according to the polling result, the redis host 300 is assigned to one agent 200 of the plurality of agents 200, and the connection between the rest of the agents 200 and the redis host 300 is released. If it is determined that there is a redis host 300 which is not connected with any agent 200 according to the polling result, selecting one agent 200 from the agents 200 in the network to be connected with the redis host 300 which is not connected with any agent. Therefore, the effect of automatic monitoring and scheduling is achieved.
It should be noted that the server 100 and the plurality of redis hosts 300 may be, but are not limited to, a desktop computer, a personal server, a server cluster, a workstation, a cloud server, and the like. The plurality of agents 200 may be agent devices or virtual machines, but are not limited thereto. The server 100, the plurality of agents 200, and the plurality of redis hosts 300 may be connected through bluetooth, USB (Universal Serial Bus), or other communication connection methods, which is not limited herein.
As shown in fig. 2, in an embodiment, a method for scheduling an agent for monitoring a redis service by a server is provided, where the method for scheduling an agent for monitoring a redis service by a server may be applied to a network in which a redis host 300, an agent and a server 100 using a redis service are connected, where the agent monitors an operating state of the responsible redis host 300 and reports the monitored operating state to the server 100, and specifically may include the following steps:
step S110, reading all redis hosts in the network from an object configuration table;
step S120, polling the redis host connected with the agent to all agents;
step S130, if a plurality of agents are determined to be simultaneously connected with one redis host according to all polled redis hosts connected with the agents, the redis host is distributed to one agent in the plurality of agents, and the connection between the other agents and the redis host is released;
step S140, if it is determined that there is a redis host that is not connected to any proxy according to all read redis hosts and all polled redis hosts connected to the proxy, selecting an agent from the proxies in the network to connect to the redis host that is not connected to any proxy.
In the embodiment, a server plus proxy mode is adopted, and when a network is deployed, one proxy is set in each network area in consideration of different network areas. The agent may be a separate computer or may be a virtual machine that is part of a computer. The server is typically a separate computer, but may also be a virtual machine that is part of a computer. The agent monitors the use condition of the redis of each redis host in the corresponding network area, namely each redis client. The index used in monitoring is fixed, such as redis occupancy, number of accesses per unit time, and the like. The method of monitoring is an existing method. And each agent reports the monitoring result to the server, and the server displays the monitoring result.
In the above-described mode, if efficient and timely perfect monitoring is to be achieved, a condition that the agent set for each network area is constant at the network deployment stage is required. However, in actual operation, the agent and the redis host (client) in the network area may break lines during use, and there is also a possibility that some clients move from one network area to another network area, or that new clients are added in the network area. In addition, during the network deployment phase, it may not be necessary to set up proxies for each network region one by one. Therefore, in the present embodiment, a method of automatically identifying a network region and reconfiguring connectivity of the agent and the redis host in use, i.e., the method disclosed in step S110 to step S140, is used.
In the method, the object configuration table is pre-configured, in which all of the network is stored. The object configuration table only records all redis hosts, and as to which agent is connected, the recording is not performed, because the agent can be replaced by connecting other agents due to weak signals, and the instability exists.
The recording of all the redis hosts is performed by recording IDs of all the redis hosts, where the ID of the host may be an ID of the device, an ID of a user using the device, or other IDs that may indicate an identity of the host, and the present invention is not limited herein.
By the method, waste of agent resources is effectively avoided (step S130), monitoring omission is also avoided (step S140), and high efficiency and timeliness of monitoring are guaranteed.
Optionally, fig. 3 is a detailed description of step S130 in a method for scheduling, by a server, an agent for monitoring a redis service according to a corresponding embodiment shown in fig. 2, where step S130 may include the following steps:
step S131, determining the processing load of each of the plurality of agents;
step S132, according to the processing load, selecting an agent from the plurality of processes;
step S133, assigning the redis host to the selected agent.
Therefore, the agent is selected according to the load, so that not only can the waste of agent resources be avoided, but also the optimal configuration of the agent resources can be realized.
Optionally, the specific step of step S132 in the method for scheduling an agent monitoring a redis service by a server according to the embodiment shown in fig. 3 includes:
and selecting one agent from the plurality of agents according to the processing load and the distance between the agent and the redis host.
Therefore, the agent resources can be reasonably distributed, and the optimal configuration of the network is realized.
Optionally, the foregoing embodiment further specifically includes:
selecting the agent with the smallest weighted sum of the processing load and the distance from the redis host from the plurality of agents.
Specifically, the method normalizes the processing load to a certain value between [ 0,1 ] by a normalization algorithm, normalizes the distance between the proxy and the redis host to a certain value between [ 0,1 ] by a normalization algorithm, and takes the proxy with the smallest weighted sum as the proxy to be assigned.
Fig. 4 shows that, in an embodiment, before step S110 in the corresponding embodiment of fig. 2, the method for scheduling, by a server, an agent for monitoring a redis service may further include the following steps:
step S100, responding to the registration request of the redis host which is not registered in the network, and writing the redis host into the object configuration table.
That is, every time a new device is connected to the network, a registration page appears on the new device, an ID of the new device is filled in the registration page, and the like, and the new device ID is recorded in the object configuration table.
The ID of the new device may be the ID of the device, the ID of the user using the device, or other IDs that may indicate the identity of the new device, as mentioned in the embodiment shown in fig. 2, which is not limited herein.
Optionally, in an embodiment corresponding to fig. 2, a processing load of the agent includes:
the number of connected redis hosts or the total storage capacity of the connected redis hosts of the proxy.
Optionally, fig. 5 is a detailed description of step S140 in the method for scheduling an agent monitoring a redis service by a server according to the corresponding embodiment shown in fig. 2, where in the method for scheduling an agent monitoring a redis service by a server, step S140 may include the following steps:
step S141, determining the processing load of the agent or the distance from the redis host or the weighted sum of the processing load and the distance;
step S142, according to the processing load or the distance or the weighted sum, selecting the agent with the minimum processing load or the closest distance or the weighted sum to connect with the redis host not connected with any agent.
Therefore, the agent is distributed according to the processing load or distance or the weighting sum, and the agent resources are reasonably distributed on the premise of avoiding omission.
Fig. 6 shows that, in an embodiment, the number of redis hosts of the proxy connection has a predetermined threshold, and if the number of redis hosts of the proxy connection exceeds the threshold, the method for scheduling, by the server, the proxy monitoring the redis service may further include the following steps:
step S150, extracting the redis hosts connected with the agents with the number of the hosts exceeding the threshold value, disconnecting the redis hosts from the agents, and enabling the number of the redis hosts connected with the agents not to exceed the threshold value;
step S160, determining the distance between the agent and the redis host;
step S170, selecting an agent from the agents in the network to connect with the redis host according to the distance between the network and the redis host.
The predetermined threshold may be 2, 3, or 5, and may be set according to the working conditions of the agent and the host, which is not limited herein.
By setting a predetermined threshold, the phenomenon that the workload of the agent is overlarge due to the fact that the number of redis hosts connected with the agent is too large can be avoided. If the agent workload is too heavy, it may cause the agent to crash or cause other damage to the agent. The monitoring efficiency is low, and partial redis host computer is possible to be separated from monitoring.
The method for extracting the redis host connected to the agent whose number of hosts exceeds the threshold may be random extraction, or may extract the maximum or minimum distance according to the distance between the agent and the redis host, or may be other methods, and the present invention is not limited herein.
And the optimal configuration of the proxy resources can be realized by allocating the proxy according to the distance between the proxy and the redis host.
Optionally, the specific step of step S170 in the method for scheduling, by a server, an agent monitoring a redis service according to the embodiment shown in fig. 6 includes:
and selecting one agent from the agents in the network to be connected with the redis host according to the processing load and the distance between the selected agent and the redis host.
In this way, not only can the workload of the agent be avoided from being too heavy, but also the optimal configuration of the agent resources can be realized.
Optionally, the foregoing embodiment further specifically includes:
selecting, from the plurality of agents, an agent with a smallest weighted sum of the processing load and the distance to the redis host.
Specifically, the method normalizes the processing load to a certain value between [ 0,1 ] through a normalization algorithm, normalizes the distance between the proxy and the redis host to a certain value between [ 0,1 ] through a normalization algorithm, and takes the proxy with the smallest weighted sum as the proxy to be assigned.
Optionally, in the embodiment corresponding to fig. 6, the processing load of the proxy includes:
the number of connected redis hosts or the total storage capacity of the connected redis hosts of the proxy.
Fig. 7 shows that, in an embodiment, after step S140 in the corresponding embodiment of fig. 2, the method for scheduling, by a server, an agent for monitoring a redis service may further include the following steps:
step S180, receiving the reported redis host data collected by the agent, wherein the redis host data comprises various information of the redis host connected with the agent;
and S190, visually displaying the redis host data collected and reported by the agent on an interface, wherein the interface comprises the position of the redis host connected with the agent and the running state of the redis host.
The example of the method for performing the visual display is that if the running state of the redis host is normal, the running state of the redis host is displayed as blue, and if the running state of the redis host is abnormal, the running state of the redis host is displayed as gray. Or the location of the redis host reporting the abnormal operating status, which is not limited herein.
Therefore, after visual display, relevant maintenance operators can know the operation conditions of the agent and the redis host in real time, and management and maintenance are facilitated.
Fig. 8 shows that, in an embodiment, the collection of the reported redis host data by the proxy further includes an occupied storage capacity of the redis host connected to the proxy, and after step S180 in the corresponding embodiment of fig. 7, the method for scheduling, by the server, the proxy monitoring the redis service may further include the following steps:
step S185, generating a change curve of the occupied storage capacity of the redis host according to the reported occupied storage capacity of the redis host;
and step S186, displaying the variation curve on the interface.
Therefore, through the change curve, the working state of the redis host within the whole working time can be displayed, so that relevant personnel can know the working load of each redis host in different time periods to a certain extent, and the clear understanding is provided, so that the subsequent operation and maintenance are conveniently carried out by the relevant operation and maintenance personnel.
As shown in fig. 9, in an embodiment, an apparatus for scheduling an agent for monitoring a redis service by a server is provided, and the apparatus for scheduling an agent for monitoring a redis service by a server may be integrated in the server 100, and specifically may include a host reading unit 110, a host polling unit 120, a connection releasing unit 130, and an agent allocating unit 140.
A host reading unit 110, configured to read all redis hosts in the network from an object configuration table;
a host polling unit 120, configured to poll all agents for a redis host to which the agent is connected;
a connection releasing unit 130, configured to determine that a plurality of agents are simultaneously connected to one redis host according to all the polled redis hosts connected to the agents, assign the redis host to one of the plurality of agents, and release the connection between the rest of the agents and the redis host;
and the agent allocating unit 140 is configured to, if it is determined that there is a redis host that is not connected to any agent according to all read redis hosts and all polled redis hosts connected to the agent, select an agent from the agents in the network to connect to the redis host that is not connected to any agent.
The implementation process of the function and the action of each module in the above device is specifically described in the implementation process of the corresponding step in the method for scheduling an agent monitoring the redis service by the server, and is not described herein again.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, and may also be implemented by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Accordingly, various aspects of the present invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 500 according to this embodiment of the invention is described below with reference to fig. 10. The electronic device 500 shown in fig. 10 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 10, the electronic device 500 is embodied in the form of a general purpose computing device. The components of the electronic device 500 may include, but are not limited to: the at least one processing unit 510, the at least one memory unit 520, and a bus 530 that couples various system components including the memory unit 520 and the processing unit 510.
Wherein the memory unit stores program code that is executable by the processing unit 510 to cause the processing unit 510 to perform steps according to various exemplary embodiments of the present invention as described in the "exemplary methods" section above in this specification. For example, the processing unit 510 may execute step S110 as shown in fig. 2: reading all redis hosts in the network from an object configuration table; step S120: polling all agents for the redis hosts connected to the agents; step S130: if a plurality of agents are determined to be simultaneously connected with one redis host according to all polled redis hosts connected with the agents, the redis host is distributed to one agent of the agents, and the connection between the rest agents and the redis host is released; step S140: and if the read redis hosts and all polled redis hosts connected with the agents determine that the redis hosts are not connected with any agents, selecting one agent from the agents in the network to be connected with the redis hosts not connected with any agents.
The memory unit 520 may include a readable medium in the form of a volatile memory unit, such as a random access memory unit (RAM)5201 and/or a cache memory unit 5202, and may further include a read only memory unit (ROM) 5203.
Storage unit 520 may also include a program/utility 5204 having a set (at least one) of program modules 5205, such program modules 5205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 530 may be one or more of any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 500 may also communicate with one or more external devices 700 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 500, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 500 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 550. Also, the electronic device 500 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 560. As shown, the network adapter 560 communicates with the other modules of the electronic device 500 over the bus 530. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 500, 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.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
Referring to fig. 11, a program product 600 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a 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.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A 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 readable storage medium include: an electrical connection having one or more wires, a portable disk, 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.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a 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 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.
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, 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 computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A method for scheduling an agent for monitoring a redis service by a server is applied to a network in which a redis host, an agent and a server using the redis service are connected, wherein the agent monitors an operating state of the responsible redis host and reports the monitored operating state to the server, and the method comprises the following steps:
reading all redis hosts in the network from an object configuration table;
polling all agents for redis hosts connected with the agents;
if a plurality of agents are determined to be simultaneously connected with one redis host according to all polled redis hosts connected with the agents, the redis host is distributed to one agent of the agents, and the connection between the rest agents and the redis host is released;
if the read redis hosts and the polled redis hosts connected with the agents determine that the redis hosts are not connected with any agents, selecting one agent from the agents in the network to be connected with the redis hosts not connected with any agents;
if it is determined that a plurality of agents are simultaneously connected to one redis host according to all polled redis hosts connected with the agents, allocating the redis host to one of the agents, the method specifically comprises the following steps:
determining a processing load for each of the plurality of agents;
selecting an agent from the plurality of processes according to the processing load;
assigning the redis host to the selected agent.
2. The method of claim 1, wherein said selecting an agent from said plurality of agents based on said processing load comprises:
and selecting one agent from the plurality of agents according to the processing load and the distance between the agent and the redis host.
3. The method of claim 2, wherein selecting an agent from the plurality of agents based on the processing load and the distance from the redis host comprises:
selecting the agent with the smallest weighted sum of the processing load and the distance from the redis host from the plurality of agents.
4. The method of claim 1, wherein prior to reading all redis hosts within the network from an object configuration table, the method comprises:
and in response to a registration request of a redis host which is not registered in the network, writing the redis host into the object configuration table.
5. The method of claim 1, wherein the processing load of the agent comprises:
the number of connected redis hosts or the total storage capacity of the connected redis hosts of the proxy.
6. The method of any of claims 1-5, wherein the step of selecting an agent to connect with the redis host that is not connected with any agent comprises:
determining a processing load of the agent or a distance to the redis host or a weighted sum of the processing load and the distance;
and according to the processing load or the distance or the weighted sum, selecting the agent with the minimum processing load or the closest processing load or the weighted sum to be connected with the redis host which is not connected with any agent.
7. The method of claim 1, wherein the number of redis hosts of the proxy connection has a predetermined threshold, and wherein if the number of redis hosts of the proxy connection exceeds the threshold, the method further comprises:
extracting the redis hosts connected with the agents with the host numbers exceeding the threshold value, and disconnecting the redis hosts from the agents to ensure that the number of the redis hosts connected with the agents does not exceed the threshold value;
determining a distance of the agent from the redis host;
and selecting one agent from the agents in the network to be connected with the redis host according to the distance between the selected agent and the redis host.
8. An apparatus for scheduling, by a server, an agent monitoring a redis service, the apparatus comprising:
the host reading unit is used for reading all redis hosts in the network from the object configuration table;
the host polling unit is used for polling the redis host connected with the proxy to all the proxies;
a connection releasing unit, configured to determine that a plurality of agents are simultaneously connected to one redis host according to all polled redis hosts connected to the agents, assign the redis host to one of the agents, and release the connection between the other agents and the redis host;
and the agent distribution unit is used for selecting one agent from the agents in the network to be connected with the redis host which is not connected with any agent if the redis host which is not connected with any agent is determined according to all read redis hosts and all polled redis hosts which are connected with the agents.
9. A computer device comprising a memory and a processor, the memory having stored therein computer-readable instructions that, when executed by the processor, cause the processor to perform the method of any of claims 1 to 7.
10. A storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the method of any one of claims 1-7.
CN201811237324.1A 2018-10-23 2018-10-23 Method and device for scheduling agent, computer equipment and storage medium Active CN109639752B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811237324.1A CN109639752B (en) 2018-10-23 2018-10-23 Method and device for scheduling agent, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811237324.1A CN109639752B (en) 2018-10-23 2018-10-23 Method and device for scheduling agent, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109639752A CN109639752A (en) 2019-04-16
CN109639752B true CN109639752B (en) 2022-07-19

Family

ID=66066604

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811237324.1A Active CN109639752B (en) 2018-10-23 2018-10-23 Method and device for scheduling agent, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109639752B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102130959A (en) * 2011-03-22 2011-07-20 浪潮(北京)电子信息产业有限公司 System and method for scheduling cloud storage resource
CN108123963A (en) * 2018-01-19 2018-06-05 深圳市易仓科技有限公司 The API auxiliary systems and processing method of a kind of cross-border electric business
CN108183961A (en) * 2018-01-04 2018-06-19 中电福富信息科技有限公司 A kind of distributed caching method based on Redis
CN108683697A (en) * 2018-03-28 2018-10-19 青岛海尔科技有限公司 Connect method, system, selector and the server of Redis memory databases

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ES2561663T3 (en) * 2011-07-11 2016-02-29 Tanaza S.R.L. Method and system to manage network devices from generic distributors and manufacturers
US9813307B2 (en) * 2013-01-28 2017-11-07 Rackspace Us, Inc. Methods and systems of monitoring failures in a distributed network system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102130959A (en) * 2011-03-22 2011-07-20 浪潮(北京)电子信息产业有限公司 System and method for scheduling cloud storage resource
CN108183961A (en) * 2018-01-04 2018-06-19 中电福富信息科技有限公司 A kind of distributed caching method based on Redis
CN108123963A (en) * 2018-01-19 2018-06-05 深圳市易仓科技有限公司 The API auxiliary systems and processing method of a kind of cross-border electric business
CN108683697A (en) * 2018-03-28 2018-10-19 青岛海尔科技有限公司 Connect method, system, selector and the server of Redis memory databases

Also Published As

Publication number Publication date
CN109639752A (en) 2019-04-16

Similar Documents

Publication Publication Date Title
JP6373482B2 (en) Interface for controlling and analyzing computer environments
US9389916B1 (en) Job scheduling management
CN109656570B (en) Cluster system, operation method thereof, electronic device and storage medium
CN109660426B (en) Monitoring method and system, computer readable medium and electronic device
CN102929769B (en) Virtual machine internal-data acquisition method based on agency service
CN111679911B (en) Management method, device, equipment and medium of GPU card in cloud environment
CN112988679B (en) Log acquisition control method and device, storage medium and server
CN112306802A (en) Data acquisition method, device, medium and electronic equipment of system
CN112100034A (en) Service monitoring method and device
WO2023077870A1 (en) Power transmission line communication network device management system
CN110534136B (en) Recording method and device
CN110635956A (en) Equipment management method, platform, system, equipment and storage medium
CN109639752B (en) Method and device for scheduling agent, computer equipment and storage medium
CN110033242B (en) Working time determining method, device, equipment and medium
CN112181942A (en) Time sequence database system and data processing method and device
CN111737082A (en) Container and monitoring method, device, equipment and medium for container application
CN115934464A (en) Information platform monitoring and collecting system
JP2004178336A (en) System and method for managing operation, management computer, computer to be monitored, and program
US20140165058A1 (en) System resource management method for virtual system
TWI579691B (en) Method and System of IDC Computer Room Entity and Virtual Host Integration Management
CN113312238A (en) Resource pool monitoring method and related equipment thereof
CN109766238B (en) Session number-based operation and maintenance platform performance monitoring method and device and related equipment
CN112306871A (en) Data processing method, device, equipment and storage medium
CN112732999B (en) Static disaster recovery method, system, electronic equipment and storage medium
CN114356603A (en) Message processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 201, room 518000, building A, No. 1, front Bay Road, Qianhai Shenzhen Guangdong Shenzhen Hong Kong cooperation zone (Qianhai business secretary)

Applicant after: ONECONNECT FINANCIAL TECHNOLOGY Co.,Ltd. (SHANGHAI)

Address before: 518000 Guangdong city of Shenzhen province Qianhai Shenzhen Hong Kong cooperation zone before Bay Road No. 1 building 201 room A

Applicant before: ONECONNECT FINANCIAL TECHNOLOGY Co.,Ltd. (SHANGHAI)

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant