Menu

HDFS HttpFS Check

Dependencies

Show Source Code
module.exports = header: 'HDFS HttpFS Check', handler: ({options}) ->

Assert Connection

Show Source Code
  @connection.assert
    header: 'HTTP'
    servers: options.wait.http.filter (srv) -> srv.host is options.fqdn
    retry: 3
    sleep: 3000

TODO: Test the HTTP server with a JMX request.

List the files and diretory from the HDFS root.

Show Source Code
  protocol = if options.env.HTTPFS_SSL_ENABLED is 'true' then 'https' else 'http'
  @system.execute
    header: 'List Files'
    cmd: mkcmd.test options.test_krb5_user, """
    curl --fail -k --negotiate -u: \
      #{protocol}://#{options.fqdn}:#{options.http_port}/webhdfs/v1?op=GETFILESTATUS
    """
  , (err, _, stdout, stderr) ->
    throw Error "Invalid output" unless JSON.parse(stdout).FileStatus.type is 'DIRECTORY'
Show Source Code
mkcmd = require '../../lib/mkcmd'