Husky or C++ API

hdfs-site.xml added:

1 <property>
2   <name>dfs.client.read.shortcircuit</name>
3   <value>true</value>
4 </property>
5 <property>
6   <name>dfs.domain.socket.path</name>
7     <value>/var/lib/hadoop-hdfs/dn_socket</value>
8 </property>

C++运行程序主目录

hdfs.client.xml

配置

<configuration>
  <property>
  <name>dfs.client.read.shortcircuit</name>
  <value>true</value>
  </property>
   <property>
     <name>dfs.domain.socket.path</name>
     <value>/var/lib/hadoop-hdfs/dn_socket</value>
   </property>
</configuration>

参考:

https://hadoop.apache.org/docs/r2.6.0/hadoop-project-dist/hadoop-hdfs/HdfsUserGuide.html

https://hadoop.apache.org/docs/r2.6.0/hadoop-project-dist/hadoop-hdfs/ShortCircuitLocalReads.html

原文地址:https://www.cnblogs.com/loadofleaf/p/5694717.html