码迷,mamicode.com
首页 > 其他好文 > 详细

十:HDFS Short-Circuit Local Reads 短路本地读取

时间:2017-08-30 23:40:47      阅读:1248      评论:0      收藏:0      [点我收藏+]

标签:rem   ica   footer   1.3   user   ntb   reads   org   ref   

    当client请求数据时,datanode会读取数据然后通过TCP协议发送给client.short-circuit绕过了datanode直接读取数据。short-circuit的前提是client和数据在同一个结点上。
    short-circuit需要libhadoop.so,一个本地库。该功能使用unix套接字,client和node通过套接字连接,需要对这个套接字设置一个路径,并且datanode有创建这个路径的权限,一般建在/var/run或者/var/lib。client和datanode通过共享内在/dev/shm交换数据。
    client和datanode都要进行配置;

Example Configuration

Here is an example configuration.

<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>

    

旧式的short-circuit本地读依然被支持,但是配置不一样,要注意其安全性:
<configuration>
  <property>
    <name>dfs.client.read.shortcircuit</name>
    <value>true</value>
  </property>
  <property>
    <name>dfs.client.use.legacy.blockreader.local</name>
    <value>true</value>
  </property>
  <property>
    <name>dfs.datanode.data.dir.perm</name>
    <value>750</value>
  </property>
  <property>
    <name>dfs.block.local-path-access.user</name>
    <value>foo,bar</value>
  </property>
</configuration>








十:HDFS Short-Circuit Local Reads 短路本地读取

标签:rem   ica   footer   1.3   user   ntb   reads   org   ref   

原文地址:http://www.cnblogs.com/skyrim/p/7455604.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!