Skip to main content

Mounting HDFS via FUSE and Exporting Over NFS

Struggling with delivery, architecture alignment, or platform stability?

I help teams fix systemic engineering issues: processes, architecture, and clarity.
→ See how I work with teams.


This guide shows how to mount an HDFS filesystem using FUSE and then export part of it over NFS so that remote systems can access HDFS like a local filesystem. The approach is based on classic Hadoop and Linux tools, and includes notes on security, user mapping, and kernel limitations.

In some environments, it can be useful to make an HDFS filesystem available across networks as an exported share. This walkthrough describes a working scenario using Linux and Hadoop with tools that are typically included in older Hadoop distributions.

The setup uses hadoop-fuse-dfs and libhdfs to mount HDFS locally, and then exports that mount over NFS. Replace namenode.local and <PORT> with values appropriate for your cluster.

1. Install FUSE and libhdfs

yum install hadoop-0.20-fuse.x86_64 hadoop-0.20-libhdfs.x86_64

2. Create a mountpoint

mkdir /hdfs-mount

3. Test mounting HDFS via FUSE

hadoop-fuse-dfs dfs://namenode.local:<PORT> /hdfs-mount -d

If the mount succeeds, you should see output similar to:

INFO fuse_options.c:162 Adding FUSE arg /hdfs-mount
INFO fuse_options.c:110 Ignoring option -d
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56
INIT: 7.10
flags=0x0000000b
max_readahead=0x00020000
INFO fuse_init.c:101 Mounting namenode.local:<PORT>
INIT: 7.8
flags=0x00000001
max_readahead=0x00020000
max_write=0x00020000
unique: 1, error: 0 (Success), outsize: 40

Once you see Success, you can stop the foreground process with Ctrl+C. The command above is mainly for testing.

4. Configure the mount at boot time

To mount HDFS automatically at boot, add an entry to /etc/fstab:

echo "hadoop-fuse-dfs#dfs://namenode.local:<PORT> /hdfs-mount fuse usetrash,rw 0 0" >> /etc/fstab

Then test the configuration:

# mount -a
# mount
[...]
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
fuse on /hdfs-mount type fuse (rw,nosuid,nodev,allow_other,default_permissions)

If you see the FUSE mount entry for /hdfs-mount, the configuration is working.

5. Tuning JVM memory for FUSE

Each FUSE process uses a JVM. To tune memory settings, inspect and adjust:

/etc/default/hadoop-0.20-fuse

Here you can configure Java heap size and other runtime parameters to fit your workload and hardware limits.

6. Export HDFS via NFS (unsecure)

The next step is to export part of the FUSE-mounted HDFS via NFS. Note that this is considered unsecure and should be used only in trusted environments. User IDs and permissions are mapped at the OS level.

6.1 Select the user for NFS exports

Assume you want to export data using the hdfs user. Check its UID and GID:

# id hdfs
uid=104(hdfs) gid=105(hdfs) groups=105(hdfs),104(hadoop) context=root:staff_r:staff_t:SystemLow-SystemHigh

6.2 Create the NFS exports configuration

Define an export for the HDFS user directory in /etc/exports:

# cat /etc/exports
/hdfs-mount/user   (fsid=111,rw,wdelay,anonuid=104,anongid=105,sync,insecure,no_subtree_check,no_root_squash)

Explanation (simplified):

  • rw: read-write
  • fsid=111: unique filesystem ID (see man 5 exports)
  • wdelay: write delay
  • anonuid=104, anongid=105: map anonymous users to the hdfs user and group
  • sync: synchronous writes
  • insecure: allow connections from non-privileged ports
  • no_subtree_check, no_root_squash: disable subtree checks and root squashing

Exporting only the /hdfs-mount/user directory helps protect system-related paths such as /mapred or other service directories from accidental modification.

Restart the NFS server to apply the configuration:

# service nfs restart

7. Using HDFS as a “local” filesystem via NFS

From a client machine, you can now mount the exported NFS share and work with HDFS as if it were a local directory:

# mount -t nfs <NFS_SERVER_HOST>:/hdfs-mount/user /mnt/hdfs-user

After mounting, you can create or copy job definitions and files directly into HDFS through this NFS path. Keep in mind:

  • All file operations are translated through FUSE and libhdfs into HDFS calls.
  • Permissions and ownership are mapped to the local hdfs user as configured.
  • Using root on clients is a bad idea; stick to regular users and rely on the mapping.

8. Security and compatibility notes

This pattern relies on classic kernels and older Hadoop components:

  • It only works reliably from Linux kernel 2.6.27 upwards (as originally tested).
  • NFS exports based on FUSE-mounted HDFS are not recommended for multi-tenant or untrusted environments.
  • For modern clusters, consider HDFS NFS Gateway, WebHDFS, or object-store abstractions instead.

Within its constraints, this approach can still be useful for legacy clusters and simple, controlled use cases where administrators need quick, filesystem-style access to HDFS.

If you need help with distributed systems, backend engineering, or data platforms, check my Services.

Most read articles

Why Is Customer Obsession Disappearing?

Many companies trade real customer-obsession for automated, low-empathy support. Through examples from Coinbase, PayPal, GO Telecommunications and AT&T, this article shows how reliance on AI chatbots, outsourced call centers, and KPI-driven workflows erodes trust, NPS and customer retention. It argues that human-centric support—treating support as strategic investment instead of cost—is still a core growth engine in competitive markets. It's wild that even with all the cool tech we've got these days, like AI solving complex equations and doing business across time zones in a flash, so many companies are still struggling with the basics: taking care of their customers. The drama around Coinbase's customer support is a prime example of even tech giants messing up. And it's not just Coinbase — it's a big-picture issue for the whole industry. At some point, the idea of "customer obsession" got replaced with "customer automation," and no...

How to scale MySQL perfectly

When MySQL reaches its limits, scaling cannot rely on hardware alone. This article explains how strategic techniques such as caching, sharding and operational optimisation can drastically reduce load and improve application responsiveness. It outlines how in-memory systems like Redis or Memcached offload repeated reads, how horizontal sharding mechanisms distribute data for massive scale, and how tools such as Vitess, ProxySQL and HAProxy support routing, failover and cluster management. The summary also highlights essential practices including query tuning, indexing, replication and connection management. Together these approaches form a modern DevOps strategy that transforms MySQL from a single bottleneck into a resilient, scalable data layer able to grow with your application. When your MySQL database reaches its performance limits, vertical scaling through hardware upgrades provides a temporary solution. Long-term growth, though, requires a more comprehensive approach. This invo...

What the Heck is Superposition and Entanglement?

This post is about superposition and interference in simple, intuitive terms. It describes how quantum states combine, how probability amplitudes add, and why interference patterns appear in systems such as electrons, photons and waves. The goal is to give a clear, non mathematical understanding of how quantum behavior emerges from the rules of wave functions and measurement. If you’ve ever heard the words superposition or entanglement thrown around in conversations about quantum physics, you may have nodded politely while your brain quietly filed them away in the "too confusing to deal with" folder.  These aren't just theoretical quirks; they're the foundation of mind-bending tech like Google's latest quantum chip, the Willow with its 105 qubits. Superposition challenges our understanding of reality, suggesting that particles don't have definite states until observed. This principle is crucial in quantum technologies, enabling phenomena like quantum comp...