- Hadoop Real-World Solutions Cookbook(Second Edition)
- Tanmay Deshpande
- 366字
- 2021-07-09 20:02:49
Decommissioning DataNodes
The Hadoop framework provides us with the option to remove certain nodes from the cluster if they are not needed any more. Here, we cannot simply shutdown the nodes that need to be removed as we might lose some of our data. They need to be decommissioned properly. In this recipe, we are going to learn how to decommission nodes from the Hadoop cluster.
Getting ready
To perform this recipe, you should have a Hadoop cluster, and you should have decided which node to decommission.
How to do it...
To decommission a node from the HDFS cluster, we need to perform the following steps:
- Create a
dfs.exclude
file in a folder, say/usr/local/hadoop/etc/hadoop
, and add the hostname of the node you wish to decommission. - Edit
hdfs-site.xml
onNameNode
to append the following property:<property> <name>dfs.hosts.exclude</name> <value>/usr/local/hadoop/etc/hadoop/dfs.exclude</value> </property>
- Next, we need to execute the
refreshNodes
command so that it rereads the HDFS configuration in order to start the decommissioning:hdfs dfsadmin –refreshNodes
This will start the decommissioning, and once successful execution of the dfsadmin
report command, you will see that the node's status is changed to Decommissioned
from Normal
:
hdfs dfsadmin –report Name: 172.31.18.55:50010 (ip-172-31-18-55.us-west-2.compute.internal) Hostname: ip-172-31-18-55.us-west-2.compute.internal Decommission Status : Decommissioned Configured Capacity: 8309932032 (7.74 GB) DFS Used: 1179648 (1.13 MB) Non DFS Used: 2371989504 (2.21 GB) DFS Remaining: 5936762880 (5.53 GB) DFS Used%: 0.01% DFS Remaining%: 71.44% Configured Cache Capacity: 0 (0 B) Cache Used: 0 (0 B) Cache Remaining: 0 (0 B) Cache Used%: 100.00% Cache Remaining%: 0.00% Xceivers: 1 Last contact: Thu Oct 08 10:56:49 UTC 2015
Generally, the decommissioning takes time as it requires block replications on other nodes. Once the decommissioning is complete, the node will be added to the decommissioned nodes list.
How it works...
HDFS/Namenode
reads the configurations from hdfs-site.xml
. You can configure a file with the list of nodes to decommission and execute the refreshNodes
command; it then rereads the configuration file. While doing this, it reads the configuration about the decommissioned nodes and will start rereplicating blocks to other available datanode
. Depending on the size of datanode
getting decommissioned, the time varies. Unless the completed decommissioning is not completed, it advisable for you to touch datanode
.
- Introduction to DevOps with Kubernetes
- Dreamweaver CS3網(wǎng)頁制作融會(huì)貫通
- 極簡(jiǎn)AI入門:一本書讀懂人工智能思維與應(yīng)用
- 電腦上網(wǎng)直通車
- 城市道路交通主動(dòng)控制技術(shù)
- JSF2和RichFaces4使用指南
- 大型數(shù)據(jù)庫管理系統(tǒng)技術(shù)、應(yīng)用與實(shí)例分析:SQL Server 2005
- 可編程序控制器應(yīng)用實(shí)訓(xùn)(三菱機(jī)型)
- 統(tǒng)計(jì)學(xué)習(xí)理論與方法:R語言版
- 網(wǎng)絡(luò)化分布式系統(tǒng)預(yù)測(cè)控制
- 電氣控制與PLC技術(shù)應(yīng)用
- 智能生產(chǎn)線的重構(gòu)方法
- 網(wǎng)絡(luò)管理工具實(shí)用詳解
- JRuby語言實(shí)戰(zhàn)技術(shù)
- 大型機(jī)系統(tǒng)應(yīng)用基礎(chǔ)