Search code examples
hadoopmapr

Switching between MapR clusters


I have specified two clusters in my mapr-clusters.conf

cluster1 secure=true cldb1:7222 cldb2:7222 cldb3:7222
cluster2 secure=true cldb4:7222 cldb5:7222 cldb6:7222

In some occations, I want to load data into cluster1. On other occations, I want to load data in cluster2.

Per default, the MapR Client takes the first specifed as default client. How can I tell the MapR Client to use the second specified cluster?

So that

hadoop fs -put <src> <dest> 

targets cluster2?


Solution

  • In general, MapR supports the /mapr/ style file names for the HDFS API. This is very handy because the default mount point for NFS and the POSIX driver is /mapr. This makes the path names for posix access to files identical to the path names used for HDFS access to the same files. The table and stream APIs use the same convention so that if you see a file in a directory, you can use that directory path to get to the table via a table API.

    If you are on an edge node (i.e. no MapR services running on that node), then you can just change the order of the lines in the configuration file to change which cluster is taken as the default cluster. I don't recommend doing that, however, since I find the cluster specific path names to be more useful.