2012-09-12 87 views
0

我在2節點hadoop上運行配置單元和hbase。 我使用的是hadoop-0.20.205.0,hive-0.9.0,hbase-0.92.0和zookeeper-3.4.2。hive/hbase集成上的MR scratch問題

配置單元和hbase可以單獨工作。然後我按照這本手冊整合了hive和hbase。 https://cwiki.apache.org/confluence/display/Hive/HBaseIntegration

蜂房開始沒有錯誤,我創建的示例表

CREATE TABLE hbase_table_1(key int, value string) 
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' 
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,cf1:val") 
TBLPROPERTIES ("hbase.table.name" = "xyz"); 

show tables在蜂巢和listscan在HBase的效果很好。 但是,當我在select * from hbase_table_1;蜂巢,我得到的錯誤

2012-09-12 11:25:56,975 ERROR ql.Driver (SessionState.java:printError(400)) - FAILED: Hive Internal Error: java.lang.RuntimeException(Error while making MR scratch directory - check filesystem config (null)) 
java.lang.RuntimeException: Error while making MR scratch directory - check filesystem config (null) 
... 
Caused by: java.lang.IllegalArgumentException: Wrong FS: hdfs://10.10.10.15:54310/tmp/hive-hadoop/hive_2012-09-12_11-25-56_602_1946700606338541381, expected: hdfs://hadoop01:54310 

它說FS是錯的,但我不認爲這是正確的配置FS這樣的路徑,我應該在哪裏配置呢?

這是我的配置文件。 hadoop01的ip地址是10.10.10.15。

HBase的-site.xml中

<configuration> 
<property> 
    <name>hbase.zookeeper.property.clientPort</name> 
    <value>2222</value> 
</property> 


<property> 
    <name>hbase.zookeeper.quorum</name> 
    <value>10.10.10.15</value> 
    <description>The directory shared by RegionServers. 
    </description> 
</property> 
<property> 
    <name>hbase.zookeeper.property.dataDir</name> 
    <value>/home/hadoop/datas/zookeeper</value> 
    <description>Property from ZooKeeper's config zoo.cfg. 
     The directory where the snapshot is stored. 
    </description> 
</property> 

<property> 
    <name>hbase.rootdir</name> 
    <value>hdfs://hadoop01:54310/hbase</value> 
    <description>The directory shared by RegionServers. 
    </description> 
</property> 
<property> 
    <name>hbase.cluster.distributed</name> 
    <value>true</value> 
    <description>The mode the cluster will be in. Possible values are 
     false: standalone and pseudo-distributed setups with managed Zookeeper 
     true: fully-distributed with unmanaged Zookeeper Quorum (see hbase-env.sh) 
    </description> 
</property> 

任何人都可以幫助嗎?

回答

0

我自己解決了。

修改$ HADOOP_HOME/conf/core-site.xml,將dfs.default.name從ip改爲hostname。這樣

<property> 
    <name>fs.default.name</name> 
    <value>hdfs://hadoop01:54310/</value> 
</property> 

確保此屬性和在HBase的-site.xml中使用相同的主機名或IP hbase.rootdir財產。