You can set up a pool of NFS servers on various nodes in your cluster and connect to them using virtual IP addresses (VIPs) to achieve HA with failover; if one node fails, the VIP will automatically be reassigned to another NFS node in the pool. If you do not specify a list of NFS nodes to form a pool, then MapR uses any available node running the MapR NFS Gateway service. VIPs are not assigned to any nodes that are not on the list, regardless of whether they are running NFS. 

To add a server to an NFS pool that is not divided into subnets, start the MapR NFS service on that server. The MapR cluster automatically detects it and adds it to the pool.

The following illustration shows three nodes (Host1, Host2, and Host3) acting as NFS servers. Each node has two NICs whose ports are labeled eth0 and eth1. The NICs are grouped into two subnets, called Subnet A and Subnet B. Clients can access any of the NFS servers through a pool (or range) of VIPs assigned to each subnet. MapR assigns each VIP address in the pool at random to a MAC address in the subnet (with its corresponding physical IP address).

The initial VIP assignment shown above is summarized in the following table. If one NFS server becomes unavailable, the VIP assigned to that server is automatically assigned to another server on the same subnet.

ServerSubnetVIPs (randomly assigned)

If the cluster's NFS nodes have multiple network interface cards (NICs) connected to different subnets, you should restrict VIP assignment to the NICs that are on the correct subnet: for each NFS server, choose whichever MAC address is on the subnet from which the cluster will be NFS-mounted, then add it to the list.

If you add a VIP that is not accessible on the subnet, then failover will not work.

You can only set up VIPs for failover between network interfaces that are in the same subnet. In large clusters with multiple subnets, you can set up multiple groups of VIPs to provide NFS failover for the different subnets.

VIPs are evenly distributed across NFS nodes. For example, if six VIP addresses are available for three NFS servers, two VIPs are assigned to each server. If the previous example did not have two separate subnets, the six VIP addresses might be assigned like this:

ServerVIPs (randomly assigned)



You can set up VIPs with the virtualip add command, or using the Add Virtual IP dialog in the MapR Control System.

Using Consistent Export Rules

Export rules (stored in conf/exports) should be the same across all NFS nodes that are in the same VIP pool, and for nodes that are configured for the same VIP failover. The default version of conf/exports is shown here:

# Sample Exports file

# for non /mapr exports
# <Path>  <comma separated cldb addresses=host:port> <exports_control>

# for /mapr exports
# <Path> <exports_control>

#access_control -> order is specific to default
# list the hosts before specifying a default for all
#  a.b.c.d, d.e.f.g(ro) (rw)
#  enforces ro for a.b.c.d & and everybody else is rw

# special path to export clusters in mapr-clusters.conf. To disable exporting,
# comment it out. to restrict access use the exports_control
/mapr (rw)

#to export only certain clusters, comment out the /mapr & uncomment.
# Note: this will cause /mapr to be unexported
#/mapr/clustername (rw)

#to export /mapr only to certain hosts (using exports_control)
#/mapr a.b.c.d(rw),e.f.g.h(ro)

# export /mapr/cluster1 rw to a.b.c.d & ro to e.f.g.h (denied for others)
#/mapr/cluster1 a.b.c.d(rw),e.f.g.h(ro)

# export /mapr/cluster2 only to e.f.g.h (denied for others)
#/mapr/cluster2 e.f.g.h(rw)

# export /mapr/cluster3 rw to e.f.g.h & ro to others
#/mapr/cluster2 e.f.g.h(rw) (ro)

Setting up VIPs for NFS through the MCS

You can use the MCS to specify a range of virtual IP addresses and assign them to the pool of servers that are running the NFS service. You can also restrict the assignment of virtual IP addresses to certain subnets.

Before following this procedure, make sure:

  • You have installed NFS on at least three nodes (recommended).
  • You have started the NFS gateway service on the servers to which you plan to assign VIPs.

To set up VIPs for NFS using the MapR Control System:

These instructions tell you how to set up VIPs for all network interfaces on all the nodes running the NFS Gateway service. The next group of instructions explains how to allocate separate pools of VIPs to specific subnets.

  1. In the Navigation pane, expand the NFS HA group and click the NFS Setup view.
  2. Click Add VIP to display the Add Virtual IP dialog.
  3. Enter the start of the VIP range in the Starting VIP field.
  4. Enter the end of the VIP range in the Ending VIP field. If you are assigning only one VIP, you can leave the field blank.
  5. Enter the Netmask for the VIP range in the Netmask field. Example:
  6. (Optional) To assign a particular VIP address to a specific server or MAC address, select the checkbox next to Preferred MAC address and enter the MAC address for the network interface to be assigned to the listed VIP address. The remaining VIP addresses from the same pool are assigned randomly.
  7. Click OK to assign the VIPs and exit.
  8. (Optional) Confirm the actual VIP assignment by clicking on VIP Assignments. A display similar to the one below shows the individual VIP assignments made from the specified range of VIP addresses.

To allocate separate pools of VIPs to different subnets:

  1. Follow steps 1 through 5 above.
  2. From the Add Virtual IP dialog box, click on the radio button next to Select the desired network interfaces:. A list of node names, IP addresses and MAC addresses appears, such as the one below:
  3. Click on the to add the selected MAC address to the list of servers to which the VIPs can be assigned. Note that each entry you select appears in the lower portion of the display. For example:

    You can click on the to reverse the operation and remove the corresponding node name from the group.
  4. Click OK to assign the VIPs and exit.