【发布时间】:2016-09-01 07:31:19
【问题描述】:
我正在尝试从 Webhdfs rest api 获取 liststatus,但出现以下错误。
XMLHttpRequest cannot load http://<IP>:50070/webhdfs/v1/?op=LISTSTATUS. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.
当我尝试通过 curl 访问时,它加载成功。但是当我尝试使用 AngularJS $http.get 获取它时它失败了。
有没有办法在 Hadoop core-site.xml 或其他地方启用跨域访问?
【问题讨论】:
标签: javascript angularjs rest hadoop webhdfs