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
3,689 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,770 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

First, change your core-site.xml property as shown below.

<configuration>
   <property>
      <name>fs.defaultFS</name>
      <value>hdfs://localhost:9000</value> 
   </property>
</configuration>

And regarding your warning part, It will not affect your Hadoop configuration. But you can remove this part also. You need to add the HADOOP_OPTS value in the .bashrc file.

export HADOOP_OPTS="$HADOOP_OPTS -Djava.library.path=$HADOOP_HOME/lib/native"

Related Questions In Big Data Hadoop

0 votes
1 answer

Hadoop Mapreduce: Error: Could not find or load main class com.sun.tools.javac.Main

You have to add HADOOP_CLASSPATH environment parameter: expor ...READ MORE

answered Oct 30, 2018 in Big Data Hadoop by Omkar
• 69,220 points
3,656 views
0 votes
1 answer

Hadoop: Error: Could not find or load main class org.apache.hadoop.util.VersionInfo

This seems like a path issue. Add the ...READ MORE

answered Nov 16, 2018 in Big Data Hadoop by Omkar
• 69,220 points
12,710 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
11,035 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
2,544 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
108,868 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,350 points
4,618 views
0 votes
1 answer

Format HDFS Namenode Error: Could not find or load main class ”-Djava.library.path=.home.hadoop.hadoop-3.2.1.lib.native”

Hi@fwood, According to your configuration, you didn't set ...READ MORE

answered Jun 12, 2020 in Big Data Hadoop by MD
• 95,460 points
11,065 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP