Properties for configuring short-circuit local reads on HDFS
To configure short-circuit local reads, you must add various properties to the
hdfs-site.xml
file. Short-circuit local reads must be configured on both
the DataNode and the client.
Property Name |
Property Value |
Description |
---|---|---|
|
true |
Set this to true to enable short-circuit local reads. |
|
/var/lib/hadoop-hdfs/ dn_socket |
The path to the domain socket. Short-circuit reads make use of a UNIX domain socket. This is a special path in the file system that allows the client and the DataNodes to communicate. You will need to set a path to this socket. The DataNode needs to be able to create this path. On the other hand, it should not be possible for any user except the hdfs user or root to create this path. For this reason, paths under /var/run or /var/lib are often used. In the file system that allows the client and the DataNodes to communicate. You will need to set a path to this socket. The DataNode needs to be able to create this path. On the other hand, it should not be possible for any user except the hdfs user or root to create this path. For this reason, paths under /var/run or /var/lib are often used. |
|
false |
This property controls whether or not normal data traffic will be passed
through the UNIX domain socket. It is recommended that you set the value
of this property to Unusual data traffic will be passed through the UNIX domain socket. |
|
false |
Setting this value to |
|
true |
Boolean which enables back-end DataNode-side support for the experimental
|
|
60 |
Timeout (in seconds) for the parallel RPCs made in
This property is deprecated but is still supported for backward compatibility |
|
60000 |
Timeout (in milliseconds) for the parallel RPCs made in
This property replaces
and offers a finer level of granularity. |
|
false |
If this configuration parameter is set, short-circuit local reads will skip checksums. This is normally not recommended, but it may be useful for special setups. You might consider using this if you are doing your own checksumming outside of HDFS. |
|
256 |
The DFSClient maintains a cache of recently opened file descriptors. This parameter controls the size of that cache. Setting this higher will use more file descriptors, but potentially provide better performance on workloads involving many seeks. |
|
300000 |
This controls the minimum amount of time (in milliseconds) file descriptors need to sit in the client cache context before they can be closed for being inactive for too long. |
The XML for these entries:
<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> <property> <name>dfs.client.domain.socket.data.traffic</name> <value>false</value> </property> <property> <name>dfs.client.use.legacy.blockreader.local</name> <value>false</value> </property> <property> <name>dfs.datanode.hdfs-blocks-metadata.enabled</name> <value>true</value> </property> <property> <name>dfs.client.file-block-storage-locations.timeout.millis</name> <value>60000</value> </property> <property> <name>dfs.client.read.shortcircuit.skip.checksum</name> <value>false</value> </property> <property> <name>dfs.client.read.shortcircuit.streams.cache.size</name> <value>256</value> </property> <property> <name>dfs.client.read.shortcircuit.streams.cache.expiry.ms</name> <value>300000</value> </property> </configuration>