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 in Big Data Hadoop by anonymous
• 140 points
180 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 by MD
• 57,800 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 by Gitika
• 37,700 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,030 points
1,192 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,030 points
6,271 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
• 10,950 points
5,911 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
• 10,950 points
892 views
+1 vote
11 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyF ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
37,430 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,320 points
2,209 views
0 votes
1 answer
0 votes
3 answers