# Update node roles with shards assigned

**URL:** <https://discuss.elastic.co/t/update-node-roles-with-shards-assigned/325344>\
**Category:** Elasticsearch\
**Tags:** reindex\
**Created:** [February 13, 2023, 4:34am UTC](https://discuss.elastic.co/t/update-node-roles-with-shards-assigned/325344 "2023-02-13T04:34:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sachiko](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@sachiko](https://discuss.elastic.co/u/sachiko)\
**Post date:** [February 13, 2023, 4:34am UTC](https://discuss.elastic.co/t/update-node-roles-with-shards-assigned/325344/1 "2023-02-13T04:34:45Z")

</div>

Cluster is having 6 nodes, having the default role: cdfhilmrstw

How to update the node.roles from all to master only.  
Note: node has already a shards assigned, containing .security-7 index.

IF I run elasticsearch-node repurpose to delete data to be master eligible node, password for default elastic user was also getting deleted.

Goal is to update the nodes, with each specific roles e.g. 3 master, 2 data, and 1 ingest nodes.

Thanks

---

<div class="post-metadata">

**Author:** ![thn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thn/32/8061_2.png) [@thn](https://discuss.elastic.co/u/thn)\
**Post date:** [February 13, 2023, 7:54pm UTC](https://discuss.elastic.co/t/update-node-roles-with-shards-assigned/325344/2 "2023-02-13T19:54:41Z")

</div>

You can add **node.roles** to $ES\_HOME/config/elasticsearch.yml

Example:

- **node.roles:** _[master]_

For all roles or some, you can do

- **node.roles:** _[master, data, data\_hot, data\_warm, data\_cold, data\_frozen, data\_content, ingest, ml, remote\_cluster\_client, transform]_

Reference to all role names, you can use this [link](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html#node-roles)

---

<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:** [March 13, 2023, 7:54pm UTC](https://discuss.elastic.co/t/update-node-roles-with-shards-assigned/325344/3 "2023-03-13T19:54:53Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
