CN109788054B - Configuration method, server and medium for distributed application coordination service node - Google Patents

Configuration method, server and medium for distributed application coordination service node Download PDF

Info

Publication number
CN109788054B
CN109788054B CN201910012068.4A CN201910012068A CN109788054B CN 109788054 B CN109788054 B CN 109788054B CN 201910012068 A CN201910012068 A CN 201910012068A CN 109788054 B CN109788054 B CN 109788054B
Authority
CN
China
Prior art keywords
distributed application
coordination service
service node
application coordination
read
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
CN201910012068.4A
Other languages
Chinese (zh)
Other versions
CN109788054A (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910012068.4A priority Critical patent/CN109788054B/en
Publication of CN109788054A publication Critical patent/CN109788054A/en
Application granted granted Critical
Publication of CN109788054B publication Critical patent/CN109788054B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Computer And Data Communications (AREA)
  • Multi Processors (AREA)

Abstract

The invention is suitable for the technical field of computers, and provides a configuration method, a server and a medium of a distributed application coordination service node, wherein the configuration method comprises the following steps: receiving a distributed application coordination service node creation request; if the read-write permission inheritance identifier carried by the establishment request of the distributed application coordination service node is used for representing the read-write permission of the inheritance father node, acquiring the read-write permission information of the father node of the target distributed application coordination service node based on the identification information of the father node of the target distributed application coordination service node; determining the read-write permission information of a father node of the target distributed application coordination service node as the final read-write permission information of the target distributed application coordination service node; and configuring the read-write permission of the target distributed application coordination service node based on the final read-write permission information of the target distributed application coordination service node, simplifying the configuration process of the distributed application coordination service node and improving the configuration efficiency of the distributed application coordination service node.

Description

Configuration method, server and medium for distributed application coordination service node
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a configuration method of a distributed application coordination service node, a server and a computer readable storage medium.
Background
With the rapid development of internet technology, more and more projects related to the internet are deployed on a distributed system, which makes the internet projects have higher requirements on the consistency and coordination of the distributed system. zookeeper is an open source distributed application coordination service that can provide consistency and coordination services such as configuration maintenance, naming services, distributed synchronization and group services for distributed systems. In the prior art, when consistency and coordination of each distributed node in a distributed system are realized through a zookeeper, zookeeper nodes corresponding to each distributed node need to be created and configured in a zookeeper server, zookeeper instances corresponding to the zookeeper nodes are deployed on each distributed node based on the configuration of the zookeeper nodes, and consistency and coordination management of the whole distributed system is realized through a zookeeper distributed network formed by each zookeeper instance.
However, in the existing zokeeerer node configuration method, a zokeeerer child node cannot inherit the read-write permission of a parent node of the zokeeerer child node, and when a certain zokeeerer child node needs to be configured with the read-write permission identical to the read-write permission of the parent node of the zokeeerer child node, a user needs to manually input the read-write permission information of the child node again, so that the configuration process is complicated, and the configuration efficiency is low.
Disclosure of Invention
In view of this, embodiments of the present invention provide a configuration method, a server, and a computer-readable storage medium for a distributed application coordination service node, so as to solve the problems of a complex configuration process and a low configuration efficiency of the existing distributed application coordination service node.
A first aspect of an embodiment of the present invention provides a method for configuring a distributed application coordination service node, where the method includes:
receiving a distributed application coordination service node creation request; the distributed application coordination service node creation request carries a read-write permission inheritance identifier of a target distributed application coordination service node to be created and identifier information of a father node of the target distributed application coordination service node; the read-write permission inheritance identifier is used for representing whether to inherit the read-write permission of the father node;
if the read-write permission inheritance identifier carried by the establishment request of the distributed application coordination service node is used for representing the read-write permission of the inheritance parent node, acquiring the read-write permission information of the parent node of the target distributed application coordination service node based on the identification information of the parent node of the target distributed application coordination service node;
determining the read-write permission information of the father node of the target distributed application coordination service node as the final read-write permission information of the target distributed application coordination service node;
and creating the target distributed application coordination service node under the father node of the target distributed application coordination service node, and configuring the read-write permission of the target distributed application coordination service node based on the final read-write permission information of the target distributed application coordination service node.
A second aspect of an embodiment of the present invention provides a server, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the following steps when executing the computer program:
receiving a distributed application coordination service node creation request; the distributed application coordination service node creation request carries a read-write permission inheritance identifier of a target distributed application coordination service node to be created and identifier information of a father node of the target distributed application coordination service node; the read-write permission inheritance identifier is used for representing whether to inherit the read-write permission of the father node;
if the read-write permission inheritance identifier carried by the establishment request of the distributed application coordination service node is used for representing the read-write permission of the inheritance parent node, acquiring the read-write permission information of the parent node of the target distributed application coordination service node based on the identification information of the parent node of the target distributed application coordination service node;
determining the read-write permission information of the father node of the target distributed application coordination service node as the final read-write permission information of the target distributed application coordination service node;
and creating the target distributed application coordination service node under the father node of the target distributed application coordination service node, and configuring the read-write permission of the target distributed application coordination service node based on the final read-write permission information of the target distributed application coordination service node.
A third aspect of an embodiment of the present invention provides a server, including:
the device comprises a first receiving unit, a second receiving unit and a sending unit, wherein the first receiving unit is used for receiving a distributed application coordination service node creation request; the distributed application coordination service node creation request carries a read-write permission inheritance identifier of a target distributed application coordination service node to be created and identifier information of a father node of the target distributed application coordination service node; the read-write permission inheritance identifier is used for representing whether to inherit the read-write permission of the father node;
a first obtaining unit, configured to obtain, based on the identification information of the parent node of the target distributed application coordination service node, read-write permission information of the parent node of the target distributed application coordination service node if the read-write permission inheritance identification carried by the distributed application coordination service node creation request is used to represent the read-write permission of an inheritance parent node;
the first determining unit is used for determining the read-write permission information of the father node of the target distributed application coordination service node as the final read-write permission information of the target distributed application coordination service node;
the first configuration unit is used for creating the target distributed application coordination service node under a father node of the target distributed application coordination service node and configuring the read-write permission of the target distributed application coordination service node based on the final read-write permission information of the target distributed application coordination service node.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of:
receiving a distributed application coordination service node creation request; the distributed application coordination service node creation request carries a read-write permission inheritance identifier of a target distributed application coordination service node to be created and identifier information of a father node of the target distributed application coordination service node; the read-write permission inheritance identifier is used for representing whether to inherit the read-write permission of the father node;
if the read-write permission inheritance identifier carried by the establishment request of the distributed application coordination service node is used for representing the read-write permission of the inheritance parent node, acquiring the read-write permission information of the parent node of the target distributed application coordination service node based on the identification information of the parent node of the target distributed application coordination service node;
determining the read-write permission information of the father node of the target distributed application coordination service node as the final read-write permission information of the target distributed application coordination service node;
and creating the target distributed application coordination service node under the father node of the target distributed application coordination service node, and configuring the read-write permission of the target distributed application coordination service node based on the final read-write permission information of the target distributed application coordination service node.
The implementation of the configuration method, the server and the computer readable storage medium of the distributed application coordination service node provided by the embodiment of the invention has the following beneficial effects:
the configuration method of a distributed application coordination service node provided by the embodiment of the invention sets a read-write permission inheritance identification bit and an identification information bit of a father node in a request for creating the distributed application coordination service node, when a target distributed application coordination service node to be created needs to be configured with the read-write permission which is the same as the read-write permission of the father node, only a read-write permission inheritance identification for representing the read-write permission of the inheritance father node and identification information of the father node of the target distributed application coordination service node are carried in the request for creating the distributed application coordination service node, a server of the distributed application coordination service can obtain the read-write permission information of the father node of the target distributed application coordination service node based on the identification information of the father node of the target distributed application coordination service node carried in the request for creating the distributed application coordination service node, and the read-write permission of the target distributed application coordination service node is automatically configured based on the read-write permission information of the father node of the target distributed application coordination service node, so that a user does not need to manually input the read-write permission information of the target distributed application coordination service node, the configuration process of the distributed application coordination service node is simplified, and the configuration efficiency of the distributed application coordination service node is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart illustrating an implementation of a configuration method for a distributed application coordination service node according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an implementation of a configuration method for a distributed application coordination service node according to another embodiment of the present invention;
FIG. 3 is a flowchart illustrating an implementation of a configuration method for a distributed application coordination service node according to another embodiment of the present invention;
FIG. 4 is a flowchart illustrating an implementation of a configuration method for a distributed application coordination service node according to another embodiment of the present invention;
FIG. 5 is a flowchart illustrating an implementation of a method for configuring a distributed application coordination service node according to another embodiment of the present invention;
fig. 6 is a block diagram of a server according to an embodiment of the present invention;
fig. 7 is a block diagram of a server according to another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further 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 are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating an implementation of a configuration method for a distributed application coordination service node according to an embodiment of the present invention. In this embodiment, the execution subject of the configuration method of the distributed application coordination service node is a server of the distributed application coordination service. A configuration method of a distributed application coordination service node as shown in fig. 1 includes the following steps:
s11: receiving a distributed application coordination service node creation request; the distributed application coordination service node creation request carries a read-write permission inheritance identifier of a target distributed application coordination service node to be created and identifier information of a father node of the target distributed application coordination service node; the read-write permission inheritance identifier is used for representing whether to inherit the read-write permission of the father node.
In practical applications, a distributed system generally includes a client, a server, and at least two distributed nodes, where the distributed nodes may be distributed storage nodes or distributed processing nodes, and are not limited herein. The distributed application coordination service is used for providing consistency and coordination service for a distributed system, and in the embodiment of the invention, the distributed application coordination service can be zookeeper.
When the consistency and coordination management of the distributed system is realized through the distributed application coordination service, corresponding distributed application coordination service instances need to be deployed on each distributed node in the distributed system, and then the consistency and coordination between the distributed node and other distributed nodes are realized through the distributed application coordination service instances deployed on the distributed nodes.
Specifically, when a distributed application coordination service node corresponding to each distributed node in the distributed system needs to be created in a server of the distributed application coordination service, a developer may trigger a distributed application coordination service node creation request through a node information setting interface of the server of the distributed application coordination service, where the distributed application coordination service node creation request carries a read-write permission inheritance identifier of a target distributed application coordination service node to be created and identifier information of a parent node of the target distributed application coordination service node. The reading and writing authority inheritance identifier is used for representing whether to inherit the reading and writing authority of the father node. Illustratively, the value of the read-write permission inheritance identifier can be 0 or 1, wherein 0 represents that the read-write permission of the parent node is not inherited, and 1 represents that the read-write permission of the parent node is inherited. The identification information of the parent node of the target distributed application coordination service node to be created may be a name, a host number, or a Media Access Control (MAC) address of the parent node of the target distributed application coordination service node to be created.
The read-write permission inheritance identifier of the target distributed application coordination service node to be created and the identifier information of the father node of the target distributed application coordination service node to be created can be input through a node information setting interface of a server of the distributed application coordination service when a developer triggers a request for creating the distributed application coordination service node.
After a server of the distributed application coordination service receives a distributed application coordination service node creation request sent by a server of a distributed system, a read-write permission inheritance identifier of a target distributed application coordination service node to be created and identifier information of a father node of the target distributed application coordination service node are extracted from the distributed application coordination service node creation request.
S12: and if the read-write permission inheritance identifier carried by the establishment request of the distributed application coordination service node is used for representing the read-write permission of the inheritance parent node, acquiring the read-write permission information of the parent node of the target distributed application coordination service node based on the identification information of the parent node of the target distributed application coordination service node.
After the server of the distributed application coordination service extracts the read-write permission inheritance identifier of the target distributed application coordination service node to be created and the identification information of the father node of the target distributed application coordination service node from the creation request of the distributed application coordination service node, if the read-write permission inheritance identifier of the target distributed application coordination service node is detected to be used for representing the read-write permission of the inheritance father node, the read-write permission information of the father node of the target distributed application coordination service node is obtained based on the identification information of the father node of the target distributed application coordination service node. The read-write permission information of the node is used for describing permission that information stored in the node can be read or modified by a server or other nodes.
In the embodiment of the invention, the server of the distributed application coordination service stores the preset corresponding relation between the identification information of each configured distributed application coordination service node and the read-write permission information thereof. Since the father node of the target distributed application coordination service node is a configured distributed application coordination service node, the server of the distributed application coordination service may obtain the read-write permission information of the father node of the target distributed application coordination service node based on the preset corresponding relationship between the identification information of the father node of the target distributed application coordination service node, the identification information of the distributed application coordination service node, and the read-write permission information of the distributed application coordination service node.
S13: and determining the read-write permission information of the father node of the target distributed application coordination service node as the final read-write permission information of the target distributed application coordination service node.
After the server of the distributed application coordination service acquires the read-write permission information of the father node of the target distributed application coordination service node, the read-write permission information of the father node of the target distributed application coordination service node is determined as the final read-write permission information of the target distributed application coordination service node.
S14: and creating the target distributed application coordination service node under the father node of the target distributed application coordination service node, and configuring the read-write permission of the target distributed application coordination service node based on the final read-write permission information of the target distributed application coordination service node.
In the embodiment of the invention, after a server of the distributed application coordination service determines the final read-write permission information of the target distributed application coordination service node, the target distributed application coordination service node is established under a father node of the target distributed application coordination service node, and the read-write permission of the target distributed application coordination service node is configured based on the final read-write permission information of the target distributed application coordination service node.
As an embodiment of the present invention, after configuring the read-write permission of the target distributed application coordination service node, the server of the distributed application coordination service further obtains the basic information of the target distributed application coordination service node, and combines the final read-write permission information and the basic information of the target distributed application coordination service node to obtain the configuration information of the target distributed application coordination service instance corresponding to the target distributed application coordination service node. The basic information of the target distributed application coordination service node includes, but is not limited to, the name, the type, the operating system and other information of the target distributed application coordination service node.
And after the server of the distributed application coordination service obtains the configuration information of the target distributed application coordination service instance, the server sends the configuration information of the target distributed application coordination service instance to the server of the distributed system.
After receiving the configuration information of the target distributed application coordination service instance, a server of the distributed system deploys the target distributed application coordination service instance on a distributed node corresponding to the target distributed application coordination service node, and then realizes the uniformity and the coordination between the distributed node and other distributed nodes in the distributed system through the target distributed application coordination service instance.
As can be seen from the above, in the configuration method of the distributed application coordination service node provided in this embodiment, by setting the read-write permission inheritance identification bit and the identification information bit of the parent node in the request for creating the distributed application coordination service node, when the target distributed application coordination service node to be created needs to be configured with the read-write permission identical to the read-write permission of its parent node, the server of the distributed application coordination service can obtain the read-write permission information of the parent node of the target distributed application coordination service node based on the identification information of the parent node of the target distributed application coordination service node carried in the request for creating the distributed application coordination service node only by carrying the read-write permission inheritance identification for representing the read-write permission of the inheritance parent node and the identification information of the parent node of the target distributed application coordination service node in the request for creating the distributed application coordination service node, and the read-write permission of the target distributed application coordination service node is automatically configured based on the read-write permission information of the father node of the target distributed application coordination service node, so that a user does not need to manually input the read-write permission information of the target distributed application coordination service node, the configuration process of the distributed application coordination service node is simplified, and the configuration efficiency of the distributed application coordination service node is improved.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for configuring a distributed application coordination service node according to another embodiment of the present invention. With respect to the embodiment corresponding to fig. 1, the request for creating the distributed application coordination service node of this embodiment further carries initial read-write permission information of a target distributed application coordination service node to be created, and based on this, the configuration method of the distributed application coordination service node provided in this embodiment further includes, after S12 and before S14, S01 to S02, which are detailed as follows:
s01: and detecting whether the initial read-write permission information of the target distributed application coordination service node carried in the establishment request of the distributed application coordination service node is consistent with the read-write permission information of the father node of the target distributed application coordination service node.
In this embodiment, because the request for creating the distributed application coordination service node also carries the initial read-write permission information of the target distributed application coordination service node to be created, after the server of the distributed application coordination service acquires the read-write permission information of the parent node of the target distributed application coordination service node, the initial read-write permission information of the target distributed application coordination service node carried in the request for creating the distributed application coordination service node is compared with the read-write permission information of the parent node of the target distributed application coordination service node to detect whether the initial read-write permission information of the target distributed application coordination service node carried in the request for creating the distributed application coordination service node is consistent with the read-write permission information of the parent node of the target distributed application coordination service node.
S02: if the initial read-write permission information of the target distributed application coordination service node carried in the distributed application coordination service node creation request is inconsistent with the read-write permission information of the father node of the target distributed application coordination service node, integrating the initial read-write permission information of the target distributed application coordination service node with the read-write permission information of the father node of the target distributed application coordination service node to obtain the final read-write permission information of the target distributed application coordination service node.
If the server of the distributed application coordination service detects that the initial read-write permission information of the target distributed application coordination service node carried in the establishment request of the distributed application coordination service node is inconsistent with the read-write permission information of the father node of the target distributed application coordination service node, it indicates that the user wants to enable the target distributed application coordination service node to inherit the read-write permission of the father node of the target distributed application coordination service node and wants to further expand the read-write permission of the target distributed application coordination service node, and at the moment, the server of the distributed application coordination service integrates the initial read-write permission information of the target distributed application coordination service node with the read-write permission information of the father node of the target distributed application coordination service node to obtain the final read-write permission information of the target distributed application coordination service node.
In practical application, the step of integrating the initial read-write permission information of the target distributed application coordination service node and the read-write permission information of the parent node of the target distributed application coordination service node may be: and combining the initial read-write permission information of the target distributed application coordination service node with the read-write permission information of the father node of the target distributed application coordination service node. For example, if the initial read-write permission information of the target distributed application coordination service node only describes the read permission but not the write permission, and the read-write permission information of the parent node of the target distributed application coordination service node only describes the write permission but not the read permission, the read permission described by the initial read-write permission information of the target distributed application coordination service node is combined with the write permission described by the read-write permission information of the parent node of the target distributed application coordination service node, so as to obtain the final read-write permission information of the target distributed application coordination service node.
As still another embodiment of the present invention, as shown in fig. 3, after S01 and before S14, the method for configuring the distributed application coordination service node may further include S03, which is detailed as follows:
s03: and if the initial read-write permission information of the target distributed application coordination service node carried in the distributed application coordination service node creation request is consistent with the read-write permission information of the father node of the target distributed application coordination service node, determining the initial read-write permission information of the target distributed application coordination service node or the read-write permission information of the father node of the target distributed application coordination service node as the final read-write permission information of the target distributed application coordination service node.
In this embodiment, if the server of the distributed application coordination service detects that the initial read-write permission information of the target distributed application coordination service node carried in the request for creating the distributed application coordination service node is consistent with the read-write permission information of the parent node of the target distributed application coordination service node, it indicates that the user wants to allow the target distributed application coordination service node to directly inherit the read-write permission of its parent node, and at this time, the server of the distributed application coordination service determines the initial read-write permission information of the target distributed application coordination service node or the read-write permission information of the parent node of the target distributed application coordination service node as the final read-write permission information of the target distributed application coordination service node.
As can be seen from the above, the configuration method for the distributed application coordination service node provided in this embodiment allows the initial read-write permission information of the target distributed application coordination service node to be created to be carried in the creation request of the distributed application coordination service node, and when a user wants to make the target distributed application coordination service node inherit the read-write permission of its parent node and further extend the read-write permission of the target distributed application coordination service node, only the read-write permission information inconsistent with the read-write permission information of the parent node of the target distributed application coordination service node is required to be carried in the creation request of the distributed application coordination service node as the initial read-write permission information of the target distributed application coordination service node, so that the configuration efficiency of the distributed application coordination service node is improved.
Referring to fig. 4, fig. 4 is a flowchart illustrating a configuration method of a distributed application coordination service node according to another embodiment of the present invention. With respect to the embodiment corresponding to fig. 2, the configuration method of the distributed application coordination service node provided in this embodiment further includes, after S11 and before S14, S04, which is detailed as follows:
s04: and if the read-write permission inheritance identifier carried by the distributed application coordination service node creation request is used for representing the read-write permission of the non-inheritance parent node, determining the initial read-write permission information of the target distributed application coordination service node carried by the distributed application coordination service node creation request as the final read-write permission information of the target distributed application coordination service node.
In this embodiment, after the server of the distributed application coordination service extracts the read-write permission inheritance identifier of the target distributed application coordination service node to be created and the identification information of the parent node of the target distributed application coordination service node from the distributed application coordination service node creation request, if it is detected that the read-write permission inheritance identifier of the target distributed application coordination service node is used for representing the read-write permission of the non-inheritance parent node, the server of the distributed application coordination service extracts the initial read-write permission information of the target distributed application coordination service node to be created from the received distributed application coordination service node creation request, and determines the initial read-write permission information as the final read-write permission information of the target distributed application coordination service node.
As can be seen from the above, according to the configuration method of the distributed application coordination service node provided in this embodiment, when a user does not want a target distributed application coordination service node to inherit the read-write right of its parent node, only a read-write right inheritance identifier for representing the read-write right of the non-inherited parent node and initial read-write right information of the target distributed application coordination service node are carried in a request for creating the distributed application coordination service node, and a server of the distributed application coordination service can automatically configure the read-write right of the target distributed application coordination service node based on the initial read-write right information, so that the configuration efficiency of the distributed application coordination service node is improved.
Referring to fig. 5, fig. 5 is a flowchart illustrating a configuration method of a distributed application coordination service node according to another embodiment of the present invention. With respect to the embodiment corresponding to fig. 1, the configuration method of the distributed application coordination service node provided in this embodiment further includes S15 to S16, which are detailed as follows:
s15: receiving a read-write permission updating request aiming at the established distributed application coordination service node; the read-write permission updating request carries identification information of distributed application coordination service nodes to be updated, read-write permission information to be updated and updating range identification.
In this embodiment, when a user needs to update the read-write permission of a created distributed application coordination service node, a read-write permission update request may be triggered through a node information setting interface of a server of the distributed application coordination service, where the read-write permission update request carries identification information of the distributed application coordination service node to be updated, read-write permission information to be updated, and an update range identification.
The update range identifier is used for describing a range of the distributed application coordination service node with the read-write permission to be updated, and the update range identifier may include global update and local update. The global updating is used for representing that the read-write permission of the distributed application coordination service node to be updated and all the child nodes of the distributed application coordination service node to be updated are updated, and the local updating is used for representing that the read-write permission of the distributed application coordination service node to be updated is only updated.
S16: and if the updating range identifier carried in the read-write permission updating request is used for representing global updating, updating the read-write permission of the distributed application coordination service node to be updated and all the sub-nodes thereof based on the read-write permission information to be updated carried in the read-write permission updating request.
In this embodiment, when the server of the distributed application coordination service receives the read-write permission update request, if it is detected that the update range identifier carried in the read-write permission update request is used to represent global update, the server locates the distributed application coordination service node to be updated based on the identifier information of the distributed application coordination service node to be updated carried in the read-write permission update request, and updates the read-write permissions of the distributed application coordination service node to be updated and all child nodes thereof based on the read-write permission information to be updated carried in the read-write permission update request.
As an embodiment of the present invention, if the server of the distributed application coordination service detects that the update range identifier carried in the read/write permission update request is used to characterize local update, the server locates the distributed application coordination service node to be updated based on the identifier information of the distributed application coordination service node to be updated carried in the read/write permission update request, and updates the read/write permission of the distributed application coordination service node to be updated based on the read/write permission information to be updated carried in the read/write permission update request.
As can be seen from the above, in the configuration method of the distributed application coordination service node provided in this embodiment, by setting the update range identifier bit in the read-write permission update request, when a user wants to update the read-write permission of a certain distributed application coordination service node and all the child nodes thereof, the batch update of the read-write permission of the distributed application coordination service node can be realized only by carrying the update range identifier for representing the global update, the identifier information of the distributed application coordination service node to be updated, and the read-write permission information to be updated in the read-write permission update request, so that the update efficiency of the read-write permission of the distributed application coordination service node is improved.
Referring to fig. 6, fig. 6 is a block diagram of a server according to an embodiment of the present invention. The server in this embodiment is a server of a distributed application coordination service. The server 600 includes units for executing the steps in the embodiments corresponding to fig. 1 to 5. Please refer to fig. 1 to 5 and fig. 1 to 5 for related descriptions. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 6, the server 600 includes: a first receiving unit 61, a first obtaining unit 62, a first determining unit 63 and a first configuring unit 64. Wherein:
the first receiving unit 61 is configured to receive a distributed application coordination service node creation request; the distributed application coordination service node creation request carries a read-write permission inheritance identifier of a target distributed application coordination service node to be created and identifier information of a father node of the target distributed application coordination service node; the read-write permission inheritance identifier is used for representing whether to inherit the read-write permission of the father node.
The first obtaining unit 62 is configured to, if the read-write permission inheritance identifier carried by the distributed application coordination service node creation request is used to represent the read-write permission of an inheritance parent node, obtain, based on the identifier information of the parent node of the target distributed application coordination service node, the read-write permission information of the parent node of the target distributed application coordination service node.
The first determining unit 63 is configured to determine the read-write permission information of the parent node of the target distributed application coordination service node as final read-write permission information of the target distributed application coordination service node.
The first configuration unit 64 is configured to create the target distributed application coordination service node under the parent node of the target distributed application coordination service node, and configure the read-write permission of the target distributed application coordination service node based on the final read-write permission information of the target distributed application coordination service node.
As an embodiment of the present invention, the request for creating the distributed application coordination service node further carries initial read-write permission information of a target distributed application coordination service node to be created;
the server 600 further includes: the device comprises a first detection unit and an information integration unit. Wherein:
the first detection unit is used for detecting whether the initial read-write permission information of the target distributed application coordination service node carried in the distributed application coordination service node creation request is consistent with the read-write permission information of the father node of the target distributed application coordination service node.
The information integration unit is used for integrating the initial read-write permission information of the target distributed application coordination service node and the read-write permission information of the father node of the target distributed application coordination service node if the initial read-write permission information of the target distributed application coordination service node carried in the distributed application coordination service node creation request is inconsistent with the read-write permission information of the father node of the target distributed application coordination service node, so as to obtain the final read-write permission information of the target distributed application coordination service node.
As an embodiment of the present invention, the server 600 further includes a second determining unit.
The second determining unit is configured to determine, if the initial read-write permission information of the target distributed application coordination service node carried in the distributed application coordination service node creation request is consistent with the read-write permission information of the parent node of the target distributed application coordination service node, the initial read-write permission information of the target distributed application coordination service node or the read-write permission information of the parent node of the target distributed application coordination service node as final read-write permission information of the target distributed application coordination service node.
As an embodiment of the present invention, the server 600 further includes a third determining unit.
The third determining unit is configured to determine, if the read-write permission inheritance identifier carried in the distributed application coordination service node creation request is used to represent a read-write permission that does not inherit a parent node, initial read-write permission information of the target distributed application coordination service node carried in the distributed application coordination service node creation request as final read-write permission information of the target distributed application coordination service node.
As an embodiment of the present invention, the server 600 further includes a second receiving unit and an updating unit. Wherein:
the second receiving unit is used for receiving a read-write permission updating request aiming at the established distributed application coordination service node; the read-write permission updating request carries identification information of distributed application coordination service nodes to be updated, read-write permission information to be updated and updating range identification.
And the updating unit is used for updating the read-write permission of the distributed application coordination service node to be updated and all the sub-nodes thereof based on the read-write permission information to be updated carried in the read-write permission updating request if the updating range identifier carried in the read-write permission updating request is used for representing global updating.
As can be seen from the above, in the server provided in this embodiment, by setting the read-write permission inheritance identification bit and the identification information bit of the parent node in the request for creating the distributed application coordination service node, when the target distributed application coordination service node to be created needs to be configured with the read-write permission identical to the read-write permission of its parent node, the server for the distributed application coordination service can obtain the read-write permission information of the parent node of the target distributed application coordination service node based on the identification information of the parent node of the target distributed application coordination service node carried in the request for creating the distributed application coordination service node, and based on the read-write permission information of the parent node of the target distributed application coordination service node, obtain the read-write permission information of the parent node of the target distributed application coordination service node The read-write permission of the application coordination service node is automatically configured, so that a user does not need to manually input the read-write permission information of the target distributed application coordination service node, the configuration process of the distributed application coordination service node is simplified, and the configuration efficiency of the distributed application coordination service node is improved.
Fig. 7 is a block diagram of a server according to another embodiment of the present invention. As shown in fig. 7, the server 7 of this embodiment includes: a processor 70, a memory 71 and a computer program 72 stored in said memory 71 and operable on said processor 70, for example a program of a method of configuration of a distributed application coordination service node. The processor 70, when executing the computer program 72, implements the steps of the various embodiments of the configuration method for a distributed application coordination service node, such as S11-S14 shown in fig. 1. Alternatively, when the processor 70 executes the computer program 72, the functions of the units in the embodiment corresponding to fig. 6, for example, the functions of the units 61 to 64 shown in fig. 6, are implemented, for which reference is specifically made to the relevant description in the embodiment corresponding to fig. 6, and details are not repeated here.
Illustratively, the computer program 72 may be divided into one or more units, which are stored in the memory 71 and executed by the processor 70 to accomplish the present invention. The one or more units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 72 in the server 7. For example, the computer program 72 may be divided into a first receiving unit, a first obtaining unit, a first determining unit and a first configuring unit, and the specific functions of the units are as described above.
The server may include, but is not limited to, a processor 70, a memory 71. Those skilled in the art will appreciate that fig. 7 is merely an example of a server 7 and does not constitute a limitation of the server 7 and may include more or fewer components than shown, or some components in combination, or different components, e.g., the server may also include input output devices, network access devices, buses, etc.
The Processor 70 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 71 may be an internal storage unit of the server 7, such as a hard disk or a memory of the server 7. The memory 71 may also be an external storage device of the server 7, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the server 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the server 7. The memory 71 is used for storing the computer program and other programs and data required by the server. The memory 71 may also be used to temporarily store data that has been output or is to be output.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A configuration method of a zookeeper distributed application coordination service node is characterized by comprising the following steps:
receiving a distributed application coordination service node creation request; the distributed application coordination service node creation request carries a read-write permission inheritance identifier of a target distributed application coordination service node to be created and identifier information of a father node of the target distributed application coordination service node; the read-write permission inheritance identifier is used for representing whether to inherit the read-write permission of the father node;
if the read-write permission inheritance identifier carried by the establishment request of the distributed application coordination service node is used for representing the read-write permission of the inheritance parent node, acquiring the read-write permission information of the parent node of the target distributed application coordination service node based on the identification information of the parent node of the target distributed application coordination service node;
determining the read-write permission information of the father node of the target distributed application coordination service node as the final read-write permission information of the target distributed application coordination service node;
and creating the target distributed application coordination service node under the father node of the target distributed application coordination service node, and configuring the read-write permission of the target distributed application coordination service node based on the final read-write permission information of the target distributed application coordination service node.
2. The configuration method of a zookeeper distributed application coordination service node as claimed in claim 1, wherein the distributed application coordination service node creation request further carries initial read-write permission information of a target distributed application coordination service node to be created;
if the read-write permission inheritance identifier carried by the request for creating the distributed application coordination service node is used for representing the read-write permission of an inheritance father node, after the read-write permission information of the father node of the target distributed application coordination service node is acquired based on the identification information of the father node of the target distributed application coordination service node, the creating of the target distributed application coordination service node under the father node of the target distributed application coordination service node is performed, and before the configuring of the read-write permission of the target distributed application coordination service node based on the final read-write permission information of the target distributed application coordination service node, the method further comprises the following steps:
detecting whether the initial read-write permission information of the target distributed application coordination service node carried in the establishment request of the distributed application coordination service node is consistent with the read-write permission information of the father node of the target distributed application coordination service node;
if the initial read-write permission information of the target distributed application coordination service node carried in the distributed application coordination service node creation request is inconsistent with the read-write permission information of the father node of the target distributed application coordination service node, integrating the initial read-write permission information of the target distributed application coordination service node with the read-write permission information of the father node of the target distributed application coordination service node to obtain the final read-write permission information of the target distributed application coordination service node.
3. The method according to claim 2, wherein after detecting whether the initial read-write permission information of the target distributed application coordination service node carried in the request for creating the distributed application coordination service node is consistent with the read-write permission information of the parent node of the target distributed application coordination service node, the method further includes:
and if the initial read-write permission information of the target distributed application coordination service node carried in the distributed application coordination service node creation request is consistent with the read-write permission information of the father node of the target distributed application coordination service node, determining the initial read-write permission information of the target distributed application coordination service node or the read-write permission information of the father node of the target distributed application coordination service node as the final read-write permission information of the target distributed application coordination service node.
4. The method according to claim 2, wherein after receiving the request for creating the distributed application coordination service node, before creating the target distributed application coordination service node under the parent node of the target distributed application coordination service node and configuring the read-write permission of the target distributed application coordination service node based on the final read-write permission information of the target distributed application coordination service node, the method further includes:
and if the read-write permission inheritance identifier carried by the distributed application coordination service node creation request is used for representing the read-write permission of the non-inheritance parent node, determining the initial read-write permission information of the target distributed application coordination service node carried by the distributed application coordination service node creation request as the final read-write permission information of the target distributed application coordination service node.
5. The method for configuring zookeeper distributed application coordination service node according to any of claims 1-4, further comprising:
receiving a read-write permission updating request aiming at the established distributed application coordination service node; the read-write permission updating request carries identification information of a distributed application coordination service node to be updated, read-write permission information to be updated and an updating range identification;
and if the updating range identifier carried in the read-write permission updating request is used for representing global updating, updating the read-write permission of the distributed application coordination service node to be updated and all the sub-nodes thereof based on the read-write permission information to be updated carried in the read-write permission updating request.
6. A zookeeper server, the server comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor when executing the computer program implementing the steps of:
receiving a zookeeper distributed application coordination service node creation request; the distributed application coordination service node creation request carries a read-write permission inheritance identifier of a target distributed application coordination service node to be created and identifier information of a father node of the target distributed application coordination service node; the read-write permission inheritance identifier is used for representing whether to inherit the read-write permission of the father node;
if the read-write permission inheritance identifier carried by the establishment request of the distributed application coordination service node is used for representing the read-write permission of the inheritance parent node, acquiring the read-write permission information of the parent node of the target distributed application coordination service node based on the identification information of the parent node of the target distributed application coordination service node;
determining the read-write permission information of the father node of the target distributed application coordination service node as the final read-write permission information of the target distributed application coordination service node;
and creating the target distributed application coordination service node under the father node of the target distributed application coordination service node, and configuring the read-write permission of the target distributed application coordination service node based on the final read-write permission information of the target distributed application coordination service node.
7. The zookeeper server of claim 6, wherein the request for creating the distributed application coordination service node further carries initial read-write permission information of a target distributed application coordination service node to be created;
if the read-write permission inheritance identifier carried by the request for creating the distributed application coordination service node is used for representing the read-write permission of an inheritance father node, after the read-write permission information of the father node of the target distributed application coordination service node is acquired based on the identification information of the father node of the target distributed application coordination service node, the creating of the target distributed application coordination service node under the father node of the target distributed application coordination service node is performed, and before the configuring of the read-write permission of the target distributed application coordination service node based on the final read-write permission information of the target distributed application coordination service node, the method further comprises the following steps:
detecting whether the initial read-write permission information of the target distributed application coordination service node carried in the establishment request of the distributed application coordination service node is consistent with the read-write permission information of the father node of the target distributed application coordination service node;
if the initial read-write permission information of the target distributed application coordination service node carried in the distributed application coordination service node creation request is inconsistent with the read-write permission information of the father node of the target distributed application coordination service node, integrating the initial read-write permission information of the target distributed application coordination service node with the read-write permission information of the father node of the target distributed application coordination service node to obtain the final read-write permission information of the target distributed application coordination service node.
8. The zookeeper server of claim 7, wherein after detecting whether the initial read-write permission information of the target distributed application coordination service node carried in the distributed application coordination service node creation request is consistent with the read-write permission information of the parent node of the target distributed application coordination service node, the method further comprises:
and if the initial read-write permission information of the target distributed application coordination service node carried in the distributed application coordination service node creation request is consistent with the read-write permission information of the father node of the target distributed application coordination service node, determining the initial read-write permission information of the target distributed application coordination service node or the read-write permission information of the father node of the target distributed application coordination service node as the final read-write permission information of the target distributed application coordination service node.
9. A zookeeper server, comprising:
the device comprises a first receiving unit, a second receiving unit and a third receiving unit, wherein the first receiving unit is used for receiving a zookeeper distributed application coordination service node creation request; the distributed application coordination service node creation request carries a read-write permission inheritance identifier of a target distributed application coordination service node to be created and identifier information of a father node of the target distributed application coordination service node; the read-write permission inheritance identifier is used for representing whether to inherit the read-write permission of the father node;
a first obtaining unit, configured to obtain, based on the identification information of the parent node of the target distributed application coordination service node, read-write permission information of the parent node of the target distributed application coordination service node if the read-write permission inheritance identification carried by the distributed application coordination service node creation request is used to represent the read-write permission of an inheritance parent node;
the first determining unit is used for determining the read-write permission information of the father node of the target distributed application coordination service node as the final read-write permission information of the target distributed application coordination service node;
the first configuration unit is used for creating the target distributed application coordination service node under a father node of the target distributed application coordination service node and configuring the read-write permission of the target distributed application coordination service node based on the final read-write permission information of the target distributed application coordination service node.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
CN201910012068.4A 2019-01-07 2019-01-07 Configuration method, server and medium for distributed application coordination service node Active CN109788054B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910012068.4A CN109788054B (en) 2019-01-07 2019-01-07 Configuration method, server and medium for distributed application coordination service node

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910012068.4A CN109788054B (en) 2019-01-07 2019-01-07 Configuration method, server and medium for distributed application coordination service node

Publications (2)

Publication Number Publication Date
CN109788054A CN109788054A (en) 2019-05-21
CN109788054B true CN109788054B (en) 2022-04-15

Family

ID=66499942

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910012068.4A Active CN109788054B (en) 2019-01-07 2019-01-07 Configuration method, server and medium for distributed application coordination service node

Country Status (1)

Country Link
CN (1) CN109788054B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111967036B (en) * 2020-10-26 2020-12-22 成都掌控者网络科技有限公司 Distributed control-based multi-weight group inheritance treatment method and device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1848022A (en) * 2005-04-13 2006-10-18 华为技术有限公司 Authority control method based on access control list
CN101325509A (en) * 2007-06-11 2008-12-17 华为技术有限公司 Method, system and apparatus for installing software component
CN103281259A (en) * 2013-05-20 2013-09-04 中国科学院信息工程研究所 Inter-domain access control method based on dynamic self regulation
CN106250247A (en) * 2016-07-26 2016-12-21 浪潮电子信息产业股份有限公司 A kind of method realizing far call framework based on RMI and ZooKeeper
CN106294386A (en) * 2015-05-19 2017-01-04 北大方正集团有限公司 Task distribution performs method and system
CN108599971A (en) * 2017-12-22 2018-09-28 金蝶软件(中国)有限公司 Configuring information processing method, system, computer equipment and storage medium
CN108768948A (en) * 2018-04-28 2018-11-06 努比亚技术有限公司 A kind of access rights management method, server and computer readable storage medium
CN108776618A (en) * 2018-06-26 2018-11-09 杭州比智科技有限公司 Distributed workflow management method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8055680B2 (en) * 2005-04-19 2011-11-08 International Business Machines Corporation Assigning access control lists to a hierarchical namespace to optimize ACL inheritance
US8290996B2 (en) * 2010-07-30 2012-10-16 International Business Machines Corporation Data sharing for file clones using reverse ditto references
US20170124073A1 (en) * 2015-10-28 2017-05-04 Bank Of America Corporation Code migration tool using distributed file system directories

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1848022A (en) * 2005-04-13 2006-10-18 华为技术有限公司 Authority control method based on access control list
CN101325509A (en) * 2007-06-11 2008-12-17 华为技术有限公司 Method, system and apparatus for installing software component
CN103281259A (en) * 2013-05-20 2013-09-04 中国科学院信息工程研究所 Inter-domain access control method based on dynamic self regulation
CN106294386A (en) * 2015-05-19 2017-01-04 北大方正集团有限公司 Task distribution performs method and system
CN106250247A (en) * 2016-07-26 2016-12-21 浪潮电子信息产业股份有限公司 A kind of method realizing far call framework based on RMI and ZooKeeper
CN108599971A (en) * 2017-12-22 2018-09-28 金蝶软件(中国)有限公司 Configuring information processing method, system, computer equipment and storage medium
CN108768948A (en) * 2018-04-28 2018-11-06 努比亚技术有限公司 A kind of access rights management method, server and computer readable storage medium
CN108776618A (en) * 2018-06-26 2018-11-09 杭州比智科技有限公司 Distributed workflow management method and device

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
A General-Purpose Architecture for Replicated Metadata Services in Distributed File Systems;Dimokritos Stamatakis;《IEEE》;20170502;全文 *
一种基于有向图模型的安全策略冲突检测方法;姚键;《计算机研究与发展》;20051231;正文第1,4.3小节 *
基于角色的访问控制管理模型的分析与比较;刘湘雯等;《江苏大学学报(自然科学版)》;20030930(第05期);全文 *

Also Published As

Publication number Publication date
CN109788054A (en) 2019-05-21

Similar Documents

Publication Publication Date Title
JP6435398B2 (en) Method and system for facilitating terminal identifiers
CN107832062B (en) Program updating method and terminal equipment
CN109032803B (en) Data processing method and device and client
CN111225064A (en) Ceph cluster deployment method, system, device and computer-readable storage medium
CN111767144A (en) Transaction routing determination method, device, equipment and system for transaction data
WO2023165226A1 (en) Application resource backup method and apparatus, electronic device, and storage medium
US9960968B2 (en) Identification of networking component application programming interfaces
CN111343267B (en) Configuration management method and system
WO2022267769A1 (en) Method and apparatus for generating graph data
WO2021197579A1 (en) Method for deploying application software in cloud environments
CN109788054B (en) Configuration method, server and medium for distributed application coordination service node
CN112291321B (en) Service processing method, device and system
CN110058995B (en) Database testing method and system capable of avoiding interference of database types
WO2019047142A1 (en) Method for program patching, device, micro control unit, and terminal device
CN115390939B (en) Service processing method and system
US20150347402A1 (en) System and method for enabling a client system to generate file system operations on a file system data set using a virtual namespace
CN113486025B (en) Data storage method, data query method and device
CN114064712A (en) Data access method and device, electronic equipment and computer readable storage medium
CN111324368B (en) Data sharing method and server
CN114564210A (en) Copy deployment method, device, system, electronic equipment and storage medium
US11349926B1 (en) Protected smart contracts for managing internet of things devices
CN109032655B (en) Configuration method of monitoring instance, server and computer readable storage medium
US10200242B2 (en) System and method to replicate server configurations across systems using sticky attributions
EP3192225A1 (en) Information object system
CN110417904B (en) Push information processing method, device 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