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,300 points
1,112 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 22, 2018 by Frankie
• 9,810 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
15,774 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,110 points
1,382 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 7, 2020 in Big Data Hadoop by MD
• 95,140 points
294 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
7,085 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
1,138 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
51,132 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,390 points
2,679 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,810 points
767 views