Application Connections to the Cluster

The MapR client handles client application requests to connect to the cluster from an edge node. An edge node is a machine that is not part of the cluster.

Why do I need the MapR Client?

Once you install the MapR client on an edge node, the edge node can run applications that require access to the cluster. In general, the MapR client includes the libraries and utilites required on an edge node to perform the following: build an application, connect to the cluster, submit MapReduce jobs, submit YARN applications, run hadoop fs commands, and run hadoop mfs commands.

For information about installing the MapR client, see MapR Client

How the MapR Client Establishes Connections to the Cluster

Client applications connect to a cluster via CLDB nodes, which are listed in the connection request or in the mapr-clusters.conf file on the node that submits the connection request. When a client application attempts to connnect to the cluster for the first time, the following scenarios can occur:

  • At least one of the CLDB nodes is online, in which case the connection is successful.
  • None of the CLDB nodes are online, in which case the connection attempt fails.
  • The CLBD nodes are listed incorrectly (e.g. the IP addresses are incorrect), in which case the connection attempt fails.
When a connection attempt fails, the MapR client returns one of the following errors based on the application type:
Application Type Error
C Application using HBase API ErrorCode = 1.
C Applications using HDFS API NULL handle
Java Application using HBase, OJAI, or MapR-FS API java.io.IOException: Could not create FileClient
Java Application using Kafka API for MapR Streams org.apache.kafka.common.errors.NetworkException.

How the MapR Client Re-establishes Failed Connections to the Cluster

If the CLDB goes down after a client application establishes its first connection to MapR, the MapR client's behavior depends on the setting for the fs.mapr.hardmount property in the core-site.xml file in the client installation directory.

  • If fs.mapr.hardmount is set to true, the MapR client hangs as it continuously attempts to reconnect to the CLDB. The MapR client stops hanging when the CLDB is brought back online.
  • If fs.mapr.hardmount is set to false, the MapR client attempts to connect to each CLDB node that is listed in the mapr-clusters.conf file on the node that submitted the connection request. If all of the CLDB nodes are down, the MapR client returns the error EAGAIN/-EAGAIN to the client application. This error indicates that a connection could not be established because the CLDB nodes were not available or because the request timed out due to reasons, such as heavy traffic caused the network to be slow or other nodes were unavailable.