如何在没有hadoop的情况下使用Hive

Tio*_*oma 7 hadoop hive hdfs

我是NoSQL解决方案的新手,想和Hive一起玩.但是安装HDFS/Hadoop需要大量的资源和时间(可能没有经验,但我没有时间去做).

有没有办法在没有HDFS/Hadoop的本地机器上安装和使用Hive?

小智 12

是的,您可以在没有hadoop的情况下运行配置单元1.在本地系统上创建仓库2.将默认值设置为file:///,而不是在本地模式下运行配置单元而不安装hadoop

在Hive-site.xml中

<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> 
<configuration>
      <property>
         <name>hive.metastore.schema.verification</name> 
         <value>false</value> 
      </property> 
     <property> 
      <!-- this should eventually be deprecated since the metastore should supply this --> 
        <name>hive.metastore.warehouse.dir</name> 
        <value>file:///tmp</value>
        <description></description> 
     </property>
     <property> 
        <name>fs.default.name</name> 
        <value>file:///tmp</value> 
     </property> 
</configuration>
Run Code Online (Sandbox Code Playgroud)

  • 准确地说,这意味着从 hadoop 集群运行没有 HDFS 的 Hive,它仍然需要 CLASSPATH 中来自 hadoop-core 的 jars,以便可以启动 hive server/cli/services。顺便说一句,`hive.metastore.schema.verification` 是关于 Metastore 模式验证的,如果你有一个带有现有模式的 Metastore DB,这个答案是可选的。 (2认同)