通过oozie连接到HBase时出现异常。

时间:2012-08-28 07:06:01

标签: hbase oozie

当我尝试通过oozie连接到HBase时,我遇到以下异常:

`Failing Oozie Launcher, Main class [com.sample.util.HBaseBulkLoad], main() threw exception, org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation@6f36e7f3 closed
java.io.IOException: org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation@6f36e7f3 closed
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:794)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:782)
    at org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:249)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:213)
    at com.sample.dao.HBaseDao.bulkLoadUsingMapper(HBaseDao.java:191)
    at com.sample.util.HBaseBulkLoad.main(HBaseBulkLoad.java:32)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.oozie.action.hadoop.LauncherMapper.map(LauncherMapper.java:454)
    at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)
    at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:393)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:327)
    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:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1232)
    at org.apache.hadoop.mapred.Child.main(Child.java:264)`

我的workflow.xml看起来像这样,

`<workflow-app xmlns="uri:oozie:workflow:0.2" name="sample-wf">
<start to="java-node"/>
 <action name="java-node">
        <java>
            <job-tracker>${jobTracker}</job-tracker>
            <name-node>${nameNode}</name-node>
            <configuration>
                <property>
                    <name>mapred.job.queue.name</name>
                    <value>${queueName}</value>
                </property>
            </configuration>
            <main-class>com.sample.util.HBaseBulkLoad</main-class>
                <arg>TEST</arg>
                <arg>hdfs://centOS/user/sample/input/sample5.txt</arg>
                <arg>hdfs://centOS/user/sample/HFile</arg>
        </java>
        <ok to="end"/>
        <error to="fail"/>
    </action>
    <kill name="fail">
        <message>Java failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <end name="end"/>
</workflow-app>`

我可以使用 hadoop jar 命令运行jar文件,但不能使用oozie。我在java中设置了所有必需的配置。但仍然有例外。

HMaster HRegionServer 正在运行。 有谁知道,请帮助我......

1 个答案:

答案 0 :(得分:0)

确保运行Oozie作业的框可以访问Zookeeper服务器,否则HBaseClient将无法发现您的HRegionServers。