Hadoop study notes - how to reformat hadoop hdfs

1 stop all the hbase or hadoop deamon
$stop-all.sh

2 check the physical file system location
Hdfs-site.xml
<property>
  <name>dfs.name.dir</name>
  <value>${hadoop.tmp.dir}/dfs/name</value>
</property>
<property>
  <name>dfs.data.dir</name>
  <value>${hadoop.tmp.dir}/dfs/data</value>
</property>
<property>
  <name>mapred.local.dir</name>
  <value>${hadoop.tmp.dir}/mapred/local</value>
</property>
<property>
  <name>mapred.system.dir</name>
  <value>${hadoop.tmp.dir}/mapred/system</value>
</property>
<property>
  <name>mapreduce.jobtracker.staging.root.dir</name>
  <value>${hadoop.tmp.dir}/mapred/staging</value>
</property>
<property>
  <name>mapred.temp.dir</name>
  <value>${hadoop.tmp.dir}/mapred/temp</value>
</property>
3 then rm -rf all the file system listed

4 start hadoop format the namenode

$start-all.sh
$hadoop namenode -format

5 restart haoop
$stop-all.sh
$start-all.sh

6 check the hdfs sytem
$hadoop dfsadmin -report
$hadoop fsck /

Qestion:
in setp 4, maybe we don't need to start namenode in order to format it.
Next time, study further

你可能感兴趣的:(hadoop)