What is the standard way to create files in your hdfs file-system?

0 votes

I learned that I have to configure the NameNode and DataNode dir in hdfs-site.xml.

So that's my hdfs-site.xml configuration on the NameNode:

<configuration>
 <property>
    <name>dfs.replication</name> 
    <value>3</value>
  </property>

 <property>
    <name>dfs.namenode.name.dir</name> 
    <value>file://usr/local/hadoop-2.6.0/hadoop_data/hdfs/namenode</value>
  </property>

 <property>
    <name>dfs.block.size</name> 
    <value>134217728</value>
  </property>
</configuration>

I did almost the same on my DataNode and changed dfs.namenode to dfs.datanode.

Then I formatted the filesystem via

hadoop namenode -format

Everything seems to be finished without an error. Then I wanted to create a directory in my HDFS filesystem by using:

hdfs dfs -mkdir test

And I got an error:

mkdir: `test': No such file or directory

What did I miss or what's the common process from formatting to creating files/directories with HDFS?

Sep 22, 2018 in Big Data Hadoop by Neha
• 6,180 points
51 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Well, it's so easy.

Just enter the below mentioned commands:

hdfs dfs -mkdir /test

Then,
hdfs dfs -put myFile /test/myFile
answered Sep 22, 2018 by Frankie
• 9,710 points

Related Questions In Big Data Hadoop

0 votes
5 answers
0 votes
1 answer

What is the command to count number of lines in a file in hdfs?

hadoop fs -cat /example2/doc1 | wc -l READ MORE

answered Nov 22, 2018 in Big Data Hadoop by Omkar
• 66,880 points
155 views
0 votes
1 answer
0 votes
1 answer

What is the command to navigate in HDFS?

First of all there is no command ...READ MORE

answered Apr 27, 2018 in Big Data Hadoop by Shubham
• 12,790 points
308 views
0 votes
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
• 9,350 points
1,825 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
• 9,350 points
152 views
0 votes
10 answers

hadoop fs -put command?

copy command can be used to copy files ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Sujay
9,031 views
0 votes
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,260 points
647 views
0 votes
1 answer

What is the difference between local file system commands touch and touchz?

Actually they both do the same except touchz is ...READ MORE

answered Aug 14, 2018 in Big Data Hadoop by Frankie
• 9,710 points
96 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.