Skip to main content

Mount Knox-protected WebHDFS on your local Linux or Mac file system

Project description

Description

Mount WebHDFS on your local Linux or Mac file system

After this, you can access the WebHDFS file system as if was a local directory - with regular Unix file operations.

Installation

First dependency is fuse, you can install it on Ubuntu with:

sudo apt-get install fuse

or on RedHat with:

sudo yum install fuse

after that, you can simply run:

pip3 install fuse_webhdfs

and this should pull in all dependencies

Preparing IBM internal certificates

If you’re running on IBM network, you’ll need IBM internal certificate chain. You can run the following commands to prepare this chain:

curl -L https://daymvs1.pok.ibm.com/ibmca/downloadCarootCert.do\?file\=carootcert.der | openssl x509 -inform DER -outform PEM > ibm-chain.crt
curl -L https://daymvs1.pok.ibm.com/ibmca/downloadCarootCert.do\?file\=caintermediatecert.der | openssl x509 -inform DER -outform PEM >> ibm-chain.crt

And in the following configuration step please provide ‘ibm-chain.crt’ as the HDFS web server certificate path.

Usage

In one terminal type:

mkdir -p ~/fuse-webhdfs
python3 mount-webhdfs.py ~/fuse-webhdfs

You now have to type in your HDFS endpoint parameters and HDFS (Knox) username and password. For IBM internal use, please provide your w3id username and password.

These parameters will be saved in plain text in $HOME/.config/webhdfs.ini. If you have a problem with that, please create a pull request and I will be happy to consider merging it.

After mounting, in other terminal(s) you will be able to list files, read them, etc. For example:

ls -l ~/fuse-webhdfs/tmp
echo "this is a test" > ~/fuse-webhdfs/tmp/test
cat ~/fuse-webhdfs/tmp/test

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fuse_webhdfs-0.6.3-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file fuse_webhdfs-0.6.3-py3-none-any.whl.

File metadata

File hashes

Hashes for fuse_webhdfs-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 58cf5732a793c2241b589fb502ba8c0ad317e0375dc6d77f414f776c10bf4313
MD5 92d70efbfa1d21c2be42c728c323979d
BLAKE2b-256 e6937d9efd65b0fa19a7a1f848cc8c3051f83de621ea32d34299f225bf2911b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page