URI to access a file in HDFS

走远了吗. 提交于 2019-12-05 17:08:08

Default port is "8020".

You can access the "hdfs" paths in 3 different ways.

  1. Simply use "/" as the root path

    For e.g.

    E:\HadoopTests\target>hadoop fs -ls /
    Found 6 items
    drwxrwxrwt   - hadoop  hdfs          0 2015-08-17 18:43 /app-logs
    drwxr-xr-x   - mballur hdfs          0 2015-11-24 15:36 /tmp
    drwxrwxr-x   - mballur hdfs          0 2015-10-20 15:27 /user
    
  2. Use "hdfs:///"

    For e.g.

    E:\HadoopTests\target>hadoop fs -ls hdfs:///
    Found 6 items
    drwxrwxrwt   - hadoop  hdfs          0 2015-08-17 18:43 hdfs:///app-logs
    drwxr-xr-x   - mballur hdfs          0 2015-11-24 15:36 hdfs:///tmp
    drwxrwxr-x   - mballur hdfs          0 2015-10-20 15:27 hdfs:///user
    
  3. Use "hdfs://{NameNodeHost}:8020/"

    For e.g.

    E:\HadoopTests\target>hadoop fs -ls hdfs://MBALLUR:8020/
    Found 6 items
    drwxrwxrwt   - hadoop  hdfs          0 2015-08-17 18:43 hdfs://MBALLUR:8020/app-logs
    drwxr-xr-x   - mballur hdfs          0 2015-11-24 15:36 hdfs://MBALLUR:8020/tmp
    drwxrwxr-x   - mballur hdfs          0 2015-10-20 15:27 hdfs://MBALLUR:8020/user
    

    In this case, "MBALLUR" is the name of my Name Node host.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!