Patching, Cluster Expansion, Hardware Refresh and Data Migration

Big Data and Hadoop Administrator 14 min min read Updated: Nov 17, 2026 Intermediate
Patching, Cluster Expansion, Hardware Refresh and Data Migration
Intermediate Topic 4 of 4

OS Patching with Rolling Reboots

Security patches need reboots. Do them in batches that the cluster can tolerate.

RuleReason
Patch masters one at a time using failoverNameNode, RM, ZooKeeper, JournalNodes keep quorum
Patch workers in batches of 2 to 5 percent, one rack at a timeKeeps at least 2 replicas available
Use maintenance mode or short outage under the dead-node timeoutAvoid re-replication storms
Check health between batchesStop if missing blocks appear
yaml # patch.yml (Ansible) - hosts: workers serial: "3%" max_fail_percentage: 0 tasks: - name: Put DataNode in maintenance (stop services gracefully) ansible.builtin.systemd: { name: "{{ item }}", state: stopped } loop: [hadoop-nodemanager, hadoop-datanode] - name: Patch and reboot ansible.builtin.dnf: { name: "*", state: latest, security: true } - ansible.builtin.reboot: { reboot_timeout: 900 } - name: Start services ansible.builtin.systemd: { name: "{{ item }}", state: started } loop: [hadoop-datanode, hadoop-nodemanager] - name: Wait until DataNode is registered and no under-replicated backlog ansible.builtin.shell: | for i in $(seq 1 60); do U=$(curl -s "http://nn1:9870/jmx?qry=Hadoop:service=NameNode,name=FSNamesystem" | jq '.beans[0].UnderReplicatedBlocks') [ "$U" -lt 100 ] && exit 0; sleep 30; done; exit 1 delegate_to: localhost

Adding Nodes or Racks

  1. Rack, power and network the servers; apply the standard OS image
  2. Add DNS and topology data (new rack path)
  3. Run Ansible to install and configure Hadoop
  4. Add to workers file and any include lists
  5. Start DataNode and NodeManager
  6. hdfs dfsadmin -report shows new capacity
  7. Run the balancer slowly at low-traffic hours
  8. Update monitoring targets and capacity sheet
bash hdfs dfsadmin -refreshNodes yarn rmadmin -refreshNodes hdfs dfsadmin -setBalancerBandwidth 52428800 hdfs balancer -threshold 8 -idleiterations 3 hdfs dfsadmin -printTopology | tail -15

Hardware Refresh (Replace Old With New)

  • Add new nodes first, then retire old ones in batches
  • Decommission old racks one at a time and wait for Decommissioned state
  • Keep replication and rack rules satisfied during the move
  • Check old nodes have no unique data before removal (fsck -blocks -locations)
  • Wipe disks securely and update the inventory

Migrating Data Between Clusters

ScenarioApproach
Old cluster to new clusterParallel run: distcp in waves, switch jobs by dataset, final sync with writes frozen
On-premises to clouddistcp to object storage over a dedicated link or transfer appliance
Major version change (2.x to 3.x)Use webhdfs:// or hdfs:// distcp from the source (the older cluster) running on the newer cluster
bash # run from the NEW (higher version) cluster, read old data using webhdfs hadoop distcp -update -p -m 100 -bandwidth 80 webhdfs://old-nn:9870/data hdfs://new/data # final cutover sync: freeze writers, snapshot-diff distcp, then change client configs / nameservice

Migration Plan Template

PhaseActions
DiscoverInventory data, jobs, users, schedules, dependencies, volumes (hdfs dfs -du)
PrepareBuild target, security, Ranger policies, KMS keys, quotas, monitoring
CopyBulk distcp, then incremental syncs
ValidateCounts, checksums, sample queries and job outputs match
CutoverFreeze, final sync, switch endpoints, start jobs on the new side
HypercareFast support for 2 to 4 weeks, keep old data until sign-off
DecommissionDelete old data after retention approval
Data and metadata together: Remember Hive metastore content, Oozie or Airflow definitions, HBase tables, Ranger policies and user access. Migrating only the files is a common cause of failed moves.
Network is the usual limit: Moving 1 PB over a 10 Gbit link at full speed takes about 9 days (1 PB / 1.25 GB per second). Real life is slower, so plan bandwidth and do not saturate production links.

Conclusion

Lifecycle work follows the same ideas: small batches, health checks between them, capacity added before old nodes removed, and migrations done in waves with validation and a clear cutover.

Quick Summary: rolling batches by rack; add before remove; balancer; distcp waves + final sync.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators