Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

What's the difference of -bootstrapstandby and -rollback for NameNode in HDFS rolling upgrade?

Solved Go to solution

What's the difference of -bootstrapstandby and -rollback for NameNode in HDFS rolling upgrade?

Explorer

In HDFS documentation, it said the steps to do rollback of rolling upgrade:

  1. Shutdown all NNs and DNs.
  2. Restore the pre-upgrade release in all machines.
  3. Start NN1 as Active with the "-rollingUpgrade rollback" option.
  4. Run `-bootstrapStandby' on NN2 and start it normally as standby.
  5. Start DNs with the "-rollback" option.

Why do both NameNodes have different option? E.g. for NN1, -rollingUpgrade rollback, AND for NN2, '-bootstrapStandby' instead must be used.

What's the difference of '-bootstrapstandby' and '-rollback'?

In addition, it's expected to explain what happened behind hoods if any of the two is specified.

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: What's the difference of -bootstrapstandby and -rollback for NameNode in HDFS rolling upgrade?

  • "rollingUpgarde rollback" on NN1 means that both hdfs software and data in hdfs will be reverted back to the state before starting the rolling upgrade. Any changes to hdfs (files added to or deleted) will be lost. NN1 will become active NN.
  • "bootstrapStandby" on NN2 means that metadata from NN1 will be copied to NN2. After startup NN2 will become Stand by NN.

What happens behind the stage: when you start the rolling upgrade with "rollingUpgrade prepare" a copy of NN metadata (FSImage) is created, called "previous". It consists of hard links to the "current" FSImage. When you do "rollingUpgrade rollback", "current" FSImage is replaced by "previous", that's why all hdfs changes are lost. If you want to keep the changes you can use "rollingUpgrade downgrade", it will downgrade only software, keeping hdfs image intact. You can find more details here.

View solution in original post

4 REPLIES 4
Highlighted

Re: What's the difference of -bootstrapstandby and -rollback for NameNode in HDFS rolling upgrade?

  • "rollingUpgarde rollback" on NN1 means that both hdfs software and data in hdfs will be reverted back to the state before starting the rolling upgrade. Any changes to hdfs (files added to or deleted) will be lost. NN1 will become active NN.
  • "bootstrapStandby" on NN2 means that metadata from NN1 will be copied to NN2. After startup NN2 will become Stand by NN.

What happens behind the stage: when you start the rolling upgrade with "rollingUpgrade prepare" a copy of NN metadata (FSImage) is created, called "previous". It consists of hard links to the "current" FSImage. When you do "rollingUpgrade rollback", "current" FSImage is replaced by "previous", that's why all hdfs changes are lost. If you want to keep the changes you can use "rollingUpgrade downgrade", it will downgrade only software, keeping hdfs image intact. You can find more details here.

View solution in original post

Highlighted

Re: What's the difference of -bootstrapstandby and -rollback for NameNode in HDFS rolling upgrade?

Contributor

To explain why you use different commands for the two nodes:

The idea here is that you don't want both nodes to attempt the rollback and risk becoming inconsistent. In a perfect world you could probably do the rollback on both, but the world isn't perfect.

The best way to guarantee consistency is to have one node do the rollback and then rebootstrap the second node to the first (i.e. overwrite node 2's state information with that from the rolled back node 1).

Highlighted

Re: What's the difference of -bootstrapstandby and -rollback for NameNode in HDFS rolling upgrade?

New Contributor

bootstrapStandby means data from name node1 will be maitained in nam node 2 a well and eventually it picksup as main name node

Highlighted

Re: What's the difference of -bootstrapstandby and -rollback for NameNode in HDFS rolling upgrade?

Explorer

Thank you all for the comments.

Don't have an account?
Coming from Hortonworks? Activate your account here