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
787 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
2 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
12,439 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,030 points
1,146 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 in Big Data Hadoop by MD
• 80,590 points
196 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
6,396 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
991 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
42,246 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,388 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
554 views