source: proiecte/HadoopJUnit/hadoop-0.20.1/src/contrib/fuse-dfs/README @ 176

Last change on this file since 176 was 120, checked in by (none), 14 years ago

Added the mail files for the Hadoop JUNit Project

  • Property svn:executable set to *
File size: 6.0 KB
Line 
1# Copyright 2005 The Apache Software Foundation Licensed under the
2# Apache License, Version 2.0 (the "License"); you may not use this
3# file except in compliance with the License.  You may obtain a copy
4# of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless
5# required by applicable law or agreed to in writing, software
6# distributed under the License is distributed on an "AS IS" BASIS,
7# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
8# implied.  See the License for the specific language governing
9# permissions and limitations under the License.
10
11Fuse-DFS
12
13Supports reads, writes, and directory operations (e.g., cp, ls, more, cat, find, less, rm, mkdir, mv, rmdir).  Things like touch, chmod, chown, and permissions are in the works. Fuse-dfs currently shows all files as owned by nobody.
14
15Contributing
16
17It's pretty straightforward to add functionality to fuse-dfs as fuse makes things relatively simple. Some other tasks require also augmenting libhdfs to expose more hdfs functionality to C. See [http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&mode=hide&pid=12310240&sorter/order=DESC&sorter/field=priority&resolution=-1&component=12312376  contrib/fuse-dfs JIRAs]
18
19Requirements
20
21 * Hadoop with compiled libhdfs.so
22 * Linux kernel > 2.6.9 with fuse, which is the default or Fuse 2.7.x, 2.8.x installed. See: [http://fuse.sourceforge.net/]
23 * modprobe fuse to load it
24 * fuse-dfs executable (see below)
25 * fuse_dfs_wrapper.sh installed in /bin or other appropriate location (see below)
26
27
28BUILDING
29
30   1. in HADOOP_HOME: `ant compile-libhdfs -Dlibhdfs=1
31   2. in HADOOP_HOME: `ant package` to deploy libhdfs
32   3. in HADOOP_HOME: `ant compile-contrib -Dlibhdfs=1 -Dfusedfs=1`
33
34NOTE: for amd64 architecture, libhdfs will not compile unless you edit
35the Makefile in src/c++/libhdfs/Makefile and set OS_ARCH=amd64
36(probably the same for others too). See [https://issues.apache.org/jira/browse/HADOOP-3344 HADOOP-3344]
37
38Common build problems include not finding the libjvm.so in JAVA_HOME/jre/lib/OS_ARCH/server or not finding fuse in FUSE_HOME or /usr/local.
39
40
41CONFIGURING
42
43Look at all the paths in fuse_dfs_wrapper.sh and either correct them or set them in your environment before running. (note for automount and mount as root, you probably cannot control the environment, so best to set them in the wrapper)
44
45INSTALLING
46
471. `mkdir /export/hdfs` (or wherever you want to mount it)
48
492. `fuse_dfs_wrapper.sh dfs://hadoop_server1.foo.com:9000 /export/hdfs -d` and from another terminal, try `ls /export/hdfs`
50
51If 2 works, try again dropping the debug mode, i.e., -d
52
53(note - common problems are that you don't have libhdfs.so or libjvm.so or libfuse.so on your LD_LIBRARY_PATH, and your CLASSPATH does not contain hadoop and other required jars.)
54
55Also note, fuse-dfs will write error/warn messages to the syslog - typically in /var/log/messages
56
57You can use fuse-dfs to mount multiple hdfs instances by just changing the server/port name and directory mount point above.
58
59DEPLOYING
60
61in a root shell do the following:
62
631. add the following to /etc/fstab
64
65fuse_dfs#dfs://hadoop_server.foo.com:9000 /export/hdfs fuse -oallow_other,rw,-ousetrash,-oinitchecks 0 0
66
67
682. Mount using: `mount /export/hdfs`. Expect problems with not finding fuse_dfs. You will need to probably add this to /sbin and then problems finding the above 3 libraries. Add these using ldconfig.
69
70
71Fuse DFS takes the following mount options (i.e., on the command line or the comma separated list of options in /etc/fstab:
72
73-oserver=%s  (optional place to specify the server but in fstab use the format above)
74-oport=%d (optional port see comment on server option)
75-oentry_timeout=%d (how long directory entries are cached by fuse in seconds - see fuse docs)
76-oattribute_timeout=%d (how long attributes are cached by fuse in seconds - see fuse docs)
77-oprotected=%s (a colon separated list of directories that fuse-dfs should not allow to be deleted or moved - e.g., /user:/tmp)
78-oprivate (not often used but means only the person who does the mount can use the filesystem - aka ! allow_others in fuse speak)
79-ordbuffer=%d (in KBs how large a buffer should fuse-dfs use when doing hdfs reads)
80ro
81rw
82-ousetrash (should fuse dfs throw things in /Trash when deleting them)
83-onotrash (opposite of usetrash)
84-odebug (do not daemonize - aka -d in fuse speak)
85-obig_writes (use fuse big_writes option so as to allow better performance of writes on kernels >= 2.6.26)
86-initchecks - have fuse-dfs try to connect to hdfs to ensure all is ok upon startup. recommended to have this  on
87The defaults are:
88
89entry,attribute_timeouts = 60 seconds
90rdbuffer = 10 MB
91protected = null
92debug = 0
93notrash
94private = 0
95
96EXPORTING
97
98Add the following to /etc/exports:
99
100/export/hdfs *.foo.com(no_root_squash,rw,fsid=1,sync)
101
102NOTE - you cannot export this with a FUSE module built into the kernel
103- e.g., kernel 2.6.17. For info on this, refer to the FUSE wiki.
104
105
106RECOMMENDATIONS
107
1081. From /bin, `ln -s $HADOOP_HOME/contrib/fuse-dfs/fuse_dfs* .`
109
1102. Always start with debug on so you can see if you are missing a classpath or something like that.
111
1123. use -obig_writes
113
1144. use -initchecks
115
116KNOWN ISSUES
117
1181. if you alias `ls` to `ls --color=auto` and try listing a directory with lots (over thousands) of files, expect it to be slow and at 10s of thousands, expect it to be very very slow.  This is because `--color=auto` causes ls to stat every file in the directory. Since fuse-dfs does not cache attribute entries when doing a readdir,
119this is very slow. see [https://issues.apache.org/jira/browse/HADOOP-3797 HADOOP-3797]
120
1212. Writes are approximately 33% slower than the DFSClient. TBD how to optimize this. see: [https://issues.apache.org/jira/browse/HADOOP-3805 HADOOP-3805] - try using -obig_writes if on a >2.6.26 kernel, should perform much better since bigger writes implies less context switching.
122
1233. Reads are ~20-30% slower even with the read buffering.
124
1254. fuse-dfs and underlying libhdfs have no support for permissions. See [https://issues.apache.org/jira/browse/HADOOP-3536 HADOOP-3536]
Note: See TracBrowser for help on using the repository browser.