|
|
-
HRegionPartitioner breaks my configuration
Christoph Bauer 2012-05-09, 16:08
Hi,
first, I'm aware of HBASE-4398 though I don't know how that patch could work.
I'm on a cdh3u3 cluster with 4 nodes. hbase is 0.90.4.
The problem is zookeeper is running on port 2222
The following line results in a NPE when the mappers start: TableMapReduceUtil.initTableReducerJob("test2", IdentityTableReducer.class, job, HRegionPartitioner.class);
HBaseConfiguration.addHbaseResources in HRegionPartitioner.setConf overwrites quorum and clientPort with hbase-default.xml from hbase jar, maybe more. HBaseConfiguration.addHbaseResources also tries to load hbase-site.xml, but fails silently (not found as resource).
Can I make my mapreduce jobs aware of this resource. i.e. pass it to all the mappers or do I have to ask my administrator to make some changes? Thank you,
Christoph Bauer
-
Re: HRegionPartitioner breaks my configuration
Harsh J 2012-05-09, 17:17
Could you share your whole stack trace?
How do you launch your HBase+MR job? The ideal way is to simply do:
HADOOP_CLASSPATH=`hbase classpath` hadoop jar <hbase job jar> <args>
And this will take care of hbase-site.xml location appearing in the classpath as well. If you're using a package-installed environment, ensure /etc/hbase/conf/hbase-site.xml is populated with the right settings and if not, make such a file and:
export HBASE_CONF_DIR=/dir/that/contains/that/file
Before running the former command.
Let us know if this helps.
On Wed, May 9, 2012 at 9:38 PM, Christoph Bauer <[EMAIL PROTECTED]> wrote: > Hi, > > first, I'm aware of HBASE-4398 though I don't know how that patch could work. > > I'm on a cdh3u3 cluster with 4 nodes. hbase is 0.90.4. > > The problem is zookeeper is running on port 2222 > > The following line results in a NPE when the mappers start: > TableMapReduceUtil.initTableReducerJob("test2", > IdentityTableReducer.class, job, HRegionPartitioner.class); > > HBaseConfiguration.addHbaseResources in HRegionPartitioner.setConf > overwrites quorum and clientPort with hbase-default.xml from hbase > jar, maybe more. > HBaseConfiguration.addHbaseResources also tries to load > hbase-site.xml, but fails silently (not found as resource). > > Can I make my mapreduce jobs aware of this resource. i.e. pass it to > all the mappers or do I have to ask my administrator to make some > changes? > > > Thank you, > > Christoph Bauer
-- Harsh J
-
Re: HRegionPartitioner breaks my configuration
Christoph Bauer 2012-05-10, 10:08
Hi, thank you for your input.
I've been doing it exactly that way. Jars appear in the classpath without problems. But I am unable to transfer hbase-site.xml to the mapper's classpath.
So now I will try adding hbase-site.xml to the CP hadoop-env.sh.
The addDependencyJars mechanism does not work for xml files :(
2012/5/9 Harsh J <[EMAIL PROTECTED]>: > Could you share your whole stack trace? > > How do you launch your HBase+MR job? The ideal way is to simply do: > > HADOOP_CLASSPATH=`hbase classpath` hadoop jar <hbase job jar> <args> > > And this will take care of hbase-site.xml location appearing in the > classpath as well. If you're using a package-installed environment, > ensure /etc/hbase/conf/hbase-site.xml is populated with the right > settings and if not, make such a file and: > > export HBASE_CONF_DIR=/dir/that/contains/that/file > > Before running the former command. > > Let us know if this helps. > > On Wed, May 9, 2012 at 9:38 PM, Christoph Bauer > <[EMAIL PROTECTED]> wrote: >> Hi, >> >> first, I'm aware of HBASE-4398 though I don't know how that patch could work. >> >> I'm on a cdh3u3 cluster with 4 nodes. hbase is 0.90.4. >> >> The problem is zookeeper is running on port 2222 >> >> The following line results in a NPE when the mappers start: >> TableMapReduceUtil.initTableReducerJob("test2", >> IdentityTableReducer.class, job, HRegionPartitioner.class); >> >> HBaseConfiguration.addHbaseResources in HRegionPartitioner.setConf >> overwrites quorum and clientPort with hbase-default.xml from hbase >> jar, maybe more. >> HBaseConfiguration.addHbaseResources also tries to load >> hbase-site.xml, but fails silently (not found as resource). >> >> Can I make my mapreduce jobs aware of this resource. i.e. pass it to >> all the mappers or do I have to ask my administrator to make some >> changes? >> >> >> Thank you, >> >> Christoph Bauer > > > > -- > Harsh J
-
Re: HRegionPartitioner breaks my configuration
Harsh J 2012-05-10, 10:42
Christoph,
I still don't get your issue though. A stack trace of the error thrown out by the components you used would be good to have :)
On Thu, May 10, 2012 at 3:38 PM, Christoph Bauer <[EMAIL PROTECTED]> wrote: > Hi, > thank you for your input. > > I've been doing it exactly that way. Jars appear in the classpath > without problems. > But I am unable to transfer hbase-site.xml to the mapper's classpath. > > So now I will try adding hbase-site.xml to the CP hadoop-env.sh. > > The addDependencyJars mechanism does not work for xml files :( > > > > 2012/5/9 Harsh J <[EMAIL PROTECTED]>: >> Could you share your whole stack trace? >> >> How do you launch your HBase+MR job? The ideal way is to simply do: >> >> HADOOP_CLASSPATH=`hbase classpath` hadoop jar <hbase job jar> <args> >> >> And this will take care of hbase-site.xml location appearing in the >> classpath as well. If you're using a package-installed environment, >> ensure /etc/hbase/conf/hbase-site.xml is populated with the right >> settings and if not, make such a file and: >> >> export HBASE_CONF_DIR=/dir/that/contains/that/file >> >> Before running the former command. >> >> Let us know if this helps. >> >> On Wed, May 9, 2012 at 9:38 PM, Christoph Bauer >> <[EMAIL PROTECTED]> wrote: >>> Hi, >>> >>> first, I'm aware of HBASE-4398 though I don't know how that patch could work. >>> >>> I'm on a cdh3u3 cluster with 4 nodes. hbase is 0.90.4. >>> >>> The problem is zookeeper is running on port 2222 >>> >>> The following line results in a NPE when the mappers start: >>> TableMapReduceUtil.initTableReducerJob("test2", >>> IdentityTableReducer.class, job, HRegionPartitioner.class); >>> >>> HBaseConfiguration.addHbaseResources in HRegionPartitioner.setConf >>> overwrites quorum and clientPort with hbase-default.xml from hbase >>> jar, maybe more. >>> HBaseConfiguration.addHbaseResources also tries to load >>> hbase-site.xml, but fails silently (not found as resource). >>> >>> Can I make my mapreduce jobs aware of this resource. i.e. pass it to >>> all the mappers or do I have to ask my administrator to make some >>> changes? >>> >>> >>> Thank you, >>> >>> Christoph Bauer >> >> >> >> -- >> Harsh J
-- Harsh J
-
Re: HRegionPartitioner breaks my configuration
Christoph Bauer 2012-05-10, 11:44
2012/5/10 Harsh J <[EMAIL PROTECTED]>: > Christoph, > > I still don't get your issue though. A stack trace of the error thrown > out by the components you used would be good to have :) ok. ;)
$export HBASE_CONF_DIR=/etc/hbase/conf/ $export HADOOP_CLASSPATH=`hbase classpath` $hadoop jar test.jar simple.HtablePartitionerTest -wp ... 12/05/10 13:24:37 INFO mapred.JobClient: Running job: job_201205021601_0064 12/05/10 13:24:38 INFO mapred.JobClient: map 0% reduce 0% 12/05/10 13:24:56 INFO mapred.JobClient: Task Id : attempt_201205021601_0064_m_000000_0, Status : FAILED java.lang.NullPointerException at org.apache.hadoop.hbase.mapreduce.HRegionPartitioner.setConf(HRegionPartitioner.java:128) at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:62) at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:117) at org.apache.hadoop.mapred.MapTask$NewOutputCollector.<init>(MapTask.java:560) at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:639) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:323) at org.apache.hadoop.mapred.Child$4.run(Child.java:270) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:396) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1157) at org.apache.hadoop.mapred.Child.main(Child.java:264)
12/05/10 13:25:13 INFO mapred.JobClient: Task Id : attempt_201205021601_0064_m_000000_1, Status : FAILED java.lang.NullPointerException at org.apache.hadoop.hbase.mapreduce.HRegionPartitioner.setConf(HRegionPartitioner.java:128) at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:62) at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:117) at org.apache.hadoop.mapred.MapTask$NewOutputCollector.<init>(MapTask.java:560) at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:639) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:323) at org.apache.hadoop.mapred.Child$4.run(Child.java:270) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:396) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1157) at org.apache.hadoop.mapred.Child.main(Child.java:264)
12/05/10 13:25:30 INFO mapred.JobClient: Task Id : attempt_201205021601_0064_m_000000_2, Status : FAILED java.lang.NullPointerException at org.apache.hadoop.hbase.mapreduce.HRegionPartitioner.setConf(HRegionPartitioner.java:128) at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:62) at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:117) at org.apache.hadoop.mapred.MapTask$NewOutputCollector.<init>(MapTask.java:560) at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:639) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:323) at org.apache.hadoop.mapred.Child$4.run(Child.java:270) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:396) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1157) at org.apache.hadoop.mapred.Child.main(Child.java:264)
12/05/10 13:25:49 INFO mapred.JobClient: Job complete: job_201205021601_0064 12/05/10 13:25:49 INFO mapred.JobClient: Counters: 8 12/05/10 13:25:49 INFO mapred.JobClient: Job Counters 12/05/10 13:25:49 INFO mapred.JobClient: SLOTS_MILLIS_MAPS=69823 12/05/10 13:25:49 INFO mapred.JobClient: Total time spent by all reduces waiting after reserving slots (ms)=0 12/05/10 13:25:49 INFO mapred.JobClient: Total time spent by all maps waiting after reserving slots (ms)=0 12/05/10 13:25:49 INFO mapred.JobClient: Rack-local map tasks=3 12/05/10 13:25:49 INFO mapred.JobClient: Launched map tasks=4 12/05/10 13:25:49 INFO mapred.JobClient: Data-local map tasks=1 12/05/10 13:25:49 INFO mapred.JobClient: SLOTS_MILLIS_REDUCES=0 12/05/10 13:25:49 INFO mapred.JobClient: Failed map tasks=1 $ HtablePartitionerTest.java: package simple;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configured; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.mapreduce.HRegionPartitioner; import org.apache.hadoop.hbase.mapreduce.IdentityTableReducer; import org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil; import org.apache.hadoop.hbase.mapreduce.TableMapper; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.util.Tool; import org.apache.hadoop.util.ToolRunner; import org.apache.log4j.Level;
public class HtablePartitionerTest extends Configured implements Tool { public static void main(String[] args) throws Exception { int res = ToolRunner.run(new Configuration(), new HtablePartitionerTest(), args); System.exit(res); }
@Override public int run(String[] args) throws Exception { Configuration conf = getConf(); Job job = new Job(conf); job.setJobName("simple partitioner test");
TableMapReduceUtil.initTableMapperJob("test", new Scan(), Importer.class, ImmutableBytesWritable.class, Put.class, job);
TableMapReduceUtil.initTableReducerJob("test2", IdentityTableReducer.class, job, HRegionPartitioner.class);
job.setJarByClass(HtablePartitionerTest.class); TableMapReduceUtil.addDependencyJars(job); TableMapReduceUtil.addDependencyJars(job.getConfiguration(), com.google.common.base.Function.class);
job.waitForCompletion(true); return 0; }
/** * Importer converts Results to Puts */ s
|
|