A distributed node id generation method, device, equipment and storage medium
A distributed node and memory technology, applied in the field of distributed systems, can solve problems such as abnormal operation of distributed clusters and ID collisions
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Publication Date
- 2022-02-11
Smart Images

Figure 1 
Figure 2 
Figure 3
Abstract
Description
technical field
[0001] The present application relates to the technical field of distributed systems, and in particular to a method for generating a distributed node ID, a device for generating a distributed node ID, electronic equipment, and a computer-readable storage medium. Background technique
[0002] In a distributed environment, each node needs to have a globally unique ID (Identity document) in order to use it to represent its own identity, for example, the snowflake algorithm is used to generate a globally unique ID. When using the snowflake algorithm to generate a globally unique ID, it is necessary to add the ID of the working machine, and the ID of the working machine needs to be manually configured. Once there is a mistake in the process of manually configuring the ID of the working machine, it may lead to the problem of ID collision, which will lead to distribution An exception occurs when the cluster is running. Contents of the invention
[0003] In view o...
Examples
Embodiment Construction
[0040] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments It is only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
[0041] Please refer to figure 1 , figure 1 It is a flow chart of a method for generating a distributed node ID provided in the embodiment of this application. The method includes:
[0042] S101: If it is detected that the service is started, determine the first length corresponding to the machine ID and the second length cor...