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,280 points
95 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

0 votes
1 answer
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
• 67,380 points
291 views
0 votes
1 answer
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
• 10,670 points
2,657 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,670 points
275 views
0 votes
10 answers

hadoop fs -put command?

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

answered Dec 7, 2018 in Big Data Hadoop by Aditya
13,230 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,240 points
972 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
172 views