r/DatabaseHelp • • Jan 23 '21

Problems with writing in hbase with MapReduce

Hi! I need to write into a Hbase table (that already exists) using Mapreduce and java. I am only converting data from a nljson to HBase, so I don't use a reducer. This is for a school project so I can not change the cluster configuration (and the teacher is not really quick to fix things), but it is supposed to be ok. I use maven to create a *.jar file, and I dispatch the work through yarn. However, I got an error message. It feels like I am not configuring well my environment or something, but I really could not find the problem. Maven compiles correctly.

This is the code : https://gist.github.com/Tangrenin/17b54e164e049562fc5f42322f97f607

I tried adding this line to the main function but it does nothing different : conf.addResource(new Path("/espace/Auber_PLE-203/hbase/conf/hbase-site.xml"));

Is there a problem to fix in my code, or could it actually by the because of the cluster configuration? Otherwise is there maybe another more appropriate way to write in HBase here ?

I would greatly appreciate any help!

Here is the error message :https://gist.github.com/Tangrenin/2ac850e377ff92a289a31f80485c762f

5 Upvotes

21 comments sorted by

View all comments

Show parent comment

1

u/teachmehowtodougie Jan 23 '21

No problem. Your site.xml files cover all of your settings for your jobs that you run. Which means those nodes running your mappers need to know how to communicate with HBase. They are looking at that path, most likelyhard coded in your MR(map reduce) code. That error is telling you it can't find the site file. There is a concept of a shared cache for MR job, or you can just use the file path like above, but all nodes need access