Configuring the MapR FUSE-Based POSIX Client

The POSIX client configuration values can be set in the /opt/mapr/conf/fuse.conf file. Edit the configuration file to define the values for the following parameters and save the file.

To ensure that the service can be started and stopped and to run the help option, set the shared LD_LIBRARY_PATH environment variable. Update the shared library environment variable to include the paths to the following:

  • Full path to the directory containing libjvm.so file
  • $MAPR_HOME/lib (that is, /opt/mapr/lib directory)

For example:

export LD_LIBRARY_PATH=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.79.x86_64/jre/lib/amd64/server/:/opt/mapr/lib
To retrieve the list of configuration parameters, run the following command:
/opt/mapr/bin/posix-client-* --help
Here * refers to basic or platinum client package installed on the system. For more information on the non-mapr configuration parameters, refer to FUSE documentation.
Note: The MapR FUSE-based POSIX clients support only the configuration parameters in the fuse.conf file. All other FUSE configuration parameters are not supported.
Parameter Default Value Description
fuse.mount.point   (Required) Specifies the mount point where MapR-FS must be mounted. Ensure that the specified mount point is empty before starting the service.
Note: If NFS server is also running on this node, ensure that the FUSE mount point is different from the NFS server mount point.
fuse.log.path /opt/mapr/logs Specifies the path where the log files must be stored.
fuse.allow.other 1 Allow other users to access the mountpoint. Value can be:
  • 0 - to not allow other users
  • 1 - to allow other users

Set this to 1 only if the service is started by the root user and set to 0 if the service is started by non-root user. If non-root user starts this service, comment out this parameter.

fuse.big.writes 1 Specifies whether to enable writes larger than 4KB. Value can be:
  • 0 - disable
  • 1 - enable
This sets the amount of data/buffer size that can be transferred from the kernel to the FUSE library per request. If enabled, FUSE will allow writes of 128KB from the kernel. If disabled, FUSE will allow writes of 4KB from the kernel.
fuse.affinity 0 (disabled) Specifies whether to enable (1) or disable (0) NUMA affinity. If enabled, sets the NUMA affinity for the POSIX client.
fuse.auto.unmount 1 (enabled) Specifies whether to automatically unmount the filesystem when the process is terminated. Value can be:
  • 0 - disable
  • 1 - enable
fuse.num.libs
  • Basic - 1
  • Platinum - 5
Specifies the number of client libraries to run with. For:
  • Basic client, value must be 1.
  • Platinum client, default value is 5 and can be set to a value greater than 5.
More than one library allows for more than 1GB/sec throughput on remote operations as each additional library increases the throughput by sharding operations across libraries (for parallelism).
Note: Each additional library will consume more memory and CPU.
fuse.ra.sessions
  • Basic - 1
  • Platinum - 5
Specifies the number of parallel read ahead sessions per library. Each open file acts as one read ahead session. For example, for the default value of 5, up to 5 files can have read ahead sessions per library. If value is set to 0, readahead will be disabled.
Note: A greater value will allow more number of parallel read ahead sessions, which is useful if more number of files need to be opened simultaneously. However, note that each additional read ahead session will consume more memory (512K per read ahead session) and threads.
fuse.num.threads 64 Specifies the number of FUSE threads in userspace per mountpoint. A higher number allows parallel processing of multiple operations. Recommended value is only up to 64.
fuse.asyncdirect.io 1 (enabled) Specifies whether to enable asynchronous direct IO. Value can be:
  • 0 - disable
  • 1 - enable
fuse.max.read 128k Specifies the maximum size of read requests.
fuse.max.readahead 128k Specifies the maximum bytes to readahead.
fuse.max.write 128k Specifies the maximum size allowed in a (single) write request.
fuse.sync.read 0 Specifies whether to enable or disable synchronized reads. Value can be:
  • 0 - disable
  • 1 - enable
fuse.max.background 64 Specifies the maximum number of asynchronous requests that can be submitted. IOs submits beyond the maximum limit (specified here) will be blocked.
fuse.congestion.threshold 10 Specifies the kernel’s congestion threshold.
fuse.flush.inline 0 Specifies whether (1) or not (0) to flush all writes inline. Value can be:
  • 0 - disable inline flushing
  • 1 - flush all writes inline
If disabled, for all open files, by default, the buffer is flushed automatically every 3 seconds or when it reaches 64KB. If enabled, writes are sent to server directly.
fuse.fast.local.directio 0 Specifies whether to optimize or disable FUSE client for local direct IO. Value can be:
  • 0 - disable
  • 1 - optimize
fuse.disable.shardcache 0 Specifies whether to disable shard cache, which is a cache of lookups. Value can be:
  • 0 - false
  • 1 - true
If true, more number of lookup calls will be used. The shardcache is used by the FUSE client to ensure that requests for data related to the same file are served by the same library. This is done using hash to improve performance. In very rare circumstances, it might make sense to disable this cache in conjunction with MapR support.
fuse.fsname   Specifies the filesystem source. The default value is the FUSE mountpoint.
fuse.ticketfile.location /tmp/maprticket_XXX Specifies the ticket to use to start the service in secure mode. Since files in the /tmp directory are deleted after a system reboot, move the ticket file to another location and specify the path to that location here.
Note: To support impersonation, provide the mapr user ticket file location or the user’s servicewithimpersonation ticket file location. The FUSE service must be started by the root user if servicewithimpersonation ticket is specified.
See also: Setting up Ticket for POSIX Client.
fuse.nonempty 0 Specifies whether FUSE can be mounted at a non-empty mountpoint (1) or at an empty mountpoint (0). Value can be:
  • 0 - indicates that mount point should be empty
  • 1 - indicates that mount point need not be empty
fuse.enable.xattr 0 (false) Specifies whether (true) or not (false) to enable extended attributes through the FUSE client. Value can be:
  • 0 - false
  • 1 - true
The default value is 0 (false). This is disabled by default because if enabled, during operations, the kernel might make a lot of extended attribute calls for security checks resulting in performance degradation even when there are no extended attributes on the inode. When disabled, extended attributes can still be added using the maprcli command.
Note: Of the five types of extended attribute namespaces in Linux, system, trusted, user, raw, and security, only user namespace is supported. For all other namespaces, EINVAL is returned.
fuse.attr.timeout 3.0 The timeout value in seconds for file/directory (regular) attributes (such as file size, UID, GID, etc., which are normally stored inside the inode) cache. This is used to determine whether to use the cached attribute information (only if within the specified timeout window) or fetch attribute information again. The default is 3.0 second, which specifies that cached attribute information must be considered stale and refreshed after 3.0 second. For this option, it is possible to give fractions of a second as well (e.g. fuse.attr.timeout=2.8).
fuse.entry.timeout 3.0 The timeout value in seconds for the name lookup cache. This is used to determine whether to use the cached entry for the name lookup (if within the specified timeout window) or lookup name again. The default is 3.0 second, which specifies that cached name lookup information must be considered stale and refreshed after 3.0 second. For this option, it is possible to give fractions of a second as well (e.g. fuse.entry.timeout=2.8).
fuse.client.lib.path /tmp Specifies the path to where the client libraries must be copied.
fuse.enforce.core.pattern false Specifies whether (true) or not (false) to write to /proc/sys/kernel/core_pattern file when the FUSE-based POSIX starts. The default value is false. If true, the core_pattern file will contain an /opt/cores/%e.core.%p.%h entry and if false, the file will not be touched.

You must start/restart the FUSE-based POSIX client for the changes to take effect. See Starting and Stopping the POSIX Client for more information.

Verifying MapR POSIX Client Licenses

You can check how many MapR POSIX Client licenses are available by clicking on System Settings > Manage Licenses in the navigation pane of the MCS. When the License Management dialog box displays, look under Additional Features to find the number of POSIX Client nodes that can consume a MapR POSIX Client license.

Mounting the MapR-FS

To mount MapR-FS at the mount point specified in the /opt/mapr/conf/fuse.conf file, create the mountpoint specified in the fuse.conf file and start the service. For example:

mkdir /mapr
service mapr-posix-client-* start
Note: When you run the command, replace * with basic or platinum, which corresponds with the package that is installed on the system.
Enabling Soft Mount and Setting the Timeout

By default, all MapR-FS, MapR-DB, and MapR-Streams operations never timeout as they wait (hard mount behavior) for the operation to succeed and/or the server to respond. You can configure a soft mount behavior by setting the values for the following parameters in the core-site.xml or hbase-site.xml file:

fs.mapr.hardmount
Specifies whether or not to enable hard mount. Value can be:
  • true - enable hard mount
  • false - disable hard mount
The default value is true.
fs.mapr.rpc.timeout
Specifies the RPC timeout value in seconds. The default value is 300 seconds. The value cannot be less than 30 seconds. If the value is greater than 300 seconds, TCP keepalive probes are sent to prevent the TCP socket from timing out. If value is below 300 seconds, the RPCs will timeout after the specified time.

These parameter settings affect all clients.

Note: For MapR-Streams, these parameters can be set as configuration properties when constructing the Consumer or Producer Java object. For more information, see MapR-Streams.

To configure the soft mount behavior, open the core-site.xml or hbase-site.xml file, add the parameters as shown below, and save and close the file.

Enable Soft Mount
<property>
   <name>fs.mapr.hardmount</name>
   <value>false</value>
   <description>enabling soft mount by setting value to false</description>
 </property>
Specify RPC Timeout
<property>
   <name>fs.mapr.rpc.timeout</name>
   <value>30</value>
   <description>RPC timeout value</description>
</property>

Registering POSIX Client with Additional Clusters

To register the POSIX client with additional clusters, you must add entries directly to the /opt/mapr/conf/mapr-clusters.conf file. The clusters will be visible after few minutes.

Note: Each client supports up to 16 clusters.

Setting the Log Level

The log level can be set in the /opt/mapr/hadoop/hadoop-0.20.2/conf/core-site.xml file. By default, it is set to ERROR. If you want to change the log level to another (such as FATAL, DEBUG, WARN, ERROR, CRITICAL, or OFF), open the file, add the following, and save the file:

<configuration>
   <property>
      <name>fs.mapr.trace</name>
      <value>DEBUG | INFO | WARN | ERROR | CRITICAL | FATAL | OFF</value>
   </property>
</configuration>
Note: See core-site.xml for more information.

Configuring the Chunk Size

By default, sharding takes effect only if chunk size is >0 and <=2MB. To increase the upper limit (up to 256MB) on the chunk size, set the value (in bytes) for the fs.mapr.fuseshard.chunksize configuration field in the core-site.xml file. For example:

<property>
   <name>fs.mapr.fuseshard.chunksize</name>
   <value>2097152</value>
   <description>setting chunk size</description>
</property>
Definining File/Directory Compression and Chunk Size
Each directory in MapR storage contains a hidden file called .dfs_attributes that controls compression and chunk size. To change these attributes, change the corresponding values in the file. For more information, see .dfs_attributes.