1/About classs MetaEditor. We should add a parameter:
private volatile Configuration configuration;
It cans get some client configure and use to
for (int tries = 0; tries < numRetries && retry; ++tries) {
catalogTracker.waitForMetaServerConnectionDefault().put(
CatalogTracker.META_REGION, put);
}
2/Or createTable function may be modified:
int numRetries = conf.getInt("hbase.client.retries.number", 10);
// 3. Insert into META
for (int tries = 0; tries < numRetries; tries++) {
try {
MetaEditor.addRegionToMeta(catalogTracker, region.getRegionInfo());
}
catch (IOException e)
{
LOG.warn("Insert meta failed", e);
}
}
-----邮件原件-----
发件人: [email protected] [mailto:[email protected]] 代表 Stack
发送时间: 2011年4月27日 2:48
收件人: [email protected]
主题: Re: A question about create table with regions in hbase version 0.90.3
How would you fix it Gaojinchao?
St.Ack
2011/4/25 Gaojinchao <[email protected]>:
> Thank you for your reply.
>
> I don't change it. It is default.
> But I think it is not the case the meta table doesn't assigned.
> It had got it and been putting some data into meta table,
>
> org.apache.hadoop.ipc.RemoteException: java.io.IOException: Server not
> running at
> org.apache.hadoop.hbase.regionserver.HRegionServer.checkOpen(HRegionServer.java:2335)
>
> // I mean that the exception of put function is not caught and processed.
> Does it need to do ?
>
> at
> org.apache.hadoop.hbase.regionserver.HRegionServer.put(HRegionServer.java:1647)
> at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
>
>
>
>
>
> -----邮件原件-----
> 发件人: Ted Yu [mailto:[email protected]]
> 发送时间: 2011年4月26日 12:13
> 收件人: [email protected]
> 主题: Re: A question about create table with regions in hbase version 0.90.3
>
> waitForMetaServerConnectionDefault() calls waitForMeta() which should have
> waited for "hbase.master.catalog.timeout"
> What's the value for "hbase.master.catalog.timeout" on your cluster ?
>
> Thanks
>
> 2011/4/25 Gaojinchao <[email protected]>
>
>> In client code Put data into Region server has one more times:
>> eg:
>> public void processBatch(List<Row> list,
>> ....
>> for (int tries = 0; tries < numRetries && retry; ++tries) { // if
>> put data failed and try to do.
>> ...
>>
>> In function addRegionToMeta. Does it need to do this ?
>>
>> catalogTracker.waitForMetaServerConnectionDefault().put( // does need try
>> again ? It fails for checkOpen because of Region server is shutdowned.
>>
>> hmaster logs show
>>
>> "org.apache.hadoop.hbase.regionserver.HRegionServer.checkOpen(HRegionServer.java:2335)"
>>
>>
>> -----邮件原件-----
>> 发件人: Ted Yu [mailto:[email protected]]
>> 发送时间: 2011年4月25日 21:25
>> 收件人: [email protected]
>> 主题: Re: A question about create table with regions in hbase version 0.90.3
>>
>> Can you give more detail as to how many region servers were shutting down ?
>>
>> Thanks
>>
>> 2011/4/25 Gaojinchao <[email protected]>
>>
>> > I merge issue HBASE-3744 to 0.90.2 and test it.
>> > Find that Creating table fails when region server shutdown
>> >
>> > Does it need try to one more times for putting Meta data?
>> >
>> > public static void addRegionToMeta(CatalogTracker catalogTracker,
>> > HRegionInfo regionInfo)
>> > throws IOException {
>> > Put put = new Put(regionInfo.getRegionName());
>> > put.add(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER,
>> > Writables.getBytes(regionInfo));
>> > catalogTracker.waitForMetaServerConnectionDefault().put(
>> > // try again ?
>> > CatalogTracker.META_REGION, put);
>> > LOG.info("Added region " + regionInfo.getRegionNameAsString() + " to
>> > META");
>> > }
>> >
>> > Client logs:
>> > 11/04/25 17:22:51 INFO
>> client.HConnectionManager$HConnectionImplementation:
>> > Closed zookeeper sessionid=0x12f8be0d9b7000b
>> > 11/04/25 17:22:51 INFO zookeeper.ZooKeeper: Session: 0x12f8be0d9b7000b
>> > closed
>> > 11/04/25 17:22:51 INFO zookeeper.ClientCnxn: EventThread shut down
>> > org.apache.hadoop.ipc.RemoteException:
>> > org.apache.hadoop.ipc.RemoteException: java.io.IOException: Server not
>> > running
>> > at
>> >
>> org.apache.hadoop.hbase.regionserver.HRegionServer.checkOpen(HRegionServer.java:2335)
>> > at
>> >
>> org.apache.hadoop.hbase.regionserver.HRegionServer.put(HRegionServer.java:1647)
>> > at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
>> > at
>> >
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> > at java.lang.reflect.Method.invoke(Method.java:597)
>> > at
>> > org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
>> > at
>> >
>> org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
>> >
>> > at
>> > org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:771)
>> > at
>> > org.apache.hadoop.hbase.ipc.HBaseRPC$Invoker.invoke(HBaseRPC.java:257)
>> > at $Proxy6.put(Unknown Source)
>> > at
>> >
>> org.apache.hadoop.hbase.catalog.MetaEditor.addRegionToMeta(MetaEditor.java:57)
>> > at
>> > org.apache.hadoop.hbase.master.HMaster.createTable(HMaster.java:804)
>> > at
>> > org.apache.hadoop.hbase.master.HMaster.createTable(HMaster.java:780)
>> > at
>> > org.apache.hadoop.hbase.master.HMaster.createTable(HMaster.java:747)
>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> > at
>> >
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> > at
>> >
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> > at java.lang.reflect.Method.invoke(Method.java:597)
>> > at
>> > org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
>> > at
>> >
>> org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
>> >
>> > at
>> > org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:771)
>> > at
>> > org.apache.hadoop.hbase.ipc.HBaseRPC$Invoker.invoke(HBaseRPC.java:257)
>> > at $Proxy4.createTable(Unknown Source)
>> > at
>> >
>> org.apache.hadoop.hbase.client.HBaseAdmin.createTableAsync(HBaseAdmin.java:340)
>> > at
>> >
>> org.apache.hadoop.hbase.client.HBaseAdmin.createTable(HBaseAdmin.java:302)
>> > at
>> >
>> com.huawei.smartcare.performanceTuning.createTable.main(createTable.java:103)
>> >
>>
>