基于hadoop2.7.1版本
一、简介
1、 WebHDFS官方简介:
Introduction
The HTTP REST API supports the complete FileSystem/FileContext interface for HDFS.
2、HttpFS GateWay官方简介:
HttpFS is a server that provides a REST HTTP gateway supporting all HDFS File System operations (read and write). And it is inteoperable with the webhdfs REST HTTP API.
HttpFS can be used to transfer data between clusters running different versions of Hadoop (overcoming RPC versioning issues), for example using Hadoop DistCP.
HttpFS can be used to access data in HDFS on a cluster behind of a firewall (the HttpFS server acts as a gateway and is the only system that is allowed to cross the firewall into the cluster).
HttpFS can be used to access data in HDFS using HTTP utilities (such as curl and wget) and HTTP libraries Perl from other languages than Java.
The webhdfs client FileSytem implementation can be used to access HttpFS using the Hadoop filesystem command (hadoop fs) line tool as well as from Java aplications using the Hadoop FileSystem Java API.
HttpFS has built-in security supporting Hadoop pseudo authentication and HTTP SPNEGO Kerberos and other pluggable authentication mechanims. It also provides Hadoop proxy user support.
二、使用原因:
二者都提供基于REST的API,这使得一个集群外的host可以不用安装HADOOP和JAVA环境就可以对集群内的HADOOP进行访问,并且client不受语言的限制。
三、两者的区别:
1、WebHDFS是HDFS内置的、默认开启的一个服务,而HttpFS是HDFS一个独立的服务,若使用需要配置并手动开启。
2、HttpFS重在后面的GateWay。即WebHDFS面向的是集群中的所有节点,首先通过namenode,然后转发到相应的datanode,而HttpFS面向的是集群中的一个节点(相当于该节点被配置为HttpFS的GateWay)
3、WebHDFS是HortonWorks开发的,然后捐给了Apache;而HttpFS是Cloudera开发的,也捐给了Apache。
四、使用步骤:
1、使用WebHDFS的步骤:
(1)WebHDFS服务内置在HDFS中,不需额外安装、启动。需要在hdfs-site.xml打开WebHDFS开关,此开关默认打开。
<property>
<name>dfs.webhdfs.enabled</name>
<value>true</value>
</property>
(2)连接NameNode的50070端口进行文件操作。
curl "http://ctrl:50070/webhdfs/v1/?op=liststatus&user.name=root"
2、使用HttpFS GateWay的步骤:
(1)根据需求配置:httpfs-site.xml
(2)配置:hdfs-site.xml,需要增加如下配置,其他两个参数名称中的root代表的是启动hdfs服务的OS用户,应以实际的用户名称代替。
<property>
<name>hadoop.proxyuser.root.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.root.groups</name>
<value>*</value>
</property>
(3)启动:
ln -s /usr/hdp/2.3.0.0-2557/hadoop-httpfs/webapps /etc/hadoop-httpfs/tomcat-deployment/webapps
sbin/httpfs.sh start
sbin/httpfs.sh stop
启动后,默认监听14000端口:
[hadoop@master hadoop]# netstat -antp | grep 14000
tcp 0 0 :::14000 :::* LISTEN 7415/java
[hadoop@master hadoop]#
(4)使用:
#curl -i -L "http://HttpFS_host:14000/webhdfs/v1/foo/bar?op=OPEN"
#hdfs dfs -ls webhdfs://HttpFS_host:14000/
参考文章:
相关推荐
HttpFS Gateway Short Circuit Local Reads Centralized Cache Management HDFS NFS Gateway HDFS Rolling Upgrade Extended Attributes Transparent Encryption HDFS Support for Multihoming Archival ...
McAfee:registered: Secure Web Gateway可保护您免受Web附带的威胁(如间谍软件、不适当Web内容、网络钓鱼诈骗攻击、病毒、蠕虫和木马)的侵扰。Secure Web Gateway能够帮助您提高员工生产力,提高您的可用带宽,...
McAfee_Web_Gateway产品手册 McAfee_Web_Gateway产品手册 McAfee_Web_Gateway产品手册
命令php think worker:gateway在windows下运行...根据GatewayWorker-for-win提供的demo修改的 本资源依赖GatewayWorker扩展,请先安装扩展。 使用方法,把解压后的文件夹放到项目根目录,双击start_for_win.bat,启动
赠送jar包:spring-cloud-gateway-server-3.1.1.jar; 赠送原API文档:spring-cloud-gateway-server-3.1.1-javadoc.jar; 赠送源代码:spring-cloud-gateway-server-3.1.1-sources.jar; 赠送Maven依赖信息文件:...
Gateway education tool
Spring Cloud Gateway的全局异常处理 Spring Cloud Gateway中的全局异常处理不能直接用@ControllerAdvice来处理,通过跟踪异常信息的抛出,找到对应的源码,自定义一些处理逻辑来符合业务的需求。 网关都是给接口做...
Spring官方博客发布了一篇关于Spring Cloud Gateway的CVE报告,据公告描述,当启用和暴露 Gateway Actuator 端点时,使用 Spring Cloud Gateway 的应用程序可受到代码注入攻击。攻击者可以发送特制的恶意请求,从而...
赠送jar包:spring-cloud-gateway-server-3.0.4.jar; 赠送原API文档:spring-cloud-gateway-server-3.0.4-javadoc.jar; 赠送源代码:spring-cloud-gateway-server-3.0.4-sources.jar; 赠送Maven依赖信息文件:...
赠送jar包:spring-cloud-gateway-server-3.1.1.jar; 赠送原API文档:spring-cloud-gateway-server-3.1.1-javadoc.jar; 赠送源代码:spring-cloud-gateway-server-3.1.1-sources.jar; 赠送Maven依赖信息文件:...
spring-boot-gateway 整合网关gateway +注册中心 有注释 打开可运行 妈妈再也不用担心我的网关不会用了
oracle 11g gateway
REST即Representational State Transfer可重新表达的状态迁移,是一种应用较广泛的实时可靠的IT信息传递方式,目前在很多场合取代了Web Service进行部署。 REST客户端能够侦测PLC变量,一旦发生变化,则自动调用MES ...
赠送jar包:sentinel-api-gateway-adapter-common-1.8.0.jar; 赠送原API文档:sentinel-api-gateway-adapter-common-1.8.0-javadoc.jar; 赠送源代码:sentinel-api-gateway-adapter-common-1.8.0-sources.jar; ...
camunda并行网关Parallel Gateway与包容性网关Inclusive Gateway.doc
Openfire的IM Gateway插件kraken-gateway.jar 版本V1.1.2Openfire的IM Gateway插件kraken-gateway.jar 版本V1.1.2Openfire的IM Gateway插件kraken-gateway.jar 版本V1.1.2
springcloud gateway 全局滤器 统一签名判定
开箱即用的微服务认证授权架构 ... 方案一: spring-gateway作为网关,具备熔断,负载,限流,统一操作日志,认证权限拦截等功能 ,过滤器统一异常...而gateway则更注重性能,WebFlux 非阻塞式web框架,性能是zuul的1.7倍。
赠送jar包:sentinel-spring-cloud-gateway-adapter-1.8.0.jar; 赠送原API文档:sentinel-spring-cloud-gateway-adapter-1.8.0-javadoc.jar; 赠送源代码:sentinel-spring-cloud-gateway-adapter-1.8.0-sources....
在接入Spring-Cloud-Gateway时,可能有需求进行缓存Json-Body数据或者Form-Urlencoded数据的情况。这篇文章主要介绍了SpringCloud Finchley Gateway 缓存请求Body和Form表单的实现,感兴趣的小伙伴们可以参考一下