{"id":1313,"date":"2016-11-16T20:41:37","date_gmt":"2016-11-16T20:41:37","guid":{"rendered":"http:\/\/62.131.51.129\/?p=1313"},"modified":"2016-11-16T20:41:37","modified_gmt":"2016-11-16T20:41:37","slug":"putting-a-file-on-hdfs","status":"publish","type":"post","link":"http:\/\/archief.van-maanen.com\/?p=1313","title":{"rendered":"Putting a file on HDFS"},"content":{"rendered":"<p>Putting a file on HDFS is relatively easy. There are a few steps to take. Let us assume the file is on a linux system. The first step is to copy the file to an area where it can be stored with the hdfs user as its owner. On my system, I have \/tmp that has 777 privs: here files with every owner can be stored. So I copy my file to that area:<\/p>\n<pre>\ncp \/root\/uit \/tmp\n<\/pre>\n<p>Now, I have got the file in an area where the user as I use in my HDFS platform can be set as owner to the file.<br \/>\nThe user I have on my HDFS plaform is &#8220;hdfs&#8221;. I set the file with &#8220;hdfs&#8221; as owner with:<\/p>\n<pre>\nchown hdfs:hdfs \/tmp\/uit\n<\/pre>\n<p>Now the file uit has hdfs as owner. I can now put it on HDFS with: <\/p>\n<pre>\nsudo -u hdfs hadoop fs -put \/tmp\/uit \/Chapter5\/uit\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Putting a file on HDFS is relatively easy. There are a few steps to take. Let us assume the file is on a linux system. The first step is to copy the file to an area where it can be stored with the hdfs user as its owner. On my system, I have \/tmp that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1314,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1313","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/1313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1313"}],"version-history":[{"count":0,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/1313\/revisions"}],"wp:attachment":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1313"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}