HBase、hadoop、hive通过hive访问Hbase的正确设置方法是什么?

What is the right way to set up HBase, hadoop, hive to access Hbase through hive?

我在配置和安装 hbase/hadoop/hive 时遇到问题。到目前为止,我在 ubuntu 14.04.3 LTS 的虚拟机上做了什么:

https://askubuntu.com/questions/56104/how%E2%80%8B-can-i-install-sun-o%E2%80%8Bracles-proprietary-j%E2%80 %8Bava-jdk-6-7-8-or-jre%E2%80%8B

核心site.xml:

 <configuration>
    <property>
      <name>fs.default.name</name>
      <value>hdfs://localhost:9000</value>
    </property>
    </configuration>

hadoop-env.sh

 export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_60

hdfs-site.xml

  <configuration>
    <property>
            <name>dfs.replication</name>
            <value>1</value>
        </property>
    <property>
        <name>dfs.namenode.name.dir</name>
        <value>file:///home/hfu/hadoop/hdfs/namenode</value>
    </property>
    <property>
        <name>dfs.datanode.data.dir</name>
        <value>file:///home/hfu/hadoop/hdfs/datanode</value>
    </property>
    </configuration>

hbase-env.sh

导出 JAVA_HOME=/usr/lib/jvm/jdk1.8.0_60/

hbase-site.xml

  <configuration>
    <property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
    </property>
    <property>
    <name>hbase.rootdir</name>
    <value>file:///home/hfu/hbase-0.98.0-hadoop2/data</value>
    </property>
    <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/home/hfu/hbase-0.98.0-hadoop2/zookeeper</value>
    </property>
    <property>
    <name>zookeeper.znode.parent</name>
    <value>/hbase-unsecure</value>
    </property>
    <property>
    <name>hbase.zookeeper.quorum</name>
    <value>ubuntu</value>
    </property>
    <property>
    <name>hbase.master</name>
    <value>ubuntu:16000</value>
    </property>
    <property>
    <name>hbase.zookeeper.property.clientPort</name>
    <value>2181</value>
    </property>
    </configuration>

蜂巢-enf.sh

export HADOOP_HOME=/home/hfu/hadoop-2.6.1

start hadoop:

sbin/start-all.sh

start hbase:

bin/start-hbase.sh

在 HBASE shell 中创建 table 成为可能。我也可以将一些条目放入其中。 在我 start hive

之前,我也在控制台中写了这个
export HADOOP_USER_CLASSPATH_FIRST=true

防止异常

在 Hive 中,可以创建一个 table 并从中读取内容。但是一旦我想按照一些教程中的描述将两者连接在一起

http://chase-seibert.github.io/blog/2013/05/10/hive-hbase-quickstart.html

http://www.n10k.com/blog/hbase-via-hive-pt1/

我遇到异常。我还在另一个 post 中描述了我的问题,但这个更详细:

我使用了错误版本的 HBase 和 Hadoop。这是一个概述,hadoop 和 HBase 的哪些版本是兼容的。 http://hbase.apache.org/book.html#hadoop