分享

hadoop挂载hdfs文件系统为本地linux目录

atsky123 发表于 2013-10-25 10:45:47 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 5 15803
我最近要测试一下hadoop的hdfs文件系统从的性能,要用到iozone,sysbench等测试工具,可是基于hdfs本身的那些命令这些测试工具都无法使用。有什么方法可以把hdfs挂载到本地目录上,操作hdfs就跟操作本地磁盘一样。
操作系统:redhat5.3x64
hadoop版本:hadoop-0.20.1
本人对hadoop了解甚少,请高手指教。很急很急很急!!! 先谢谢大家了!

已有(5)人评论

跳转到指定楼层
mituan2008 发表于 2013-10-25 10:45:47
你可以用hdfs-fuse把hdfs挂接到本地文件系统,具体我还木有试过,下面有几个参考页面:
讲得比较细,但是是用日文写的,囧~你用google网页翻译弄一下看就行了
http://www.pginjp.org/modules/ne ... 22&topic_id=221
tw人写的一个安装步骤
http://trac.nchc.org.tw/cloud/wiki/waue/2009/1002
fuse-dfs的设定手册,说是从日文翻译过来的,难道是翻第一个的吗?不过我看了下,有些不同,也粘上来吧
http://sery.blog.51cto.com/10037/121110
回复

使用道具 举报

shihailong123 发表于 2013-10-25 10:45:47
本帖最后由 leongfans 于 2010-1-27 10:59 编辑
上面的做法现在好像已经不行了,我按照下面的方法,成功挂载上来了
Ok, looks like I finally was able to setup FUSE-HDFS on SLES10 box (using Hadoop-0.20.1 distribution)
As it took me a while to figure this out, I thought to share these steps with the Universe.
1. In general, my SLES10 system runs with 2.6.16.60 kernel. The OS is 64-bit.
2. Download and make FUSE. I did it with fuse-2.8.0.tar.gz. Regular configure & make &
make install worked
3. modprobe fuse
4. export JAVA_HOME=
5. export HADOOP_HOME=
6. vi  $HADOOP_HOME/src/contrib/fuse-dfs/src/fuse_dfs_wrapper.sh   - update the variables
(HADOOP_HOME, JAVA_HOME, ...)
7. cd $HADOOP_HOME
8. setenv ANT_OPTS "-Dhttp.proxyHost= -Dhttp.proxyPort="
   This would allow you to build everything if you are behind the firewall
9. Make sure your default autoconf is v2.61, and your default ant is 1.7.1  - I've had problems
with older versions
10. ant compile -Dcompile.c++=true -Dlibhdfs=true
11. ln -s $HADOOP_HOME/build/c++/Linux-amd64-64/lib $HADOOP_HOME/build/libhdfs
12. export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:$HADOOP_HOME/build/libhdfs:$JAVA_HOME/jre/lib/amd64/server
13. ant compile-contrib -Dlibhdfs=1 -Dfusedfs=1
If everything is ok till this point, you should be ready to go. Follow http://wiki.apache.org/hadoop/MountableHDFS
procedure after INSTALLING section
有个注意的地方,就是挂载的时候,所用的url必须和conf目录下面配置的url一样,否则会出现的~
回复

使用道具 举报

goldtimes 发表于 2013-10-25 10:45:47
回复 1# hohofuck
    试试这个链接:
http://code.google.com/p/hdfs-webdav/

   webdav客户端,在windows和linux系统都可以,测试过:
   hdfs搭建环境:centos5.4, hadoop-0.20.1, apache-tomcat-0.6.0.20,hdfs-webdav.war
   windows中,直接网上邻居,就行了,
   linux中,neon-0.29.3.tar.gz, fuse-2.8.3.tar.gz, davfs2-1.4.5.tar.gz

   

回复

使用道具 举报

sq331335144 发表于 2013-10-25 10:45:47
本帖最后由 pig2 于 2015-1-4 22:19 编辑

我按照3楼的说法,试了一次,没有成功,主要原因是我的环境有。
我在14个刀片上面部署了hdfs,都未能连接外网。我的机器环境是 SUSE Linux Enterprise Server 10 SP2 (x86_64),内网机器,不能上外网[ol]ant compile -Dcompile.c++=true -Dlibhdfs=true[/ol]复制代码之后报错[ol]clover.setup: clover.info:     [echo]      [echo]      Clover not found. Code coverage reports disabled.     [echo]    clover: ivy-download:      [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.0.0-rc2/ivy-2.0.0-rc2.jar      [get] To: /usr/local/hadoop-0.20.2/ivy/ivy-2.0.0-rc2.jar      [get] Error getting http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.0.0-rc2/ivy-2.0.0-rc2.jar to /usr/local/hadoop-0.20.2/ivy/ivy-2.0.0-rc2.jar BUILD FAILED/usr/local/hadoop-0.20.2/build.xml:1630: java.net.UnknownHostException: repo2.maven.org        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)        at java.net.Socket.connect(Socket.java:529)        at java.net.Socket.connect(Socket.java:478)        at sun.net.NetworkClient.doConnect(NetworkClient.java:163)        at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)        at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)        at sun.net.www.http.HttpClient.(HttpClient.java:233)        at sun.net.www.http.HttpClient.New(HttpClient.java:306)        at sun.net.www.http.HttpClient.New(HttpClient.java:323)        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:860)        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801)        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:726)        at org.apache.tools.ant.taskdefs.Get$GetThread.openConnection(Get.java:662)        at org.apache.tools.ant.taskdefs.Get$GetThread.get(Get.java:581)        at org.apache.tools.ant.taskdefs.Get$GetThread.run(Get.java:571)Total time: 1 second[/ol]复制代码很明显是由于网络
找了许久后,用以下的代码编译[ol]
ant compile -Dcompile.c++=true -Dlibhdfs=true -Doffline=true[/ol]复制代码还是不行,其中错误代码片段为[ol][ivy:resolve]           :: commons-logging#commons-logging;1.0.4: not found[ivy:resolve]           :: log4j#log4j;1.2.15: not found[ivy:resolve]           :: commons-httpclient#commons-httpclient;3.0.1: not found[ivy:resolve]           :: commons-codec#commons-codec;1.3: not found[ivy:resolve]           :: commons-cli#commons-cli;1.2: not found[ivy:resolve]           :: xmlenc#xmlenc;0.52: not found[ivy:resolve]           :: net.java.dev.jets3t#jets3t;0.6.1: not found[ivy:resolve]           :: commons-net#commons-net;1.4.1: not found[ivy:resolve]           :: org.mortbay.jetty#servlet-api-2.5;6.1.14: not found[ivy:resolve]           :: org.mortbay.jetty#jetty;6.1.14: not found[ivy:resolve]           :: org.mortbay.jetty#jetty-util;6.1.14: not found[ivy:resolve]           :: tomcat#jasper-runtime;5.5.12: not found[ivy:resolve]           :: tomcat#jasper-compiler;5.5.12: not found[ivy:resolve]           :: commons-el#commons-el;1.0: not found[ivy:resolve]           :: junit#junit;3.8.1: not found[ivy:resolve]           :: commons-logging#commons-logging-api;1.0.4: not found[ivy:resolve]           :: org.slf4j#slf4j-api;1.4.3: not found[ivy:resolve]           :: org.eclipse.jdt#core;3.1.1: not found[ivy:resolve]           :: oro#oro;2.0.8: not found[ivy:resolve]           :: org.slf4j#slf4j-log4j12;1.4.3: not found[ivy:resolve]           :: org.mockito#mockito-all;1.8.0: not found[ivy:resolve]           ::::::::::::::::::::::::::::::::::::::::::::::[/ol]复制代码我对ant不熟,且刚刚开始弄hadoop,希望得到帮助。谢谢

回复

使用道具 举报

oYaoXiang1 发表于 2013-10-25 10:45:47
我准备开始弄webDAV,但是我还是希望能够将fuse-hdfs弄通,这样方便对比测试。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条