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.
|Server||Subnet||VIPs (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.
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:
|Server||VIPs (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:
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.
- In the Navigation pane, expand the NFS HA group and click the NFS Setup view.
- Click Add VIP to display the Add Virtual IP dialog.
- Enter the start of the VIP range in the Starting VIP field.
- 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.
- Enter the Netmask for the VIP range in the Netmask field. Example:
- (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.
- Click OK to assign the VIPs and exit.
- (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:
- Follow steps 1 through 5 above.
- 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:
- 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.
- Click OK to assign the VIPs and exit.