I'm working on using the REST interface to Hadoop's HDFS as a convenient way to store files over the network. To test I installed hadoop on my mac (10.8.5) following these instructions:
http://importantfish.com/how-to-install-hadoop-on-mac-os-x/
That worked like a charm and I'm able to start hadoop and run a basic test:
hadoop-examples-1.1.2.jar pi 10 100
Now, I'm using the python client to handle the HTTP requests to/from webhdfs:
http://pythonhosted.org/pywebhdfs/
But I'm stumbling on a basic permissions error when I try to create a directory:
from pywebhdfs.webhdfs import PyWebHdfsClient
hdfs = PyWebHdfsClient()
my_dir = 'user/hdfs/data/new_dir'
hdfs.make_dir(my_dir, permission=755)
Traceback (most recent call last):
File "", line 1, in
File "/Library/Python/2.7/site-packages/pywebhdfs/webhdfs.py", line 207, in make_dir
_raise_pywebhdfs_exception(response.status_code, response.text)
File "/Library/Python/2.7/site-packages/pywebhdfs/webhdfs.py", line 428, in _raise_pywebhdfs_exception
raise errors.PyWebHdfsException(msg=message)
pywebhdfs.errors.PyWebHdfsException: {"RemoteException":{"exception":"AccessControlException","javaClassName":"org.apache.hadoop.security.AccessControlException","message":"Permission denied: user=webuser, access=WRITE, inode=\"user\":mlmiller:supergroup:rwxr-xr-x"}}
I've also tried specifying the user as 'hdfs' instead of the python lib's defeault to 'webhdfs' but get the same result. After 30 minutes reading I gave up and realized I don't understand the interplay of hdfs users, hadoop security (which I enabled following the install isntructions) and my unix user and permissions.