How can we assign a unique ID to each node/instance of an application in a distributed environment?
- We have deployed our app on multiple hosts and requests are distributed across them through a load balancer.
- We have a requirement where we want to store some data specific to these nodes, and if one of the servers crashes then upon restart we want to delete data specific to only that node, not for others.
- We can use IP addresses, but that doesn't seem to be a perfect solution. How can we use node ID which is non-changeable so that once the server/node restarts it remains the same?
- Our application is basically a Java web application which is a kind of web socket server running on tomcat containers.