How to Mount a MapR Cluster Using NFS

NFS Mount

When you mount a MapR cluster directly via NFS, your applications can read and write data directly into the cluster with standard tools, applications, and scripts. MapR enables direct file modification and multiple concurrent reads and writes via POSIX semantics. For example, you can run a MapReduce job that outputs to a CSV file, then import the CSV file directly into SQL via NFS.

MapR exports each cluster as the directory /mapr/cluster name. For example, /mapr/ If you create a mount point with the local path /mapr, then Hadoop FS paths and NFS paths to the cluster will be the same. This makes it easy to work on the same files via NFS and Hadoop. In a multi-cluster setting, the clusters share a single namespace, and you can see them all by mounting the top-level /mapr directory. If you are on a Mac or Linux machine, follow the instructions in the Mounting the Cluster via NFS tutorial. For more information about NFS mount, refer to Accessing Data with NFS.

Mounting the Cluster via NFS

In this tutorial, open a terminal window and mount the MapR cluster via NFS. After you mount the cluster, drag and drop files from your machine into the mapr directory.

Mount the cluster via NFS:

  1. Open a terminal window on the host machine.
  2. Type sudo showmount -e localhost in the terminal to see what exports are available on the local host.
    Example: mapr@ubuntu:~$ sudo showmount -e localhost
  3. Enter mapr as the password.
    [sudo] password for mapr: mapr The export list for localhost appears. Example: Export list for localhost:
    /mapr *
    /mapr/ *
  4. If the mapr directory does not exist, create a new directory named /mapr
  5. Use the following mount command to mount the cluster: mapr@ubuntu:~$ sudo mount –t nfs –o nolock :/mapr /mapr Example: mapr@ubuntu:~$ sudo mount –t nfs –o nolock /mapr
  6. Use the mount command to verify that the mount was successful. Example: mapr@ubuntu:~$ sudo mount The following syntax appears:
    /dev/sda1 on / type ext4 (rw,errors=remount-ro)
    proc on /proc type proc (rw,noexec,nosuid,nodev)
    sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
    none on /sys/fs/fuse/connections type fusectl (rw)
    none on /sys/kernel/debug type debugfs (rw)
    none on /sys/kernel/security type securityfs (rw)
    udev on /dev type devtmpfs (rw,mode=0755)
    devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
    tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
    none on /run/lock type tmpfs
    none on /run/shm type tmpfs (rw,nosuid,nodev)
    rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw)
    localhost:/mapr on /mapr type nfs
  7. Use the file browser to navigate to the mapr directory on your machine. For example, on a Mac operating system, open Finder and open the directory. The directory is the name of the virtual machine IP address. Example:
  8. Select any files from a directory on your machine and drag and drop them into the mapr directory. You can also drag and drop files from the mapr directory to a directory on your machine.
Tutorial Category Reference: