[英]Distributed system - How to assign a node ID to each node in distributed system?
How can we assign a unique ID to each node/instance of an application in a distributed environment?我们如何在分布式环境中为应用程序的每个节点/实例分配一个唯一的 ID?
You could potentially use any of the following:您可能会使用以下任何一项:
Presumably, you store each node's id in the persistent state of the node itself so that it can look it up when it restarts.据推测,您将每个节点的 id 存储在节点本身的持久性 state 中,以便它可以在重新启动时查找它。 (If not, you could make it the responsibility of the the node launch / relaunch mechanism to tell it.)
(如果没有,您可以让节点启动/重新启动机制负责告诉它。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.