# New noteid assigned after restart?

**URL:** https://discuss.elastic.co/t/new-noteid-assigned-after-restart/22587
**Category:** Elasticsearch
**Created:** [March 9, 2015, 8:23pm UTC](https://discuss.elastic.co/t/new-noteid-assigned-after-restart/22587 "2015-03-09T20:23:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Daniel\_Li](https://avatars.discourse-cdn.com/v4/letter/d/e9bcb4/32.png) [@Daniel\_Li](https://discuss.elastic.co/u/Daniel_Li)
#### Post date: [March 9, 2015, 8:23pm UTC](https://discuss.elastic.co/t/new-noteid-assigned-after-restart/22587/1 "2015-03-09T20:23:03Z")

</div>

Hi,

I noticed a nodeid is always reassigned after the node is shutdown and  
started again (restart). Is this by design? This caused master has to  
remove the old node and add the new node, whenever the node is crashed and  
restarted.

Is there a way to have the node to keep the same id after restart?

thanks  
Daniel

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/434203f0-c30f-439b-b58e-78f2841b1518%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/434203f0-c30f-439b-b58e-78f2841b1518%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Daniel\_Li](https://avatars.discourse-cdn.com/v4/letter/d/e9bcb4/32.png) [@Daniel\_Li](https://discuss.elastic.co/u/Daniel_Li)
#### Post date: [March 9, 2015, 9:47pm UTC](https://discuss.elastic.co/t/new-noteid-assigned-after-restart/22587/2 "2015-03-09T21:47:46Z")

</div>

Found this -

@Override protected void doStart() throws ElasticsearchException {  
add(localNodeMasterListeners); this.clusterState = ClusterState.  
builder(clusterState).blocks(initialBlocks).build(); this.updateTasksExecutor  
= EsExecutors.newSinglePrioritizing(daemonThreadFactory(settings,  
UPDATE\_THREAD\_NAME)); this.reconnectToNodes = threadPool.schedule(reconnectInterval,  
ThreadPool.Names.GENERIC, new ReconnectToNodes()); Map\<String, String\>  
nodeAttributes = discoveryNodeService.buildAttributes(); // note, we rely  
on the fact that its a new id each time we start, see FD and "kill -9"  
handling final String nodeId = DiscoveryService.generateNodeId(settings);  
DiscoveryNode localNode = new DiscoveryNode(settings.get("name"), nodeId,  
transportService.boundAddress().publishAddress(), nodeAttributes, version);  
DiscoveryNodes.Builder nodeBuilder = DiscoveryNodes.builder().put(localNode)  
.localNodeId(localNode.id()); this.clusterState = ClusterState.  
builder(clusterState).nodes(nodeBuilder).blocks(initialBlocks).build(); }  
On Monday, March 9, 2015 at 1:23:03 PM UTC-7, Daniel Li wrote:

> Hi,
> 
> I noticed a nodeid is always reassigned after the node is shutdown and  
> started again (restart). Is this by design? This caused master has to  
> remove the old node and add the new node, whenever the node is crashed and  
> restarted.
> 
> Is there a way to have the node to keep the same id after restart?
> 
> thanks  
> Daniel

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/36950376-ae35-42a4-9c86-a2b39c4aea9c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/36950376-ae35-42a4-9c86-a2b39c4aea9c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [March 9, 2015, 9:48pm UTC](https://discuss.elastic.co/t/new-noteid-assigned-after-restart/22587/3 "2015-03-09T21:48:28Z")

</div>

The node ID is auto generated, you can set the node.name though.

What is the problem with things being added back in though?

On 9 March 2015 at 13:23, Daniel Li [danielli90@gmail.com](mailto:danielli90@gmail.com) wrote:

> Hi,
> 
> I noticed a nodeid is always reassigned after the node is shutdown and  
> started again (restart). Is this by design? This caused master has to  
> remove the old node and add the new node, whenever the node is crashed and  
> restarted.
> 
> Is there a way to have the node to keep the same id after restart?
> 
> thanks  
> Daniel
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/434203f0-c30f-439b-b58e-78f2841b1518%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/434203f0-c30f-439b-b58e-78f2841b1518%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/434203f0-c30f-439b-b58e-78f2841b1518%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/434203f0-c30f-439b-b58e-78f2841b1518%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-%3D%3DyUj5efU-J%2Bq\_Z7xB%3DzUmXD%3DGKZfMas9LKixNQACGw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-%3D%3DyUj5efU-J%2Bq_Z7xB%3DzUmXD%3DGKZfMas9LKixNQACGw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 12:27am UTC](https://discuss.elastic.co/t/new-noteid-assigned-after-restart/22587/4 "2017-07-06T00:27:42Z")

</div>


