HBase coprocessor not updating after redeploy

2020-05-08 07:32发布

问题:

I'm using HBase 1.1.2, and trying to redeploy a custom endpoint coprocessor to fix an error in my Java code. I made some changes to the coprocessor code and redeployed it via the following steps:

  1. Rebuild the coprocessor jar
  2. Copy it to a location on the HDFS
  3. Remove the existing coprocessor: alter 'table', METHOD => 'table_att_unset',NAME => 'coprocessor$1'
  4. Confirm through the HBase UI that the table has no coprocessors attached
  5. Add the new coprocessor by disabling the table and running alter 'table', METHOD => 'table_att', 'coprocessor'=>'hdfs:///user/bwatson/sum-coprocessor-0.1.0-SNAPSHOT.jar|uk.co.hadoopathome.coprocessor.SumAndCountEndpoint||'
  6. Re-enable the table
  7. Confirm through the HBase UI that the coprocessor has been attached

When I re-run my client code that talks to the coprocessor, I can clearly see in the regionserver logs that the old coprocessor code is still running.

If I search for the jar locally on the regionserver that hosts my table, I see that the jar is only in one location:

find / -name "*um-coprocesso*"
/tmp/hbase-hbase/local/jars/tmp/.2107072457.sum-coprocessor-0.1.0-SNAPSHOT.jar.1522237762363.jar
/tmp/hbase-hbase/local/jars/tmp/..2107072457.sum-coprocessor-0.1.0-SNAPSHOT.jar.1522237762363.jar.crc

I can confirm from the date and size of this jar that it is the old version.

Is this a bug in HBase? How can I get around this?

回答1:

Restarting HBase did the trick; the jar in /tmp/hbase-hbase/local/jars/tmp/ was removed, and my next deploy was successful.

This is a bug in HBase, either in the documentation or the code. I'll raise a ticket with the HBase Jira.



回答2:

you need to restart hbase server.

cd $HBASE_HOME/bin
$sh stop-hbase.sh
$sh start-hbase.sh

you cann't change coprocessor jar file when hbase is running. so you should restart hbase server after your step 6.



标签: hadoop hbase