Fuse mounting HDFS on CentOS 5

The first step is to get fuse installed.¬† It’s not as simple as “yum install fuse” – it doesn’t ship with RHEL5/CentOS5.

wget http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
rpm --import RPM-GPG-KEY.dag.txt
rm RPM-GPG-KEY.dag.txt
yum install yum-priorities
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm -Uhv rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rm rpmforge-release-0.3.6-1.el5.rf.i386.rpm
vim /etc/yum.repos.d/CentOS-Base.repo # set priority to 1 on all, but 2 on centosplus
vim /etc/yum.repos.d/rpmforge.repo # set priority to 10
yum install fuse fuse-libs fuse-devel

Ok, now we have fuse :)

Next, get hdfs-fuse from http://code.google.com/p/hdfs-fuse/downloads/list

wget wget http://hdfs-fuse.googlecode.com/files/hdfs-fuse-0.2.linux2.6-gcc4.1-x86.tar.gz

tar -xzf hdfs-fuse-0.2.linux2.6-gcc4.1-x86.tar.gz
mv hdfs-fuse /usr/local/
cd /usr/local/hdfs-fuse
vim conf/hdfs-fuse.conf  # edit to your HDFS
echo '#!/bin/sh
export JAVA_HOME=/usr/java/jdk1.6.0_13
export HADOOP_HOME=/usr/local/hadoop
export FUSE_HOME=/usr/local
export HDFS_FUSE_HOME=/usr/local/hdfs-fuse
export HDFS_FUSE_CONF=/usr/local/hdfs-fuse/conf
./hdfs-mount /hdfs' > bin/mount-hdfs.sh
chmod 755 bin/mount-hdfs.sh
mkdir /hdfs
cd bin
./mount-hdfs.sh