Nodes in Hadoop cluster run both a datanode and a tasktracker, and both are typically commissioned or decommissioned in tandem.
Commissioning new nodes
Commissioning a new node can be as simple as configuring the hdfs-site.xml file to point to the namenode, configuring the mapred-site.xml file to point to the jobtracker, and starting the datanode and jobtracker daemons. Although from security perspective you'd better to have a list of authorized nodes.
Datanodes that are permitted to connect to the namenode are specified in a file whose name is specified by the dfs.hosts property. The file reside on the namenode's local filesystem, and it contains a line for each datanode, specified by network address. If you need to specified multiple network addresses for a datanode, put them on one line, separated by whitespace.
Tasktrackers that may connect to the jobtracker are specified in a file whose name is specified by the mapred.hosts property. In most cases, there is one shared file, referred as the include file, that both dfs.hosts and mapred.hosts refer to, since nodes in the cluster run both datanode and tasktracker daemons.
To add new nodes to the cluster:
- Add the network address of the new nodes to the include file.
-
Update the namenode with the new set of permitted datanodes using this command:
$ hadoop dfsadmin -refreshNodes
-
Update the jobtracker with the new set of permitted tasktrackers using:
$ hadoop mradmin -refreshNodes
- Update the slaves file with the new nodes, so that they are included in future operations performed by the hadoop control scripts.
- Start the new datanodes and tasktrackers.
- Check that the new datanodes and tasktrackers apprer in the web UI.
HDFS will not move blocks from old datanodes to new datanodes to balance the cluster. To do this, you should run the balancer manually by:
$ start-balancer.sh
The -threshold argument specified the threshold percentage that defines what it means for the cluster to be balanced. The flag is optional, in which case the threshold is 10%.
Decommissioning old nodes
The way to decommission datanodes is to inform the namenode of the nodes that you wish to take out of circulation, so that it can replicate the blocks to other datanodes before the datanodes are shutdown.
The decommissioning process is controlled by an exclude file, which for HDFS is set by the dfs.hosts.exclude property and for MapReduce by the mapred.hosts.exclude property. It is often the case that these properties refer to the same file. The exclude file lists the nodes that are not permitted tot connect to the cluster.
To remove nodes from the cluster:
- Add the network address of the nodes to be decommissioned to the exclude file. Do not update the include file at this point.
-
Update the namenode with the new set of permitted datanodes, using this command:
$ hadoop dfsadmin -refreshNodes
-
Update the jobtracker with the new set of permitted tasktracker using:
$ hadoop mradmin -refreshNodes
- Go to the web UI and check whether the admin state has changed to "Decommission in Progress" for the datanodes being decommissioned. They will start copying their blocks to other datanodes in the cluster.
- When all the datanodes report their state as "Decommissioned", all the blocks have been replicated. Shut down the decommissioned nodes.
-
Remove the nodes from the include file, and run:
$ hadoop dfsadmin -refreshNodes $ hadoop mradmin -refreshNodes
- Remove the nodes from the slaves file.
Actually, to decommission or recommission a node from Hadoop cluster manually is too involved. With cloudera manager, it easy to do the job without too involved into the fussy configuration. Below is the steps to decommission and recommission a node in a Hadoop cluster using Cloudera Manager.
Decommission one or more hosts:
- Click the Hosts tab.
- Select the host(s) you want to decommission.
- From the Actions for Selected menu, click Decommission.
- A confirmation pop-up informs you of the roles that will be decommissioned or stopped on the nodes you have selected. To proceed with the decommissioning, click Confirm.
- A Command Details window appears that will show each stop or decommission command as it is run, service by service. You can click one of the decommission links to see the subcommands that are run for decommissioning a given role. Depending on the role, the steps may include adding the node to an "exclusions list" and refreshing the NameNode, JobTracker, or NodeManager, stopping the Balancer (if it is running), and moving data blocks or regions. Roles that do not have specific decommission actions are just stopped.
While decommissioning is in progress, the host is marked Decommissioning in the list under the Hosts tab. Once all roles have been decommissioned or stopped, the host is marked Decommissioned.
Roles on a decommissioned host cannot be restarted until the host is recommissioned.
Recommissioning a Host
Only hosts that are decommissioned using Cloudera Manager can be recommissioned.
- Click the Hosts tab.
- Select the host(s) you want to recommission.
- From the Actions for Selected menu, click recommission.
This will recommission the host (i.e. remove it from the exclusion lists and run the appropriate refresh) so that the roles that reside on it can be restarted. The Decommissioned indicator is removed from the host. It also removes the Decommissioned indicator from the roles that reside on the host. However, the roles themselves are NOT restarted by the recommission command.
You can restart all the roles on a recommissioned host in a single command from the Hosts page:
- Select the host(s) on which you want to start the decommissioned roles.
- From the Actions for Selected menu, click Start All Roles.
Run the Balancer to rebalance the cluster:
1. On the HDFS > Status tab, choose Rebalance on the Actions menu.
2. Click Rebalance that appears in the next screen to confirm.
If you see a Finished status, the Balancer successfully ran and completed.
相关推荐
Commissioning and Decommissioning Nodes 357 Upgrades 360 11. Pig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 ...
out(client) cluster: 0x0015 (Commissioning) in (server) cluster: 0x0019 (Over the Air Bootloading) out(client) cluster: 0x0020 (Poll Control) out(client) cluster: 0x0300 (Color Control) out...
西门子Desigo PXC4和PXC5是楼宇自动化控制系统中的重要组成部分,主要用于实现对建筑环境的高效管理和控制。这个工程与调试教程是专为这些控制器设计的,旨在帮助用户理解和掌握系统的安装、配置以及优化操作。...
- **功能**: 介绍PIS (Productivity and Information Services) 的服务以及与PLC相关的功能。 - **应用场景**: 优化生产效率和服务质量。 ##### 10. PLC 自诊断 (B058) - **位置**: 第N页 - **功能**: 实现PLC内部...
根据提供的文件信息,本文档是关于西门子SINUMERIK 828D数控系统的培训手册,特别关注调试(Commissioning)环节。SINUMERIK 828D是一款适用于车床和铣床的数控系统。培训手册的目的是为了让操作者或技术人员能够...
《ISPE受控温度试验箱绘图和监控良好实践指南》是针对制药和生物技术行业中对温度控制有严格要求的产品储存和运输需求而编写的。该指南由ISPE(国际制药工程协会)发布,旨在提供关于受控恒温箱操作的一系列最佳实践...
"FCs (Functions) and FBs"部分介绍了可以与S7-CPs一起使用的功能块(Function Blocks, FBs)和函数(Functions, FCs)。这些软件组件在PLC程序中用于处理特定的通信任务,如读写PROFIBUS从站的数据。 "NCM S7 ...
ANSI IES LP-8-20 The Commissioning Process Applied to Lighting and Control Systems.pdf
Loading commissioning files directly to the control system and from the control system to your PC. This function is used to support commissioning. Managing the control system's NC data. You can ...
Session10 - full Cell Virtual Commissioning SCL
IEC TS 63336 -2024 Commissioning of VSC HVDC systems.pdf
调试方案-commissioning-(中英文双语版).doc
Session10 - Full Cell Virtual Commissioning - with KOP GRAPH.pdf
KUKA TQ Specialist Commissioning (TQ 专家调 试) 1 系统概览概述 ..................................................... 7 1.1 概览: 系统概览概述 ..................................................... ...
The theory asserts that translators must consider the commissioning party, the intended recipient, and the cultural context when rendering a text. This can sometimes lead to departures from the ...
19. ABB ACS 800 Drive Basic Startup _ commissioning(1080P_60FPS).mp4
【船级社】 RINA GUI37-ENG Guide for Survey during Construction, Commissioning and Sea Trials of LNG Gas Fuelled Ships.pdf
On the other hand, it provides configuration engineers and commissioning personnel with extensive information and reference data to which they can refer when setting up their network systems.