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/my.cluster.com. 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:
- Open a terminal window on the host machine.
sudo showmount -e localhostin the terminal to see what exports are available on the local host.
mapr@ubuntu:~$ sudo showmount -e localhost
- Enter mapr as the password.
[sudo] password for mapr: maprThe export list for localhost appears. Example:
Export list for localhost:
- If the mapr directory does not exist, create a new directory named
- Use the following mount command to mount the cluster:
mapr@ubuntu:~$ sudo mount –t nfs –o nolockExample:
mapr@ubuntu:~$ sudo mount –t nfs –o nolock 192.168.217.196:/mapr /mapr
- Use the mount command to verify that the mount was successful.
mapr@ubuntu:~$ sudo mountThe 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 (rw,noexec,nosuid,nodev,size=5242880) 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 (rw,soft,intr,nolock,addr=127.0.0.1)
- 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: 192.168.217.196
- 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.