Accessing video stored in HDFS over http

2019-07-27 04:07发布

问题:

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.