【问题标题】:hive-site.xml path in hive0.13.1hive0.13.1 中的 hive-site.xml 路径
【发布时间】:2014-12-01 23:55:18
【问题描述】:

我是新手。我想知道hive-0.13.1 版本中的hive-site.xmlhive-default.xml 文件位置。

我从以下位置下载了hive0.13.1-bin 版本。 http://apache.mirrors.pair.com/hive/hive-0.13.1/

提取然后配置 hive 环境变量。
我可以运行命令(create table, show, load data, query table..)

但在conf(/hive/hive-0.13-1/conf) 目录中,我看不到hive-site.xmlhive-default.xml 文件。

这些文件在hive-0.13.1 版本中的位置?

【问题讨论】:

    标签: hive hiveql


    【解决方案1】:

    按照步骤进行

    1) 解压文件夹

    2) 转到 /apache-hive-0.13.1-bin/conf 并复制 hive-default.xml.template ,它看起来像 hive-default.xml (copy).template。

    3) 将 hive-default.xml (copy).template 重命名为 hive-site.xml。

    4) 将 hive-env.sh.template 复制到 hive-env.sh。

    在 hive-env.sh 中添加

    export HADOOP_HEAPSIZE=1024
    # Set HADOOP_HOME to point to a specific hadoop install directory
    export HADOOP_HOME=/home/user17/BigData/hadoop
    
    #hive 
    export HIVE_HOME=/home/user17/BigData/hive
    # Hive Configuration Directory can be controlled by:
    export HIVE_CONF_DIR=$HIVE_HOME/conf
    

    5) 在 .bashrc 文件中导出 hadoop 和 hive 路径

    export HADOOP_HOME=/home/user17/BigData/hadoop
    export PATH=$PATH:$HADOOP_HOME/bin
    
    export HIVE_HOME=/home/user17/BigData/hive
    export PATH=$PATH:$HIVE_HOME/bin
    

    通过

    开始你的hadoop
    start-all.sh
    

    享受你的 hive。根据你的系统在 export 命令中给出 hadoop 和 hive 路径。如果不起作用,请告诉我。

    【讨论】:

    • 感谢 Kishore 提供的步骤。我正在创建文件。
    【解决方案2】:

    您可以在 conf 目录中找到hive-site.xml.template 文件。 您应该将其设置为 hive-site.xml 并添加以下配置:

    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
    <!--
       Licensed to the Apache Software Foundation (ASF) under one or more
       contributor license agreements.  See the NOTICE file distributed with
       this work for additional information regarding copyright ownership.
       The ASF licenses this file to You under the Apache License, Version 2.0
       (the "License"); you may not use this file except in compliance with
       the License.  You may obtain a copy of the License at
    
           http://www.apache.org/licenses/LICENSE-2.0
    
       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.
    -->
    
    <configuration>
    
        <property>
            <name>javax.jdo.option.ConnectionURL</name>
            <value>jdbc:mysql://localhost/metastore?createDatabaseIfNotExist=true</value>
            <description>the URL of the MySQL database</description>
        </property>
    
        <property>
            <name>javax.jdo.option.ConnectionDriverName</name>
            <value>com.mysql.jdbc.Driver</value>
        </property>
    
        <property>
            <name>javax.jdo.option.ConnectionUserName</name>
            <value>root</value>
        </property>
    
        <property>
            <name>javax.jdo.option.ConnectionPassword</name>
            <value>root</value>
        </property>
    <property>
      <name>hive.hwi.listen.host</name>
      <value>0.0.0.0</value>
    </property>
    <property>
      <name>hive.hwi.listen.port</name>
      <value>9999</value>
    </property>
    <property>
      <name>hive.hwi.war.file</name>
      <value>lib/hive-hwi-0.12.0.war</value>
    </property>
    <!--
    <property>
      <name>hive.metastore.local</name>
      <value>true</value>
    </property>
    -->
    </configuration>
    

    如果未在所选数据库(mysql)中退出,则使用命令在 mysql 中创建元数据。

    【讨论】:

    • 谢谢拉维。我现在已经创建了 hive-site.xml 文件。
    猜你喜欢
    • 2012-12-30
    • 2014-02-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-22
    • 2019-06-09
    • 1970-01-01
    相关资源
    最近更新 更多