0

Once I install Hadoop and type hdfs namenode –format or hadoop namenode -format in cmd for the 1st time, Am getting below error, can anyone help me in solving this.

1st it is asking me this:

Re-format filesystem in Storage Directory root= C:\hadoop-3.2.1\data\namenode; location= null ? (Y or N)

No matter what I give i.e., Y or N, am getting the below error.

ERROR namenode.NameNode: Failed to start namenode

ERROR namenode.NameNode: Failed to start namenode. java.lang.UnsupportedOperationException INFO util.ExitUtil: Exiting with status 1: java.lang.UnsupportedOperationException

Quick answer is much appreciated

Regards ShaX

ShaX
  • 1
  • 2

1 Answers1

-1

This is a bug in 3.2.1 release and is supposed to fixed in 3.2.2 or 3.3.0. The fix is to change the StorageDirectory class by adding FileUtil for Windows permission setup:

if (permission != null) {
      try {
          Set<PosixFilePermission> permissions =
              PosixFilePermissions.fromString(permission.toString());
          Files.setPosixFilePermissions(curDir.toPath(), permissions);
        } catch (UnsupportedOperationException uoe) {
          // Default to FileUtil for non posix file systems
          FileUtil.setPermission(curDir, permission);
        }
  }

I found this issue when publishing a Hadoop 3.2.1 installation guide on Windows: Latest Hadoop 3.2.1 Installation on Windows 10 Step by Step Guide

I published a temporary resolution and it is working. Refer to my above post for details and you can follow it to complete Hadoop 3.2.1 installation on Windows 10. I've uploaded my updated Hadoop HDFS jar file to the following location:

https://github.com/FahaoTang/big-data/blob/master/hadoop-hdfs-3.2.1.jar