LAB: NFS                                                                    July 2012



LAB: NFS
Goal
In these exercises you will transfer data to and from your cluster via two separate
methods to understand the differences between each of these processes.

Exercise: hadoopfs
       Connect to your node via ssh
       Create a text file in the pwd of your local filesystem
           o touch test.txt
       List the contents of your local pwd
           o ls
       List the contents of your volume on the cluster
           o hadoopfs -ls /<your_volume>
       Create a directory within your volume on the cluster
           o hadoopfs -mkdir /<your_volume>/<some_dir>
       Copy the local text file you created in the previous step to the directory
       within your volume on the cluster
           o hadoopfs -put test.txt /<your_volume>/<some_dir>
       List the contents of the directory within your volume on the cluster to verify
       that the copy was successful
           o hadoopfs –ls /<your_volume>/<some_dir>

Exercise: Mount the Cluster to Itself and Copy a File
       Connect to your node via ssh
       List the NFS shares currently exported on the node
           sudoshowmount -e <your_node_hostname>
       Set up a mount point for the NFS share
           sudomkdir /<cluster_mount_point>
       Mount the cluster via NFS
           sudo mount –o
           nolock<your_node_hostname>:/<cluster_mount_point>
       Copy a file from your local node filesystem to the cluster
           sudocp
           /tmp/test.txt/<cluster_mount_point>/<cluster_name>/<
           your_volume>/<some_dir>/
       Verify that the file is now in the cluster with hadoopfs
           hadoopfs -ls /<your_volume>/<some_dir>




© 2012 by MapR Technologies                                                Page 1 of 1

53 lab-nfs

  • 1.
    LAB: NFS July 2012 LAB: NFS Goal In these exercises you will transfer data to and from your cluster via two separate methods to understand the differences between each of these processes. Exercise: hadoopfs Connect to your node via ssh Create a text file in the pwd of your local filesystem o touch test.txt List the contents of your local pwd o ls List the contents of your volume on the cluster o hadoopfs -ls /<your_volume> Create a directory within your volume on the cluster o hadoopfs -mkdir /<your_volume>/<some_dir> Copy the local text file you created in the previous step to the directory within your volume on the cluster o hadoopfs -put test.txt /<your_volume>/<some_dir> List the contents of the directory within your volume on the cluster to verify that the copy was successful o hadoopfs –ls /<your_volume>/<some_dir> Exercise: Mount the Cluster to Itself and Copy a File Connect to your node via ssh List the NFS shares currently exported on the node sudoshowmount -e <your_node_hostname> Set up a mount point for the NFS share sudomkdir /<cluster_mount_point> Mount the cluster via NFS sudo mount –o nolock<your_node_hostname>:/<cluster_mount_point> Copy a file from your local node filesystem to the cluster sudocp /tmp/test.txt/<cluster_mount_point>/<cluster_name>/< your_volume>/<some_dir>/ Verify that the file is now in the cluster with hadoopfs hadoopfs -ls /<your_volume>/<some_dir> © 2012 by MapR Technologies Page 1 of 1