0

I have a cluster of 5 machines:

  • 1 big NameNode
  • 4 standard DataNodes

I want to change my current NameNode with a DataNode without losing the data stored in HDFS, so my cluster could become:

  • 1 standard NameNode
  • 3 standard DataNodes
  • 1 big DataNode

Does someone know a simple way to do that?

Thank you very much

tk421
  • 5,775
  • 6
  • 23
  • 34
Noa Be
  • 277
  • 3
  • 10
  • Can you backup the namenode? If so, then turn off all datanodes, take namenode offline, start a different namenode service, then restore the backup followed by starting all datanodes – OneCricketeer Sep 05 '18 at 13:50

1 Answers1

0
  1. Decomission data node where namenode will be moved.
  2. Stop the cluster.
  3. Create a tar of dfs.name.dir from current namenode.
  4. Copy all hadoop config files from current NN to target NN.
  5. Replace the name/ip of target namenode by modifying core-site.xml.
  6. Restore tarball of dfs.name.dir. Make sure that full path is same.
  7. Now start the cluster by starting new namenode and one less datanode.
  8. Verify that everything is working perfectly.
  9. Add old namenode as datanode by configuring it as datanode.
  10. I would suggest to uninstall and then install hadoop on both the nodes so that previous configuration does not cause any problem.
Ajay Srivastava
  • 1,151
  • 11
  • 15