解決方案
修改hdfs-site.xml?文件?
?
原xml文件
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License. See accompanying LICENSE file.
--><!-- Put site-specific property overrides in this file. -->
<configuration><!-- NameNode存儲元數據信息的路徑,實際工作中,一般先確定磁盤的掛載目錄,然后多個目錄用,進行分割 --> <!-- 集群動態上下線 <property><name>dfs.hosts</name><value>/kkb/install/hadoop-2.6.0-cdh5.14.2/etc/hadoop/accept_host</value></property><property><name>dfs.hosts.exclude</name><value>/kkb/install/hadoop-2.6.0-cdh5.14.2/etc/hadoop/deny_host</value></property>--><property><name>dfs.namenode.secondary.http-address</name><value>node01:50090</value></property><property><name>dfs.namenode.http-address</name><value>node01:50070</value></property><property><name>dfs.namenode.name.dir</name><value>file:///kkb/install/hadoop-2.6.0-cdh5.14.2/hadoopDatas/namenodeDatas</value></property><!-- 定義dataNode數據存儲的節點位置,實際工作中,一般先確定磁盤的掛載目錄,然后多個目錄用,進行分割 --><property><name>dfs.datanode.data.dir</name><value>file:///kkb/install/hadoop-2.6.0-cdh5.14.2/hadoopDatas/datanodeDatas</value></property><property><name>dfs.namenode.edits.dir</name><value>file:///kkb/install/hadoop-2.6.0-cdh5.14.2/hadoopDatas/dfs/nn/edits</value></property><property><name>dfs.namenode.checkpoint.dir</name><value>file:///kkb/install/hadoop-2.6.0-cdh5.14.2/hadoopDatas/dfs/snn/name</value></property><property><name>dfs.namenode.checkpoint.edits.dir</name><value>file:///kkb/install/hadoop-2.6.0-cdh5.14.2/hadoopDatas/dfs/nn/snn/edits</value></property><property><name>dfs.replication</name><value>3</value></property><property><name>dfs.permissions</name><value>false</value></property><property><name>dfs.blocksize</name><value>134217728</value></property><!--hdfs web端ui取消ip限制--><property><name>dfs.namenode.http-address</name><value>0.0.0.0:50070</value></property>
</configuration>
修改部分:
修改為:
掛載磁盤目錄:
修改路徑權限命令:
##給某個路徑賦權 給hadoop用戶
sudo chown hadoop:hadoop /home
路徑:
/home/hadoop/hadoop-2.6.0-cdh5.14.2/hadoopDatas/datanodeDatas
?
重啟集群
?
?
?