While typing hdfs fs -mkdir prem command I m getting below error Could not find or load main class fs and caused by java lang ClassNotFoundException fs

0 votes
Error: Could not find or load main class fs

Caused by: java.lang.ClassNotFoundException: fs
Aug 7, 2020 in Big Data Hadoop by anonymous
• 140 points
5,342 views

2 answers to this question.

+1 vote

Hi,

I think fs command comes under Hadoop, not HDFS. So instead of using hdfs fs command, you can use hadoop fs. You need to change your command as shown below.

You can either run

$ hdfs dfs -mkdir
or
$ hadoop fs -mkdir
answered Aug 7, 2020 by MD
• 95,460 points
While using Hadoop I'm getting util.nativecodeloaderror..
You(edureka) gave solution use hdfs instead..
That's I'm using hdfs then I'm getting this error..

It still not solved can you give me another solution..

@Premkumar,

What happens if you execute: hadoop version ?

Getting warning like
util.Nativecodeloader: Unable to load native-hadoop library for your platform.... using builtin- java classes where applicable

@Premkumar,

There may be two possibilities:

  1. You have installed the wrong Java JDK8 package. Please ensure to download the 64-bit JDK8 and remove your current 32-bit JDK8.
  2. It's a warning due to the Hadoop libraries being compiled for 32bits. You are probably running on a 64bit OS.

It's safe to ignore this warning.

@Premkumar,

Make sure you have these two lines in your .bashrc file:

export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib
+1 vote

Hi, @premkumar,

ideally, you should be using hdfs dfs instead, You can use this

Usage:

hdfs dfs -mkdir [hdfs location]
answered Aug 7, 2020 by Gitika
• 65,730 points
I'm getting warning like
fs.FileSysytem: "hdfs:localhost:9000" is deprecated filesystem name. Use "hdfs://:localhost:9000/" instead.
 
Can you please explain this warning...

Hey, @premkumar,

Could you mention the steps you followed to install Hadoop?

https://youtu.be/g7Qpnmi0Q-s
I just followed this video from edureka only...

Hi@Premkumar,

Can you please paste your core-site.xml file entry?

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
    <property>
        <name>fs.defaultFS</name>
        <value>hdfs:localhost:9000</value>
    </property>
</configuration>

I changed to
hdfs://hdfs:localhost:9000/

then I'm getting
Incomplete HDFS URI, no host: hdfs://hdfs:localhost:9000

but here is common warning everytime
util.Nativecodeloader: Unable to load native-hadoop library for your platform.... using builtin- java classes where applicable