hive-site.xml path in hive0.13.1

2019-01-25 16:53发布

I'm a newbie. I would like to know the hive-site.xml and hive-default.xml files locations in hive-0.13.1 version.

I have downloaded hive0.13.1-bin version from the below location. http://apache.mirrors.pair.com/hive/hive-0.13.1/

Extracted and then configured hive environment variables.
I'm able to run the commands(create table, show, load data, query table..).

But in the conf(/hive/hive-0.13-1/conf) directory, I do not see hive-site.xml and hive-default.xml files.

Where these files are located in hive-0.13.1 version?

标签: hive hiveql
2条回答
Evening l夕情丶
2楼-- · 2019-01-25 17:42

You can't find hive-site.xml file in conf directory. You should make it. And hive-site.xml look like this:

<?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>

And search some concepts on hive metadata in mysql.

查看更多
3楼-- · 2019-01-25 17:44

follow the steps

1) Extract folder

2)go to /apache-hive-0.13.1-bin/conf and make a copy of hive-default.xml.template , it looks like hive-default.xml (copy).template.

3) Rename hive-default.xml (copy).template to hive-site.xml.

4) Make a copy of hive-env.sh.template to hive-env.sh.

add in 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) export hadoop and hive path in .bashrc file

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

start your hadoop by

start-all.sh

enjoy with your hive.Give the hadoop and hive path in export command according to your system.let me know if not work.

查看更多
登录 后发表回答