Skip to content
This repository was archived by the owner on Dec 20, 2018. It is now read-only.

Hostname of the data node #3

Description

@vsimko

I tried to use an HDFS client to upload some local file to HDFS running in a docker container.
I'm using Javascript library webhdfs.

The problem seems to be that the HDFS "data node" has a generated hostname which is not accessible from my host Linux environment. This is what the HDFS web interface of shows:
image

Here is my setup:

mkdir mywebhdfs
cd mywebhdfs
yarn add webhdfs

# now run the code which is listed below
node webhdfs-test.js

Here is my simple script for uploading data to HDFS:

// this is the content of file: webhdfs-test.js
const WebHDFS = require('webhdfs');

const hdfs = WebHDFS.createClient({
  host: 'localhost',
  port: '50070'
});

const fs = require('fs');

const local = fs.createReadStream('/home/vlx/landuse-classification-pipeline.jpg');
const remote = hdfs.createWriteStream('/some.jpg');

local.pipe(remote);

remote.on('error', (err) => {
  console.error(err)
});

remote.on('finish', () => {
  console.log("on finish")
});

Output:

{ Error: getaddrinfo EAI_AGAIN 9d2064769c90:50075
    at Object.exports._errnoException (util.js:1050:11)
    at errnoException (dns.js:33:15)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:73:26)
  code: 'EAI_AGAIN',
  errno: 'EAI_AGAIN',
  syscall: 'getaddrinfo',
  hostname: '9d2064769c90',
  host: '9d2064769c90',
  port: '50075' }

When I add the hostname 9d2064769c90 to my /etc/hosts, the file is successfully uploaded.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions