3

We have a cluster (Apache Phoenix as co-processor) of 6 data nodes co-located with HBase Region servers. We have set all the options to enable:

  <property>
    <name>dfs.client.read.shortcircuit</name>
    <value>true</value>
  </property>
  <property>
    <name>dfs.client.read.shortcircuit.buffer.size</name>
    <value>131072</value>
  </property>
  <property>
    <name>dfs.domain.socket.path</name>
    <value>/var/run/hadoop-hdfs/dn._PORT</value>
  </property>

*I tried to remove socket path and RS failed with error, so it tries to use shortcircuit.

Meanwhile in hdfs datanode logs I can see:

2018-07-31 09:20:30,539 INFO org.apache.hadoop.hdfs.server.datanode.DataNode.clienttrace: src: 127.0.0.1, dest: 127.0.0.1, op: REQUEST_SHORT_CIRCUIT_FDS, blockid: 1077953652, srvID: d67ca494-8813-4117-9009-9c34054eb4c3, success: true
2018-07-31 09:20:30,560 INFO org.apache.hadoop.hdfs.server.datanode.DataNode.clienttrace: src: 127.0.0.1, dest: 127.0.0.1, op: REQUEST_SHORT_CIRCUIT_FDS, blockid: 1077953658, srvID: d67ca494-8813-4117-9009-9c34054eb4c3, success: true
2018-07-31 09:20:30,567 INFO org.apache.hadoop.hdfs.server.datanode.DataNode.clienttrace: src: 127.0.0.1, dest: 127.0.0.1, op: REQUEST_SHORT_CIRCUIT_FDS, blockid: 1077954458, srvID: d67ca494-8813-4117-9009-9c34054eb4c3, success: true
2018-07-31 09:20:30,930 INFO org.apache.hadoop.hdfs.server.datanode.DataNode.clienttrace: src: 127.0.0.1, dest: 127.0.0.1, op: RELEASE_SHORT_CIRCUIT_FDS, shmId: 72430b904199e87f54f9b59eca2d3e0d, slotIdx: 13, srvID: d67ca494-8813-4117-9009-9c34054eb4c3, success: true
2018-07-31 09:20:30,934 INFO org.apache.hadoop.hdfs.server.datanode.DataNode.clienttrace: src: 127.0.0.1, dest: 127.0.0.1, op: RELEASE_SHORT_CIRCUIT_FDS, shmId: 72430b904199e87f54f9b59eca2d3e0d, slotIdx: 15, srvID: d67ca494-8813-4117-9009-9c34054eb4c3, success: true
2018-07-31 09:20:30,935 INFO org.apache.hadoop.hdfs.server.datanode.DataNode.clienttrace: src: 127.0.0.1, dest: 127.0.0.1, op: RELEASE_SHORT_CIRCUIT_FDS, shmId: 72430b904199e87f54f9b59eca2d3e0d, slotIdx: 16, srvID: d67ca494-8813-4117-9009-9c34054eb4c3, success: true

But HBase reports zero locality for all Region servers, even after the major_compaction: Regions/data size/locality

Can someone help ?

1 Answers1

0

You can check block allocation by browsing Namenode UI's browse file system utility. Go to the hbase file location and under region name ,you'll find block location. If blocks are replicated on same region server but still your locality is 0, it could be because of different hostnames with which region server nodes and data nodes are registered with HMaster and Namenode respectively. You can check region server names on Hbase master UI under Region Servers, Similarly check datanode names in namenode UI.

If hostnames are different at both the places, that could be the reason of locality 0. HRegionServer on startup does revers DNS lookup from master , Adding ip to host mapping in /etc/hosts of master and region servers should fix this.. Note: you would have to restart region server after adding entries in /etc/hosts