Hadoop配置多个HDFS入口
为了验证存在不同的hdfs之间的hive的互操作(归根结底还是为了解决BUG)
需要在两个不同的hadoop集群的HDFS 能够在Hiveserver2上进行路由转发绕过一些坑。
就需要将某hdfs集群的配置文件改改。。
例如hdfs-site.xml
EG:
<?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>sfbd,sfbdp1,oldsfbdp1,oldsfbd</value> <!--namespace用逗号隔开。。下面是每个namespace的参数,一定要dfs.client.failover.proxy.provider.sfbd不能少,,否则解析不到。-->
</property>
<!-- sfbd -->
<property>
<name>dfs.ha.namenodes.sfbd</name>
<value>nn1,nn2</value>
</property>
<property>
<name>dfs.namenode.rpc-address.sfbd.nn1</name>
<value>CNSZ17PL1782:8020</value>
</property>
<property>
<name>dfs.namenode.rpc-address.sfbd.nn2</name>
<value>CNSZ17PL1783:8020</value>
</property>
<property>
<name>dfs.namenode.http-address.sfbd.nn1</name>
<value>CNSZ17PL1782:50070</value>
</property>
<property>
<name>dfs.namenode.http-address.sfbd.nn2</name>
<value>CNSZ17PL1783:50070</value>
</property>
<property>
<name>dfs.client.failover.proxy.provider.sfbd</name>
<value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
</property>
<property>
<name>dfs.namenode.shared.edits.dir.sfbd</name>
<value>qjournal://CNSZ17PL1786:8485;CNSZ17PL1787:8485;CNSZ17PL1788:8485;CNSZ17PL1789:8485;CNSZ17PL1790:8485/sfbd</value>
</property>
<!-- sfbdp1 -->
<property>
<name>dfs.ha.namenodes.sfbdp1</name>
<value>nn1,nn2</value>
</property>
<property>
<name>dfs.namenode.rpc-address.sfbdp1.nn1</name>
<value>CNSZ17PL1784:8020</value>
</property>
<property>
<name>dfs.namenode.rpc-address.sfbdp1.nn2</name>
<value>CNSZ17PL1785:8020</value>
</property>
<property>
<name>dfs.namenode.http-address.sfbdp1.nn1</name>
<value>CNSZ17PL1784:50070</value>
</property>
<property>
<name>dfs.namenode.http-address.sfbdp1.nn2</name>
<value>CNSZ17PL1785:50070</value>
</property>
<property>
<name>dfs.client.failover.proxy.provider.sfbdp1</name>
<value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
</property>
<property>
<name>dfs.namenode.shared.edits.dir.sfbdp1</name>
<value>qjournal://CNSZ17PL1786:8485;CNSZ17PL1787:8485;CNSZ17PL1788:8485;CNSZ17PL1789:8485;CNSZ17PL1790:8485/sfbdp1</value>
</property>
<!-- Two nameservices config end -->
<!-- old sfbdp1 start -->
<property>
<name>dfs.client.failover.proxy.provider.oldsfbdp1</name>
<value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
</property>
<property>
<name>dfs.ha.namenodes.oldsfbdp1</name>
<value>namenode313,namenode411</value>
</property>
<property>
<name>dfs.namenode.rpc-address.oldsfbdp1.namenode313</name>
<value>cnsz17pl1206:8020</value>
</property>
<property>
<name>dfs.namenode.http-address.oldsfbdp1.namenode313</name>
<value>cnsz17pl1206:50070</value>
</property>
<property>
<name>dfs.namenode.rpc-address.oldsfbdp1.namenode411</name>
<value>cnsz17pl1207:8020</value>
</property>
<property>
<name>dfs.namenode.http-address.oldsfbdp1.namenode411</name>
<value>cnsz17pl1207:50070</value>
</property>
<!-- old sfbdp1 end -->
<!-- old sfbd start -->
<property>
<name>dfs.ha.namenodes.oldsfbd</name>
<value>nn1,nn2</value>
</property>
<!--NameNode1 的地址-->
<property>
<name>dfs.namenode.rpc-address.oldsfbd.nn1</name>
<value>cnsz23pl0090:8020</value>
</property>
<!--NameNode2 的地址-->
<property>
<name>dfs.namenode.rpc-address.oldsfbd.nn2</name>
<value>cnsz23pl0091:8020</value>
</property>
<property>
<name>dfs.namenode.http-address.oldsfbd.nn1</name>
<value>cnsz23pl0090:50070</value>
</property>
<property>
<name>dfs.namenode.http-address.oldsfbd.nn2</name>
<value>cnsz23pl0091:50070</value>
</property>
<property>
<name>dfs.client.failover.proxy.provider.oldsfbd</name>
<value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
</property>
<!-- old sfbd end -->
<property>
<name>dfs.namenode.name.dir</name>
<value>file:///data/dfs/nn/local</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>/HDATA/12/dfs/local,/HDATA/11/dfs/local,/HDATA/10/dfs/local,/HDATA/9/dfs/local,/HDATA/8/dfs/local,/HDATA/7/dfs/local,/HDATA/6/dfs/local,/HDATA/5/dfs/local,/HDATA/4/dfs/local,/HDATA/3/dfs/local,/HDATA/2/dfs/local,/HDATA/1/dfs/local</value>
</property>
<property>
<name>dfs.journalnode.edits.dir</name>
<value>/data/dfs/jn</value>
</property>
<property>
<name>dfs.qjournal.start-segment.timeout.ms</name>
<value>60000</value>
</property>
<property>
<name>dfs.qjournal.prepare-recovery.timeout.ms</name>
<value>240000</value>
</property>
<property>
<name>dfs.qjournal.accept-recovery.timeout.ms</name>
<value>240000</value>
</property>
<property>
<name>dfs.qjournal.finalize-segment.timeout.ms</name>
<value>240000</value>
</property>
<property>
<name>dfs.qjournal.select-input-streams.timeout.ms</name>
<value>60000</value>
</property>
<property>
<name>dfs.qjournal.get-journal-state.timeout.ms</name>
<value>240000</value>
</property>
<property>
<name>dfs.qjournal.new-epoch.timeout.ms</name>
<value>240000</value>
</property>
<property>
<name>dfs.qjournal.write-txns.timeout.ms</name>
<value>60000</value>
</property>
<property>
<name>dfs.namenode.acls.enabled</name>
<value>true</value>
<description>Number of replication for each chunk.</description>
</property>
<!--需要根据实际配置进行修改-->
<property>
<name>dfs.ha.fencing.methods</name>
<value>sshfence</value>
</property>
<property>
<name>dfs.ha.fencing.ssh.private-key-files</name>
<value>/home/hdfs/.ssh/id_rsa</value>
</property>
<property>
<name>dfs.ha.automatic-failover.enabled</name>
<value>true</value>
</property>
<property>
<name>dfs.permissions.superusergroup</name>
<value>hadoop</value>
</property>
<property>
<name>dfs.datanode.max.transfer.threads</name>
<value>8192</value>
</property>
<property>
<name>dfs.hosts.exclude</name>
<value>/app/hadoop-conf/exclude.list</value>
<description> List of nodes to decommission </description>
</property>
<property>
<name>dfs.datanode.fsdataset.volume.choosing.policy</name>
<value>org.apache.hadoop.hdfs.server.datanode.fsdataset.AvailableSpaceVolumeChoosingPolicy</value>
</property>
<property>
<name>dfs.datanode.available-space-volume-choosing-policy.balanced-space-threshold</name>
<value>10737418240</value>
</property>
<property>
<name>dfs.datanode.available-space-volume-choosing-policy.balanced-space-preference-fraction</name>
<value>0.75</value>
</property>
<property>
<name>dfs.client.read.shortcircuit.streams.cache.size</name>
<value>1000</value>
</property>
<property>
<name>dfs.client.read.shortcircuit.streams.cache.expiry.ms</name>
<value>10000</value>
</property>
<property>
<name>dfs.client.read.shortcircuit</name>
<value>true</value>
</property>
<property>
<name>dfs.domain.socket.path</name>
<value>/app/var/run/hadoop-hdfs/dn._PORT</value>
</property>
<property>
<name>dfs.client.read.shortcircuit.skip.checksum</name>
<value>false</value>
</property>
<property>
<name>dfs.block.size</name>
<value>134217728</value>
</property>
<property>
<name>dfs.replication</name>
<value>3</value>
</property>
<property>
<name>dfs.namenode.handler.count</name>
<value>300</value>
</property>
<property>
<name>dfs.datanode.handler.count</name>
<value>40</value>
</property>
<property>
<name>dfs.webhdfs.enabled</name>
<value>true</value>
</property>
<property>
<name>dfs.namenode.datanode.registration.ip-hostname-check</name>
<value>false</value>
</property>
</configuration>