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

Building a Model-Agnostic Multi-Agent System with OpenClaw

Over one week we rebuilt our AI stack around OpenClaw’s multi-agent architecture to avoid provider lock-in and stop wasting premium tokens. By aligning models to tasks, diversifying fallbacks across providers, enforcing minimal tool access, and switching to memory-first workflows with ephemeral sessions, we reduced token usage per task by about 70% and cut our monthly bill by 77% while improving operational resilience. How We Achieved 77% Cost Reduction and Provider Independence Over the past week, we rebuilt our AI infrastructure around OpenClaw’s multi-agent architecture. The result was a 77% cost reduction , provider independence , and a delegation system that routes work to the most cost-effective model for each job. Below is the technical journey of optimizing a 7-agent squad with OpenClaw. The Challenge: Model Provider Lock-In We started with a simple problem: our entire squad defaulted to a single model provider. This created three issues: Cost inefficiency beca...

BacNet => MQTT in Production: The Real Cost of Bridging BACnet to MQTT at Scale

bacnet2mqtt looks simple in a README and expensive in production. Once BACnet polling, reconnection behavior, stale state, and MQTT publishing collide, teams discover they are not deploying a lightweight adapter but operating infrastructure. This article breaks down where bacnet2mqtt works, where it becomes a bottleneck, and which production patterns reduce the operational damage before incidents, backlogs, and silent data loss turn a building integration into a long-running engineering problem. I inherited a building controls integration problem 18 months ago. Three office floors. 217 BACnet sensors covering temperature, occupancy, and HVAC actuators. The data was trapped inside the building automation network while the business wanted analytics, reporting, and compliance visibility in the data platform. The obvious answer looked easy enough: deploy bacnet2mqtt, bridge BACnet into MQTT, and push the stream into the lakehouse stack. The repository made it sound like a w...

Get Apache Flume 1.3.x running on Windows

Since we found an increasing interest in the flume community to get Apache Flume running on Windows systems again, I spent some time to figure out how we can reach that. Finally, the good news - Apache Flume runs on Windows. You need some tweaks to get them running. Prerequisites Build system: maven 3x, git, jdk1.6.x, WinRAR (or similar program) Apache Flume agent: jdk1.6.x, WinRAR (or similar program), Ultraedit++ or similar texteditor Tweak the Windows build box 1. Download and install JDK 1.6x from Oracle 2. Set the environment variables    => Start - type " env " into the search box, select " E dit system environment variables ", click Environment Variables, Select " New " from the " Systems variables " box, type " JAVA_HOME " into " variable name " and the path to your JDK installation into "Variable value" (Example:  C:\Program Files (x86)\Java\jdk1.6.0_33 ) 3. Download maven from Apache 4. Set...