org.apache.hadoop.hbase.TableNotDisabledException 解决方法

时间:2022-07-13 08:26:22

Exception in thread "main" org.apache.hadoop.hbase.TableNotDisabledException: org.apache.hadoop.hbase.TableNotDisabledException: log2
    at org.apache.hadoop.hbase.master.HMaster.checkTableModifiable(HMaster.java:1488)
    at org.apache.hadoop.hbase.master.handler.TableEventHandler.<init>(TableEventHandler.java:72)
    at org.apache.hadoop.hbase.master.handler.TableDeleteFamilyHandler.<init>(TableDeleteFamilyHandler.java:41)
    at org.apache.hadoop.hbase.master.HMaster.deleteColumn(HMaster.java:1393)
    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.WritableRpcEngine$Server.call(WritableRpcEngine.java:320)
    at org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1426)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at org.apache.hadoop.hbase.RemoteExceptionHandler.decodeRemoteException(RemoteExceptionHandler.java:96)
    at org.apache.hadoop.hbase.client.HBaseAdmin.deleteColumn(HBaseAdmin.java:1058)
    at org.apache.hadoop.hbase.client.HBaseAdmin.deleteColumn(HBaseAdmin.java:1042)
    at hbase.DeleteColumn.main(DeleteColumn.java:18)

删除列必须先关闭表,之后再删除列,删除完成后再开启表。

hbaseadmin.disableTable(“表名”);

hbaseadmin.deleteColumn(“列名”);

hbaseadmin.enableTable(“表名”);