hdfs 配制HA,只能访问到本地文件系统,为什么访问不到hdfs系统?

新手上路,请多包涵

1.在bin/hdfs dfs 下执行命令访问到的是本地文件系统,正常来讲应该是hdfs文件系统
2.HA配置文件
<?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 at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed 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 and
limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->

<configuration>

  <property>
  <name>dfs.nameservices</name>
  <value>ns1</value>
</property>

<property>
  <name>dfs.ha.namenodes.ns1</name>
  <value>nn1,nn2</value>
</property>
    
<property>
  <name>dfs.namenode.rpc-address.ns1.nn1</name>
  <value>localhostlei1:8020</value>
</property>
<property>
  <name>dfs.namenode.rpc-address.ns1.nn2</name>
  <value>localhostlei2:8020</value>
</property>
    
<property>
  <name>dfs.namenode.http-address.ns1.nn1</name>
  <value>localhostlei1:50070</value>
</property>
<property>
  <name>dfs.namenode.http-address.ns1.nn2</name>
  <value>localhostlei2:50070</value>
</property>

 <property>
  <name>dfs.namenode.shared.edits.dir</name>
  <value>qjournal://localhostlei1:8485;localhostlei2:8485;localhostlei3:8485/ns1</value>
 </property>
 
<property>
  <name>dfs.journalnode.edits.dir</name>
  <value>/path/to/journal/node/local/data</value>
</property>

<property>
 <name>dfs.client.failover.proxy.provider.ns1</name>
 <value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
</property>

<property>
<name>dfs.ha.fencing.methods</name>
<value>sshfence</value>

</property>

<property>

  <name>dfs.ha.fencing.ssh.private-key-files</name>
  <value>/home/lei/.ssh/id_rsa</value>
</property>

<property>
  <name>fs.defaultFS</name>
  <value>hdfs://ns1</value>
</property>

<property>

  <name>dfs.permissions</name>
  <value>false</value>

</property>
</configuration>

阅读 3.2k
1 个回答
新手上路,请多包涵

这个配置应该在core-site.xml文件中
<property>
<name>fs.defaultFS</name>
<value>hdfs://ns1</value>
</property>

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题