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 23, 2018 in Big Data Hadoop by Neha
• 6,300 points
2,595 views

1 answer to this question.

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 23, 2018 by Frankie
• 9,830 points

Related Questions In Big Data Hadoop

+1 vote
3 answers

What is the best way to merge multi-part HDFS files into single file?

1. In order to merge two or ...READ MORE

answered Jul 29, 2019 in Big Data Hadoop by Tina
30,934 views
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
• 69,220 points
4,024 views
0 votes
1 answer

I have to ingest in hadoop cluster large number of files for testing , what is the best way to do it?

Hi@sonali, It depends on what kind of testing ...READ MORE

answered Jul 8, 2020 in Big Data Hadoop by MD
• 95,460 points
1,205 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,015 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,528 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,740 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,605 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,830 points
2,478 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