NameNode Multi-directory configuration

Add the following content to the HDFS -site. XML file (the data in the two directory structures is the same)

<property>
    <name>dfs.namenode.name.dir</name>
    <value>file://${hadoop.tmp.dir}/dfs/name1,file://${hadoop.tmp.dir}/dfs/name2</value>
</property>
Copy the code

DataNode multi-directory configuration

Add the following content to the HDFS -site. XML file (the data in the two directory structures is different)

<property>
    <name>dfs.datanode.data.dir</name>
    <value>file://${hadoop.tmp.dir}/dfs/data1,file://${hadoop.tmp.
dir}/dfs/data2</value>
</property>
Copy the code