I use hbase client Scan to get data from remote hbase server cluster. When I set a Filter to the scan, the client will throw a exception:
我使用hbase客户端扫描从远程hbase服务器集群获取数据。当我为扫描设置一个过滤器时,客户端将抛出一个异常:
org.apache.hadoop.ipc:RemoteException:IPC server unable to read call parameters: Could not init org.apache.hadoop.hbase.util.Classes.
org.apache.hadoop。ipc:RemoteException: ipc服务器无法读取调用参数:无法初始化org.apache.hadoop.hbase.util.Classes。
The server side's hbase log:
服务器端hbase日志:
java.lang.NoClassDefFoundError:Could not initial class org.apache.hadoop.hbase.util.Classes at org.apache.hadoop.hbase.client.Scan.readFields(Scan.java:590)
. lang。NoClassDefFoundError:不能初始化class org.apache.hadoop.hbase.util。类在org.apache.hadoop.hbase.client.Scan.readFields(Scan.java:590)
But it works well without a Filter. By the way, the filter is NOT a custom Filter.
但它在没有过滤器的情况下运行良好。顺便说一下,过滤器不是自定义过滤器。
My hbase version is 0.94.10 and hadoop is 1.2.1. I have copy hadoop-core.jar to the lib directory under hbase.
我的hbase版本是0.94.10,hadoop版本是1.2.1。我已经复制hadoop核心。jar到hbase下的lib目录。
2 个解决方案
#1
1
The org.apache.hadoop.hbase.util.Classes
puts some initial code in its static block. So it will be initialized only once. When it initialize something the first time, if RunTimeException is thrown, it will not initialize anymore unless you restart your hbase cluster. In the initial block, it will create directory, and if it fails to create the directory, runtimeException will be thrown.
org.apache.hadoop.hbase.util。类将一些初始代码放在它的静态块中。所以它只初始化一次。当它第一次初始化某个东西时,如果抛出RunTimeException,它将不再初始化,除非重新启动hbase集群。在初始块中,它将创建目录,如果未能创建目录,则抛出runtimeException。
#2
1
During initialization of org.apache.hadoop.hbase.util.Classes
, if the configured value for "hbase.local.dir" doesn't exist, a runtime exception will be thrown and org.apache.hadoop.hbase.util.Classes
will fail to initialize. That runtime exception causes a ClassDefNotFoundException to be thrown which is what is eventually reported in the logs.
在初始化期间org.apache.hadoop.hbase.util。类,如果配置值为“hbase.local”。“不存在,一个运行时异常将被抛出和org.apache.hadoop.hbase.util。类将无法初始化。运行时异常导致抛出ClassDefNotFoundException,这是日志中最终报告的内容。
Make sure these exist and are writeable by HBase:
确保这些存在,并可由HBase写:
- hbase.local.dir (default: ${hbase.tmp.dir}/local)
- hbase.local。dir(默认值:$ { hbase.tmp.dir } /本地)
- hbase.tmp.dir (default: ${java.io.tmpdir}/hbase-${user.name})
- hbase.tmp。dir(默认值:$ { java.io.tmpdir } / hbase - $ { user.name })
#1
1
The org.apache.hadoop.hbase.util.Classes
puts some initial code in its static block. So it will be initialized only once. When it initialize something the first time, if RunTimeException is thrown, it will not initialize anymore unless you restart your hbase cluster. In the initial block, it will create directory, and if it fails to create the directory, runtimeException will be thrown.
org.apache.hadoop.hbase.util。类将一些初始代码放在它的静态块中。所以它只初始化一次。当它第一次初始化某个东西时,如果抛出RunTimeException,它将不再初始化,除非重新启动hbase集群。在初始块中,它将创建目录,如果未能创建目录,则抛出runtimeException。
#2
1
During initialization of org.apache.hadoop.hbase.util.Classes
, if the configured value for "hbase.local.dir" doesn't exist, a runtime exception will be thrown and org.apache.hadoop.hbase.util.Classes
will fail to initialize. That runtime exception causes a ClassDefNotFoundException to be thrown which is what is eventually reported in the logs.
在初始化期间org.apache.hadoop.hbase.util。类,如果配置值为“hbase.local”。“不存在,一个运行时异常将被抛出和org.apache.hadoop.hbase.util。类将无法初始化。运行时异常导致抛出ClassDefNotFoundException,这是日志中最终报告的内容。
Make sure these exist and are writeable by HBase:
确保这些存在,并可由HBase写:
- hbase.local.dir (default: ${hbase.tmp.dir}/local)
- hbase.local。dir(默认值:$ { hbase.tmp.dir } /本地)
- hbase.tmp.dir (default: ${java.io.tmpdir}/hbase-${user.name})
- hbase.tmp。dir(默认值:$ { java.io.tmpdir } / hbase - $ { user.name })