ant compile-c++-libhdfs -Dlibhdfs=1 ant package ant compile-contrib -Dlibhdfs=1 -Dfusedfs=1然而,事情有這麼順利嗎?如果有就好了...以下是我所有步驟,以root權限執行。
- 安裝相關套件 JAVA5 JAVA6 subversion ant automake
1.1加入套件庫
將以下兩列加入/etc/apt/sources.list
deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
1.2 更新套件庫、安裝
sudo apt-get updatesudo apt-get install subversion ant automake sun-java5-jdk sun-java6-jdk
2.設定環境變數
echo "export HADOOP_HOME=[hadoop位址]">>~/.bashrc ex. echo "HADOOP_HOME=/opt/app/hadoop">>~/.bashrc
echo "export JAVA_HOME="/usr/lib/jvm/java-6-sun">>~/.bashrc
source ~/.bashrc
3.編譯第一步
cd $HADOOP_HOME
ant clean
ant compile-c++-libhdfs -Dlibhdfs=1
4.Download forrest and install fuse
wget http://apache.ntu.edu.tw//forrest/apache-forrest-0.8.tar.gz
tar zxf apache-forrest-0.8.tar.gz
chmod +x apache-forrest-0.8/bin/forrest
ant package -Djava5.home=/usr/lib/jvm/java-1.5.0-sun -Dforrest.home=$(pwd)/apache-forrest-0.8
wget http://downloads.sourceforge.net/project/fuse/fuse-2.X/2.8.5/fuse-2.8.5.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Ffuse%2Ffiles%2Ffuse-2.X%2F&ts=1289382396&use_mirror=nchc
mv fuse-2.8.5.tar.gz?r=http:%2F%2Fsourceforge.net%2Fprojects%2Ffuse%2Ffiles%2Ffuse-2.X%2F fuse-2.8.5.tar.gz
tar zxf fuse-2.8.5.tar.gz
cd fuse-2.8.5
mkdir -p /opt/app/fuse;./configure --prefix=/opt/app/fuse
make -j2
make install
cd ..
echo "export FUSE_HOME=/opt/app/fuse">>~/.bashrc
source ~/.bashrc
5.最後一步編譯
ant compile-contrib -Dlibhdfs=1 -Dfusedfs=1ant compile-contrib -Dlibhdfs=1 -Dfusedfs=1
6. 設定dynamic libarary
echo "/usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server/" >>/etc/ld.so.conf
ldconfig
7.透過fuse_dfs_wrapper.sh掛載
cd build/contrib/fuse-dfs
chmod +x fuse_dfs_wrapper.sh
echo "export PATH=$PATH:$HADOOP_HOME/build/contrib/fuse-dfs" >>~/.bashrc
source ~/.bashrc
mkdir hadoop
fuse_dfs_wrapper.sh dfs://[namenode]:[port] hadoop -d 參考:conf/core-site.xml ex. fuse_dfs_wrapper.sh dfs://oct5:55011 video -d
這樣就可以把hadoop mount 到hadoop資料夾了。
p.s. namenode請填入hostname不要直接打IP