[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN111277460B - ZooKeeper containerization control method and device, storage medium and electronic equipment - Google Patents

ZooKeeper containerization control method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN111277460B
CN111277460B CN202010052733.5A CN202010052733A CN111277460B CN 111277460 B CN111277460 B CN 111277460B CN 202010052733 A CN202010052733 A CN 202010052733A CN 111277460 B CN111277460 B CN 111277460B
Authority
CN
China
Prior art keywords
zookeeper
cluster
node
zookeeper cluster
nodes
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
CN202010052733.5A
Other languages
Chinese (zh)
Other versions
CN111277460A (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.)
Jiangsu Manyun Software Technology Co Ltd
Original Assignee
Jiangsu Manyun Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Manyun Software Technology Co Ltd filed Critical Jiangsu Manyun Software Technology Co Ltd
Priority to CN202010052733.5A priority Critical patent/CN111277460B/en
Publication of CN111277460A publication Critical patent/CN111277460A/en
Application granted granted Critical
Publication of CN111277460B publication Critical patent/CN111277460B/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • 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/06Management of faults, events, alarms or notifications

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Environmental & Geological Engineering (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Testing And Monitoring For Control Systems (AREA)

Abstract

The embodiment of the application discloses a ZooKeeper containerization control method, a ZooKeeper containerization control device, a storage medium and electronic equipment. The method comprises the following steps: in response to a creation request of the configuration item, calling a Kubernetes interface to define the configuration item of the target cluster; creating a ZooKeeper cluster according to the target configuration item of the target cluster through a preset controller, and creating a monitoring component and an alarm component; the ZooKeeper cluster comprises a root node and at least one child node; and monitoring the running state of each node of the ZooKeeper cluster through the monitoring component, and sending alarm information through the alarm component if the monitoring meets the alarm condition. By operating the technical scheme provided by the application, the aims of rapid deployment and dynamic monitoring of the ZooKeeper cluster can be achieved.

Description

ZooKeeper containerization control method and device, storage medium and electronic equipment
Technical Field
The embodiment of the application relates to the technical field of internet, in particular to a ZooKeeper containerization control method, device, storage medium and electronic equipment.
Background
With the rapid development of the technology level, ZooKeeper is widely used, and as an open-source key-value pair database, an available ZooKeeper cluster is finally deployed in the existing deployment mode by a Helm chart mode and by defining a plurality of YAML files. However, in this deployment mode, the self interface of the Helm needs to be called to implement deployment, and after deployment is completed, the Helm cannot perceive the cluster state, and after a cluster fails, the cluster cannot be repaired in time. Therefore, a containerization control scheme capable of accurately performing ZooKeeper is in need of being generated.
Disclosure of Invention
The embodiment of the application provides a ZooKeeper containerization control method, a ZooKeeper containerization control device, a storage medium and electronic equipment, so as to achieve the purposes of rapid deployment and dynamic monitoring of a ZooKeeper cluster.
In a first aspect, an embodiment of the present application provides a ZooKeeper containerization control method, including:
in response to a creation request of the configuration item, calling a Kubernetes interface to define the configuration item of the target cluster;
creating a ZooKeeper cluster according to the target configuration item of the target cluster through a preset controller, and creating a monitoring component and an alarm component; the ZooKeeper cluster comprises a root node and at least one child node;
and monitoring the running state of each node of the ZooKeeper cluster through the monitoring component, and sending alarm information through the alarm component if the monitoring meets the alarm condition.
Optionally, after creating the ZooKeeper cluster, the method further includes:
and if detecting a change request of the number of the configuration items of the ZooKeeper cluster, generating a node number change instruction to control the number of the nodes of the ZooKeeper cluster to change.
Optionally, after creating the ZooKeeper cluster, the method further includes:
and if the content change request of the configuration item of the ZooKeeper cluster is detected, generating a node parameter change instruction to control the node parameter of the ZooKeeper cluster to change.
Optionally, the node parameter includes a memory usage parameter of the node.
Optionally, generating a node parameter change instruction to control the node parameter of the ZooKeeper cluster to change includes:
generating a node parameter change instruction, and controlling the ZooKeeper cluster to exit the main process;
updating a target configuration item of the ZooKeeper cluster;
and updating the parameters of the child nodes in the ZooKeeper cluster one by one according to the updated target configuration items, and updating the parameters of the root nodes in the ZooKeeper cluster after the parameters of all the child nodes are updated.
Optionally, generating a node number change instruction to control the number of nodes of the ZooKeeper cluster to change includes:
generating a node quantity change instruction, and controlling the ZooKeeper cluster to exit the main process;
updating a target configuration item of the ZooKeeper cluster;
and changing the number of the nodes of the ZooKeeper cluster according to the updated target configuration item, and recording a change event.
Optionally, the method further includes:
and if the monitoring component monitors that the number of the nodes of the ZooKeeper cluster is increased, adding the newly added nodes into the monitored nodes of the ZooKeeper cluster, and operating the main flow according to the number of the nodes of the ZooKeeper cluster after the increase.
In a second aspect, an embodiment of the present application provides an apparatus for ZooKeeper containerization control, including:
the configuration item definition module is used for responding to a creation request of a configuration item and calling a Kubernetes interface to define the configuration item of the target cluster;
the cluster creating module is used for creating a ZooKeeper cluster according to the target configuration item of the target cluster through a preset controller and creating a monitoring component and an alarm component; the ZooKeeper cluster comprises a root node and at least one child node;
and the node monitoring module is used for monitoring the running state of each node of the ZooKeeper cluster through the monitoring component, and sending alarm information through the alarm component if the monitoring meets the alarm condition.
In a third aspect, embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the method for ZooKeeper containerization control according to embodiments of the present application.
In a fourth aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable by the processor, where the processor executes the computer program to implement the ZooKeeper containerization control method according to the embodiment of the present application.
According to the technical scheme provided by the embodiment of the application, the configuration item of the target cluster is defined by calling a Kubernetes interface in response to a creation request of the configuration item; creating a ZooKeeper cluster according to the target configuration item of the target cluster through a preset controller, and creating a monitoring component and an alarm component; the ZooKeeper cluster comprises a root node and at least one child node; and monitoring the running state of each node of the ZooKeeper cluster through the monitoring component, and sending alarm information through the alarm component if the monitoring meets the alarm condition. By adopting the technical scheme provided by the application, the aims of rapid deployment and dynamic monitoring of the ZooKeeper cluster can be achieved.
Drawings
FIG. 1 is a flow chart of a method for ZooKeeper containerization control provided in an embodiment of the present application;
FIG. 2 is a schematic structural diagram of a ZooKeeper containerization control apparatus provided in the second embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1 is a flowchart of a ZooKeeper containerization control method provided in an embodiment of the present application, where the present embodiment is suitable for a situation where a ZooKeeper cluster is created for supervision, and the method may be executed by a ZooKeeper containerization control apparatus provided in an embodiment of the present application, and the apparatus may be implemented in a software and/or hardware manner and may be integrated in an electronic device such as an intelligent terminal.
As shown in fig. 1, the ZooKeeper containerization control method includes:
and S110, responding to the creation request of the configuration item, and calling a Kubernetes interface to define the configuration item of the target cluster.
The request for creating the configuration item may be sent by the user, and may be a request triggered based on a click or other operation of the user on a page. The configuration item may be the number of items configuring information of the ZooKeeper, for example, for a group of data, a size parameter and a resolution parameter of the group of data need to be configured, and it may be determined that the configuration item of the group of data includes two configurations, which are a memory and a resolution, respectively.
Kubernets is an open source for managing containerized applications on multiple hosts in a cloud platform, the goal of kubernets is to make it simple and efficient to deploy containerized applications (powerfull), which provides a mechanism for application deployment, planning, updating, and maintenance. And calling a Kubernets interface to define the configuration item of the target cluster, wherein the information provided by the Kubernets can be defined in the form of resources, and the interface can create the self-defined resources as the configuration item of the target cluster. For example, creating a configuration item that includes size and resolution.
S120, creating a ZooKeeper cluster according to the target configuration item of the target cluster through a preset controller, and creating a monitoring component and an alarm component; wherein the ZooKeeper cluster comprises a root node and at least one child node.
Wherein, the controller can be preset and is used for creating a control component of the ZooKeeper cluster. The controller may create a ZooKeeper cluster according to a target configuration item of the target cluster, where the target configuration may be specific configuration content of a custom configuration item, for example, the size may be configured to be 5.8 inches or 6.1 inches, the resolution may be configured to be 1080P or 720P, and after specific configuration parameters are obtained, the creation of the ZooKeeper cluster may be implemented according to the target configuration. Wherein the ZooKeeper cluster may be a cluster comprising one root node and a plurality of child nodes.
In the technical scheme, the monitoring component and the alarm component can be synchronously created in the process of creating the ZooKeeper cluster. Wherein the monitoring component may be created based on a monitoring policy and the alarm component may be created based on an alarm policy.
S130, monitoring the running state of each node of the ZooKeeper cluster through the monitoring component, and sending out alarm information through the alarm component if the monitoring meets the alarm condition.
And if the monitoring meets the alarm condition, the alarm component sends out alarm information. For example, if it is detected that a certain child node has a downtime event, or the memory required for running the root node is insufficient, corresponding alarm information may be generated.
According to the technical scheme provided by the embodiment of the application, the configuration item of the target cluster is defined by calling a Kubernetes interface in response to a creation request of the configuration item; creating a ZooKeeper cluster according to the target configuration item of the target cluster through a preset controller, and creating a monitoring component and an alarm component; the ZooKeeper cluster comprises a root node and at least one child node; and monitoring the running state of each node of the ZooKeeper cluster through the monitoring component, and sending alarm information through the alarm component if the monitoring meets the alarm condition. By adopting the technical scheme provided by the application, the aims of rapid deployment and dynamic monitoring of the ZooKeeper cluster can be achieved.
On the basis of the above technical solution, optionally, after the ZooKeeper cluster is created, the method further includes: and if detecting a change request of the number of the configuration items of the ZooKeeper cluster, generating a node number change instruction to control the number of the nodes of the ZooKeeper cluster to change.
After creating the ZooKeeper cluster, it may be detected that the user needs to adjust, for example, increase or decrease, the number of configuration items of the ZooKeeper cluster, for example, the original number of configuration items is only two items, that is, the size and the resolution, whereas the user needs to add material configuration items, for example, two items including an LED and an LCD. In this case, the user may perform corresponding operations in kubernets to add or subtract configuration items of the ZooKeeper cluster. A node number change instruction may be generated according to an operation of a user to control the number of nodes of the ZooKeeper cluster to change.
Specifically, generating a node number change instruction to control the number of nodes of the ZooKeeper cluster to change includes: generating a node quantity change instruction, and controlling the ZooKeeper cluster to exit the main process; updating a target configuration item of the ZooKeeper cluster; and changing the number of the nodes of the ZooKeeper cluster according to the updated target configuration item, and recording a change event.
Specifically, the method may include the following steps:
the spec.
And triggering the operator main flow, judging that the number of the expected copies is greater than the actual number of the copies, and continuing the flow, otherwise, exiting the main flow.
Update Zookeeper cluster events, submit two events:
Zookeeper upscale from 3to 4.
Zookeeper Statefulset%s already update.
and updating the Zookeeper cluster StatefUlSet resource, building a new node by a StateUUlSet controller, adding the new node into the cluster by the Zookeeper, and automatically synchronizing data.
The Reconfig module will add or remove nodes from the cluster.
According to the technical scheme, when the Zookeeper cluster needs to expand and contract the capacity, the created self-defined resources can be updated, and the controller automatically realizes the expansion and contraction capacity, so that the Zookeeper cluster can be quickly and conveniently controlled.
On the basis of the above technical solutions, optionally, after the ZooKeeper cluster is created, the method further includes: and if the content change request of the configuration item of the ZooKeeper cluster is detected, generating a node parameter change instruction to control the node parameter of the ZooKeeper cluster to change.
In this technical solution, the node parameter includes a memory usage parameter of the node. Specifically, the usage right of the container provided for each node may be used. For example, the memory allowed to be used by a certain node in a container is 256Mb, and if the memory needs to be adjusted to 512Mb, the memory usage parameter can be adjusted.
On the basis of the above technical solutions, optionally, generating a node parameter change instruction to control the node parameter of the ZooKeeper cluster to change includes: generating a node parameter change instruction, and controlling the ZooKeeper cluster to exit the main process; updating a target configuration item of the ZooKeeper cluster; and updating the parameters of the child nodes in the ZooKeeper cluster one by one according to the updated target configuration items, and updating the parameters of the root nodes in the ZooKeeper cluster after the parameters of all the child nodes are updated.
And updating the parameters of the root node after all the child nodes are updated. Specifically, the expansion node resource may perform the following operations:
update spec.
And if the number of Zookeeper nodes is inconsistent with the expected number of nodes, exiting the main flow until the number of the nodes is consistent and all the ads of all the pod.
After the number of the nodes is checked, the StatefulSet resource is updated, and since the rollingpdate policy set by the StatefulSet is onedelete, namely after the configuration of the StatefulSet is updated, the StatefulSet cannot restart the nodes actively to complete the upgrade, and the nodes need to be restarted manually by the StatefulSet.
And acquiring the role of the node in the current cluster, and putting the leader node to the last restart so as to reduce the unavailable time of the cluster as much as possible.
And comparing the resource version values of StateUfSet and pod by the operator, and adding the node into the list of nodes needing to be restarted if the values are inconsistent.
operator performs the following check on the node:
whether the node exceeds the MaxUnavailable value in the current restart is judged, and the current MaxUnavailable value is defaulted to be 1.
Nodes with a node state of Terminating are skipped.
And taking one node from the restarting node, calling a k8s interface, and executing the restarting operation.
And after the first node is restarted, the main flow of the request is continued to restart other nodes.
And all the nodes are completely restarted, and the rolling upgrade is successful.
According to the technical scheme, the resources can be adjusted and the created self-defined resources can be updated when the user needs to adjust the resources, and the controller automatically rolls and upgrades the nodes.
On the basis of the above technical solutions, optionally, the method further includes: and if the monitoring component monitors that the number of the nodes of the ZooKeeper cluster is increased, adding the newly added nodes into the monitored nodes of the ZooKeeper cluster, and operating the main flow according to the number of the nodes of the ZooKeeper cluster after the increase. After the new nodes are added to the cluster, the main process can be run for the ZooKeeper cluster according to the number of the nodes after the nodes are added. Therefore, reasonable distribution of resources can be ensured, and the number of the nodes of the ZooKeeper cluster can be adjusted quickly. The controller may ensure service availability during a rolling upgrade.
In order to make the technical solution more obvious for those skilled in the art, the present application also provides a specific embodiment.
Firstly, classifying containers.
InitContainer:
The configuration file initialization container is mainly used for copying the ZooKeeper config file to a working area.
Container:
A master process container;
the container is monitored.
The configuration file initializes the container.
Cfg, dynamic, this file is also attached to the main container in a configmap manner, and is mainly used for ZooKeeper node discovery and registration, and the following characteristics after this ZooKeeper 3.5 will be described in detail.
And updating the directory rights.
And setting the data and the rights of the logs to ensure that the ZooKeeper can be normally started.
A master process container.
An environmental variable.
POD _ IP and POD _ NAME mainly transmit the POD IP and the NAME of the node to the inside of the POD, so that the calling inside the container is facilitated.
ZOOKEEPER _ SERVER _ HEAP, this variable is the limit ZOOKEEPER start hapsize, which is read by the controller according to the request internal size setting.
The reading probe.
A ruok command is transmitted through a ZooKeeper client port, a return code is checked, the returned imok considers that a z k node is ready, the ZooKeeper node is updated to the above-mentioned zo.cfg.dynamic file, and the ZooKeeper cluster automatically discovers the node.
The container is monitored.
The exporter is started along with the main process, and then how to register to the prometheus target and the alarm strategy are introduced.
And (5) controlling access.
Exposing the port.
9114, this port is an exporter service port, which will be matched by labels when registering prometheus target by servicemonitor.
1988, the port is a ZooKeeper-agent service port, and the current node operation status can be queried through the interface controller, which will be described in detail later.
2181, the port is a ZooKeeper client port, and the port creates a k8s header mode svc, which is convenient for the client to obtain all the nodes ip at one time.
3888, leader is elected.
2888, machine communication in the cluster is used (the Leader listens to this port).
The exposure mode.
Here two modes of the main k8s service: headless and Cluster.
In this scenario, all nodes ip of the ZooKeeper are returned to the client, and then the client determines which ip accesses the ZooKeeper cluster through.
Cluster, this mode is the default configuration, after creating such a service, it will allocate a Cluster ip, this ip is similar to a vip, and every time this service name is accessed, kube-dns will return to a node ip at random.
When the controller creates service, the two types are created, the thread type is mainly accessed to the k8s internal application, and the cluster type is mainly exposed to the external application access through the NodePort.
And (4) storing data.
PersistentVolume。
The cloud CSI plug-in realizes the life cycle management of the Kubernetes platform by using the cloud storage volume of the Array, and supports dynamic creation, mounting and use of a cloud data volume. Current CSI implementations are based on versions above K8S 1.14.14.
The cloud disk CSI plug-in supports dynamic creation and mounting of cloud disk data volumes. A cloud disk is a type of block storage that can only be used by one load at a time (ReadWriteOnce).
The controller transmits the pvc information configured in crd to sts and mounts the pvc information in the ZooKeeper data directory.
And (5) monitoring.
Registration is monitored.
ServiceMonitor。
Matchlabels, here matching service by zookeeper: zookeeper-sample.
Http-metrics, here registered to prometheus target by matching to port name in service.
The controller calls a promoter-operator client to complete the creation of a servicemono resource, and the function of automatically registering the new zookeeper cluster to the promoter is realized.
And (5) alarm configuration.
And the controller calls a proxy-operator client to complete the creation of a proxy resource, so that the alarm strategy is automatically registered to the proxy.
The dingtalkRobot label in the alarm strategy is mainly used for redirecting alarm information to a specified nail cluster, and a plurality of nail cluster robots can be added.
According to the technical scheme, a user calls a kubernets api to create a user-defined resource, the zookeeper controller quickly creates a cluster, and meanwhile, a monitoring and warning strategy is automatically created. And if the capacity needs to be expanded and contracted, the created self-defined resource is updated, and the controller automatically realizes the capacity expansion and contraction. If the resources need to be adjusted, the created custom resources are updated, and the controller automatically rolls and upgrades the nodes. Through the arrangement, the controller can directly call the Kubernetes api interface to realize operation without calling other components. The controller directly obtains kubernets events and zookeeper cluster states, and can obtain real-time states. The controller may sense node events and may process for specific events. The controller can master the expansion and contraction capacity progress. The controller may ensure service availability during a rolling upgrade.
Example two
Fig. 2 is a schematic structural diagram of an apparatus for ZooKeeper containerization control provided in the second embodiment of the present application. As shown in fig. 2, the apparatus for ZooKeeper containerization control includes:
a configuration item definition module 210, configured to, in response to a request for creating a configuration item, invoke a Kubernetes interface to define the configuration item of the target cluster;
a cluster creating module 220, configured to create a ZooKeeper cluster according to the target configuration item of the target cluster through a preset controller, and create a monitoring component and an alarm component; the ZooKeeper cluster comprises a root node and at least one child node;
and the node monitoring module 230 is configured to monitor the operating state of each node of the ZooKeeper cluster through the monitoring component, and send out warning information through the warning component if the monitoring meets the warning condition.
According to the technical scheme provided by the embodiment of the application, the configuration item of the target cluster is defined by calling a Kubernetes interface in response to a creation request of the configuration item; creating a ZooKeeper cluster according to the target configuration item of the target cluster through a preset controller, and creating a monitoring component and an alarm component; the ZooKeeper cluster comprises a root node and at least one child node; and monitoring the running state of each node of the ZooKeeper cluster through the monitoring component, and sending alarm information through the alarm component if the monitoring meets the alarm condition. By adopting the technical scheme provided by the application, the aims of rapid deployment and dynamic monitoring of the ZooKeeper cluster can be achieved.
The product can operate the method provided by any embodiment of the application, and has the corresponding functional modules and beneficial effects of the operation method.
EXAMPLE III
Embodiments of the present application also provide a storage medium containing computer executable instructions, which when executed by a computer processor, operate a method for ZooKeeper containerization control, the method comprising:
in response to a creation request of the configuration item, calling a Kubernetes interface to define the configuration item of the target cluster;
creating a ZooKeeper cluster according to the target configuration item of the target cluster through a preset controller, and creating a monitoring component and an alarm component; the ZooKeeper cluster comprises a root node and at least one child node;
and monitoring the running state of each node of the ZooKeeper cluster through the monitoring component, and sending alarm information through the alarm component if the monitoring meets the alarm condition.
Storage medium-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk, or tape devices; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Lanbas (Rambus) RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the computer system in which the program is executed, or may be located in a different second computer system connected to the computer system through a network (such as the internet). The second computer system may provide the program instructions to the computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems that are connected by a network. The storage medium may store program instructions (e.g., embodied as a computer program) that are executable by one or more processors.
Of course, the storage medium provided in the embodiments of the present application includes computer executable instructions, and the computer executable instructions are not limited to the operations of the ZooKeeper containerization control described above, and may also execute related operations in the method of ZooKeeper containerization control provided in any embodiment of the present application.
Example four
The embodiment of the application provides electronic equipment, and the ZooKeeper containerization control device provided by the embodiment of the application can be integrated into the electronic equipment. Fig. 3 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present application. As shown in fig. 3, the present embodiment provides an electronic device 300, which includes: one or more processors 320; a storage device 310, configured to store one or more programs, when the one or more programs are executed by the one or more processors 320, so that the one or more processors 320 implement the method for ZooKeeper containerization control provided in this embodiment of the present application, where the method includes:
in response to a creation request of the configuration item, calling a Kubernetes interface to define the configuration item of the target cluster;
creating a ZooKeeper cluster according to the target configuration item of the target cluster through a preset controller, and creating a monitoring component and an alarm component; the ZooKeeper cluster comprises a root node and at least one child node;
and monitoring the running state of each node of the ZooKeeper cluster through the monitoring component, and sending alarm information through the alarm component if the monitoring meets the alarm condition.
The electronic device 300 shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 3, the electronic device 300 includes a processor 320, a storage device 310, an input device 330, and an output device 340; the number of the processors 320 in the electronic device may be one or more, and one processor 320 is taken as an example in fig. 3; the processor 320, the storage device 310, the input device 330, and the output device 340 in the electronic apparatus may be connected by a bus or other means, and are exemplified by a bus 350 in fig. 3.
The storage device 310 is a computer readable storage medium, and can be used for storing software programs, computer executable programs, and module units, such as program instructions corresponding to the ZooKeeper containerization control method in the embodiment of the present application.
The storage device 310 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the storage device 310 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, storage 310 may further include memory located remotely from processor 320, which may be connected via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 330 may be used to receive input numbers, character information, or voice information, and to generate key signal inputs related to user settings and function control of the electronic apparatus. The output device 340 may include a display screen, speakers, etc.
The electronic device provided by the embodiment of the application can achieve the purposes of rapid deployment and dynamic monitoring of the ZooKeeper cluster.
The ZooKeeper containerization control device, the storage medium and the electronic device provided in the above embodiments can operate the ZooKeeper containerization control method provided in any embodiment of the present application, and have corresponding functional modules and beneficial effects for operating the method. The technical details not elaborated in the above embodiments may be referred to the ZooKeeper containerization control method provided in any of the embodiments of the present application.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present application and the technical principles employed. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims (9)

1. A method of ZooKeeper containerization control, comprising:
in response to a creation request of the configuration item, calling a Kubernetes interface to define the configuration item of the target cluster;
creating a ZooKeeper cluster according to the target configuration item of the target cluster through a preset controller, and creating a monitoring component and an alarm component; the ZooKeeper cluster comprises a root node and at least one child node;
monitoring the running state of each node of the ZooKeeper cluster through the monitoring component, and sending alarm information through the alarm component if the monitoring meets the alarm condition;
if the monitoring component monitors that the number of the nodes of the ZooKeeper cluster is increased, adding the newly added nodes into the monitored nodes of the ZooKeeper cluster, and running a main flow according to the number of the nodes of the ZooKeeper cluster after the increase;
wherein, in the process of creating the ZooKeeper cluster, the monitoring component and the alarm component can be created synchronously.
2. The method of claim 1, wherein after creating the ZooKeeper cluster, the method further comprises:
and if detecting a change request of the number of the configuration items of the ZooKeeper cluster, generating a node number change instruction to control the number of the nodes of the ZooKeeper cluster to change.
3. The method of claim 1, wherein after creating the ZooKeeper cluster, the method further comprises:
and if the content change request of the configuration item of the ZooKeeper cluster is detected, generating a node parameter change instruction to control the node parameter of the ZooKeeper cluster to change.
4. The method of claim 3, wherein the node parameter comprises a memory usage parameter for the node.
5. The method according to claim 4, wherein generating a node parameter change instruction to control the change of the node parameter of the ZooKeeper cluster comprises:
generating a node parameter change instruction, and controlling the ZooKeeper cluster to exit the main process;
updating a target configuration item of the ZooKeeper cluster;
and updating the parameters of the child nodes in the ZooKeeper cluster one by one according to the updated target configuration items, and updating the parameters of the root nodes in the ZooKeeper cluster after the parameters of all the child nodes are updated.
6. The method according to claim 2, wherein generating a node number change instruction to control the number of nodes of the ZooKeeper cluster to change comprises:
generating a node quantity change instruction, and controlling the ZooKeeper cluster to exit the main process;
updating a target configuration item of the ZooKeeper cluster;
and changing the number of the nodes of the ZooKeeper cluster according to the updated target configuration item, and recording a change event.
7. An apparatus for ZooKeeper containerization control, comprising:
the configuration item definition module is used for responding to a creation request of a configuration item and calling a Kubernetes interface to define the configuration item of the target cluster;
the cluster creating module is used for creating a ZooKeeper cluster according to the target configuration item of the target cluster through a preset controller and creating a monitoring component and an alarm component; the ZooKeeper cluster comprises a root node and at least one child node;
the node monitoring module is used for monitoring the running state of each node of the ZooKeeper cluster through the monitoring component, and sending out alarm information through the alarm component if the monitoring meets the alarm condition;
if the monitoring component monitors that the number of the nodes of the ZooKeeper cluster is increased, adding the newly added nodes into the monitored nodes of the ZooKeeper cluster, and running a main flow according to the number of the nodes of the ZooKeeper cluster after the increase;
wherein, in the process of creating the ZooKeeper cluster, the monitoring component and the alarm component can be created synchronously.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method of ZooKeeper containerization control according to any one of claims 1-6.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of ZooKeeper containerization control of any of claims 1-6 when executing the computer program.
CN202010052733.5A 2020-01-17 2020-01-17 ZooKeeper containerization control method and device, storage medium and electronic equipment Active CN111277460B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010052733.5A CN111277460B (en) 2020-01-17 2020-01-17 ZooKeeper containerization control method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010052733.5A CN111277460B (en) 2020-01-17 2020-01-17 ZooKeeper containerization control method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN111277460A CN111277460A (en) 2020-06-12
CN111277460B true CN111277460B (en) 2022-02-25

Family

ID=71002644

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010052733.5A Active CN111277460B (en) 2020-01-17 2020-01-17 ZooKeeper containerization control method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111277460B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112000550A (en) * 2020-08-24 2020-11-27 浪潮云信息技术股份公司 Operating system parameter tuning method, system, device and computer readable medium
CN112230847B (en) * 2020-09-18 2023-01-10 苏州浪潮智能科技有限公司 Method, system, terminal and storage medium for monitoring K8s storage volume
CN112181647A (en) * 2020-09-22 2021-01-05 广州品唯软件有限公司 Method, device and system for updating node state in container cluster
CN112346926B (en) * 2020-10-16 2024-10-08 北京金山云网络技术有限公司 Resource state monitoring method and device and electronic equipment
CN113641549B (en) * 2021-03-08 2024-05-17 万翼科技有限公司 Task monitoring method, device, electronic equipment and storage medium
CN113220420B (en) * 2021-05-18 2024-07-16 北京百度网讯科技有限公司 Service monitoring method, device, equipment, storage medium and computer program product
CN113660339B (en) * 2021-08-18 2023-08-04 北京百度网讯科技有限公司 Method and apparatus for decentralizing clusters
CN113778623B (en) * 2021-08-26 2024-04-16 北京达佳互联信息技术有限公司 Resource processing method and device, electronic equipment and storage medium
CN114125059B (en) * 2021-10-11 2023-08-25 国电南瑞科技股份有限公司 Container-based monitoring real-time data caching system and method
CN114124700B (en) * 2021-10-26 2024-10-29 马上消费金融股份有限公司 Cluster parameter configuration method and device, electronic equipment and readable storage medium
CN114079615B (en) * 2021-11-17 2023-08-11 上海道客网络科技有限公司 Application synchronization method, system, medium and electronic equipment in multi-cluster environment
CN114185734B (en) * 2021-11-26 2023-11-14 北京百度网讯科技有限公司 Method and device for monitoring clusters and electronic equipment
CN114500246B (en) * 2022-02-15 2023-09-01 平安证券股份有限公司 Network connection state monitoring method and device, computer equipment and storage medium
CN115150292A (en) * 2022-05-17 2022-10-04 深圳萨摩耶数字科技有限公司 Monitoring method and device for k8s cluster, electronic equipment and storage medium
CN114884838B (en) * 2022-05-20 2023-05-12 远景智能国际私人投资有限公司 Monitoring method and server of Kubernetes component

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106020930A (en) * 2016-05-13 2016-10-12 深圳市中润四方信息技术有限公司 Application container based application management method and system
CN106027328A (en) * 2016-05-13 2016-10-12 深圳市中润四方信息技术有限公司 Cluster monitoring method and system based on application container deployment
CN106888254A (en) * 2017-01-20 2017-06-23 华南理工大学 A kind of exchange method between container cloud framework based on Kubernetes and its each module
CN109245931A (en) * 2018-09-19 2019-01-18 四川长虹电器股份有限公司 The log management of container cloud platform based on kubernetes and the implementation method of monitoring alarm
CN109271170A (en) * 2018-09-05 2019-01-25 杭州数梦工场科技有限公司 A kind of distributed system dispositions method, system, electronic equipment and storage medium
CN109445802A (en) * 2018-09-25 2019-03-08 众安信息技术服务有限公司 The method of privatization Paas platform and its publication application based on container
CN110247810A (en) * 2019-07-09 2019-09-17 浪潮云信息技术有限公司 A kind of system and method for collection vessel service monitoring data
CN110262941A (en) * 2019-05-28 2019-09-20 深圳市汇川技术股份有限公司 Application Container cluster alarm implementation method, system, equipment and storage medium
CN110311831A (en) * 2019-06-14 2019-10-08 平安科技(深圳)有限公司 System resource monitoring method and relevant device based on container cloud
CN110389832A (en) * 2019-06-21 2019-10-29 深圳市汇川技术股份有限公司 ZooKeeper container cluster dispositions method, system, equipment and storage medium
CN110413288A (en) * 2019-07-31 2019-11-05 新华三大数据技术有限公司 Using dispositions method, device, server and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3226135A3 (en) * 2016-03-30 2018-01-31 AppFormix, Inc. Real-time cloud-infrastructure policy implementation and management

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106020930A (en) * 2016-05-13 2016-10-12 深圳市中润四方信息技术有限公司 Application container based application management method and system
CN106027328A (en) * 2016-05-13 2016-10-12 深圳市中润四方信息技术有限公司 Cluster monitoring method and system based on application container deployment
CN106888254A (en) * 2017-01-20 2017-06-23 华南理工大学 A kind of exchange method between container cloud framework based on Kubernetes and its each module
CN109271170A (en) * 2018-09-05 2019-01-25 杭州数梦工场科技有限公司 A kind of distributed system dispositions method, system, electronic equipment and storage medium
CN109245931A (en) * 2018-09-19 2019-01-18 四川长虹电器股份有限公司 The log management of container cloud platform based on kubernetes and the implementation method of monitoring alarm
CN109445802A (en) * 2018-09-25 2019-03-08 众安信息技术服务有限公司 The method of privatization Paas platform and its publication application based on container
CN110262941A (en) * 2019-05-28 2019-09-20 深圳市汇川技术股份有限公司 Application Container cluster alarm implementation method, system, equipment and storage medium
CN110311831A (en) * 2019-06-14 2019-10-08 平安科技(深圳)有限公司 System resource monitoring method and relevant device based on container cloud
CN110389832A (en) * 2019-06-21 2019-10-29 深圳市汇川技术股份有限公司 ZooKeeper container cluster dispositions method, system, equipment and storage medium
CN110247810A (en) * 2019-07-09 2019-09-17 浪潮云信息技术有限公司 A kind of system and method for collection vessel service monitoring data
CN110413288A (en) * 2019-07-31 2019-11-05 新华三大数据技术有限公司 Using dispositions method, device, server and storage medium

Also Published As

Publication number Publication date
CN111277460A (en) 2020-06-12

Similar Documents

Publication Publication Date Title
CN111277460B (en) ZooKeeper containerization control method and device, storage medium and electronic equipment
CN111966305B (en) Persistent volume allocation method and device, computer equipment and storage medium
US11520506B2 (en) Techniques for implementing fault domain sets
CN110365762B (en) Service processing method, device, equipment and storage medium
US20100058319A1 (en) Agile deployment of server
CN110209342B (en) Capacity expansion method, device, equipment and system for cloud hard disk
US11528186B2 (en) Automated initialization of bare metal servers
CN113382077B (en) Micro-service scheduling method, micro-service scheduling device, computer equipment and storage medium
CN113204353B (en) Big data platform assembly deployment method and device
US20050188068A1 (en) System and method for monitoring and controlling server nodes contained within a clustered environment
CN112799786A (en) Exit method, device, equipment and storage medium of micro-service instance
EP3531280A1 (en) Accelerator loading method and system, and accelerator loading apparatus
CN111258851A (en) Cluster alarm method, device, setting and storage medium
WO2020063550A1 (en) Policy decision method, apparatus and system, and storage medium, policy decision unit and cluster
CN115357198B (en) Mounting method and device of storage volume, storage medium and electronic equipment
US10146479B1 (en) Mechanism for multiple coexisting configurations support in virtual tape applications
CN112068847A (en) Computing environment deployment method and device based on kubernets platform
US20240345844A1 (en) Cluster Management Method, Device, and Computing System
US11520648B2 (en) Firmware emulated watchdog timer controlled using native CPU operations
CN113626054A (en) Business service updating method and device
CN117193936B (en) Virtual machine management method, device and equipment under super fusion architecture
CN112306640A (en) Container dispensing method, apparatus, device and medium therefor
EP4414836A1 (en) Container engine, container engine implementation methods, electronic device and storage medium
CN116185740A (en) Scheme testing method, device, computer equipment and storage medium
CN115766715A (en) High-availability super-fusion cluster monitoring method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20200612

Assignee: Nanjing Manyun Cold Chain Technology Co.,Ltd.

Assignor: JIANGSU MANYUN SOFTWARE TECHNOLOGY Co.,Ltd.

Contract record no.: X2023980038397

Denomination of invention: A method, device, storage medium, and electronic device for ZooKeeper containerization control

Granted publication date: 20220225

License type: Common License

Record date: 20230724

EE01 Entry into force of recordation of patent licensing contract