Accessing video stored in HDFS over http

こ雲淡風輕ζ 提交于 2019-12-24 15:14:30

问题


I want to access videos which are stored in HDFS & show them in a web browser. I found this project ( https://github.com/yeleaveszi/Play-Videos-In-HDFS ) on github which exactly does this, but couldn't make it work.

Can anyone provide me some information or ways in which I could show the video stored in HDFS on a web browser. Also is it possible to get a HTTP link of the video which is stored in HDFS, I read about WebHDFS & HTTPFS but didn't understand much.

Any help would be appreciated. Thanks in advance!


回答1:


Using WebHDFS you can get a HTTP link of the data stored in HDFS. See this link https://www.linkedin.com/pulse/20140717115238-176301000-accessing-hdfs-using-the-webhdfs-rest-api-vs-httpfs to enable WebHDFS in your hadoop configuration.

So if your video say "test.mp4" is at the location "/user/test.mp4" in HDFS, then the corresponding HTTP link to open it would be "http://HOST:PORT/webhdfs/v1/PATH?op=OPEN&user.name=aawasthi" where fill your host address at HOST, port number at PORT (default 50070), HDFS path of video at PATH (here it would be '/user/test.mp4') and username in user.name

Just put the above HTTP link in any web browser having VLC Plugin & you can see the video which is stored in HDFS playing.



来源:https://stackoverflow.com/questions/37451685/accessing-video-stored-in-hdfs-over-http

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