How to remove a data node from the cluster?


We have 30 data nodes and 3 master nodes in our cluster. If one data node is in trouble, for example, the hardware is broken, the overall search performance will be affected.

My current solution is that: I manually shutdown the data node. However, this method is not good.

Therefore, my question is:
Is there any API to remove the node from the cluster dynamiclly?

Thank you~

I normally use index routing to route all indexes/shards off a node and then shut it down.