{{{ #!html
掛載 Fuse HDFS (0.20)
}}} [[PageOutline]] = 零、環境 = * ubuntu 9.04 * kernel 2.6.24-24-generic (原本預設為 2.6.28-15 ) * 請重新開機於grub 切換成第三個kernel,否則無法 modprobe fuse * hadoop 0.20.1 (安裝於/opt/hadoop-0.20.1) * fuse 版本 (FUSE_HOME = /usr/local) * tarball 版為 2.7.4 ,此目的為了使FUSE_HOME 於 /usr/local (應該可以不用做此步) * 而'''/lib/modules/2.6.24-24-generic/kernel/fs/fuse/fuse.ko''' 此fuse模組檔為安裝 '''linux-image-2.6.24-24-generic'''.deb時就有 * automake 1.9.x 以上 * sudo apt-get install automake 可得 1.10.2 = 一、安裝 = == 1. 載入fuse的kernel module == {{{ $ sudo apt-get install linux-image-2.6.24-24-generic fuse-utils libfuse-dev libfuse2 automake }}} 重開機,於grub 挑選linux-image-2.6.24-24-generic (第三個) 開機完後,載入fuse 的 kernel module (也可不sudo) {{{ $ modprobe fuse }}} == 2. 編譯 fuse-hdfs == 改 /opt/hadoop-0.20.1/build.xml 的 1046行左右,去掉 doc相關敘述,如下: {{{ #!text ] [-oport=] [-oentry_timeout=] [-oattribute_timeout=] [-odirect_io] [-onopoermissions] [-o] [fuse options] NOTE: debugging option for fuse is -debug }}} ps . 若遇到錯誤請往前檢查 = 二、執行 = 之後的範例會將hdfs掛載於 /tmp/fusehdfs 下,掛載成功後,可直接到 /tmp/fusehdfs 內進行ls, rm , cp 等指令 {{{ $ mkdir /tmp/fusehdfs $ cd /opt/hadoop/contrib/fuse-dfs }}} == 1. 掛載hdfs-fuse == * 法1. 用以下方法可以讓hdfs 掛載於 /tmp/fusehdfs {{{ $ fuse_dfs_wrapper.sh dfs://secuse.nchc.org.tw:9000 /tmp/fusehdfs }}} * 法2. 的效果與法一相同,但可以透過-o 來加入參數 {{{ $ fuse_dfs_wrapper.sh rw -oserver=secuse.nchc.org.tw -oport=9000 /tmp/fusehdfs }}} * 法3. 開啟 debug模式,於另外一個視窗可以自由下達 讀、寫、新增、刪除檔案 等指令 {{{ $ fuse_dfs_wrapper.sh rw -oserver=secuse.nchc.org.tw -oport=9000 /tmp/fusehdfs -odebug }}} == 卸載hdfs-fuse == {{{ $ fuseumount -u /tmp/fusehdfs }}} = 三、補充 = 加入以下內容到 /etc/fstab {{{ #!text fuse_dfs#dfs://hadoop_server.foo.com:9000 /export/hdfs fuse -oallow_other,rw,-ousetrash,-oinitchecks 0 0 }}} 好處是之後就可以用mount 指令來掛載 {{{ $ sudo mount /tmp/fusehdfs $ sudo umount /tmp/fusehdfs }}} 缺點是用root mount 會導致權限問題,與因為export參數不完全,導致找不到libhdfs.so.0 = 四、除錯 = == ant 時檢查check java5 或 forest 等錯誤訊息 == * 改 build.xml 的 1046行左右,去掉 doc相關敘述,如下: {{{ #!text libhdfs.so