Hive的安装

时间:2022-11-13 05:49:24
Hive的安装
 
第一步:解压并安装:第二步:配置
1)root用户下,解压后,改名为hive,并将hive文件夹赋给hadoop用户
  tar -zxvf hive-0.9.0.tar.gz -C /opt
  mv hive-0.9.0.tar.gz hive
  chown -R hadoop:hadoop hive
 
第二步:配置
在hadoop用户下
1)配置vi hive-env.sh:
hive/conf文件夹下提供了一个模板文件hive-env.sh.template,复制一份并改名为hive-env.sh
  cp hive-env.sh.template hive-env.sh

  vi hive-env.sh

      添加下面内容
    export JAVA_HOME=/usr/program/jdk1.6.0_13/
    export HIVE_HOME=/opt/hive
    export PATH=$PATH:$HIVE_HOME/bin
    export HADOOP_HOME=/home/hadoop/hadoop-env/hadoop-1.0.1
 
 
2)配置hive-site.xml
    a)vi hive-default.xml.template
        复制该文件前面的部分,如下:

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

b)touch hive-site.xml

      vi hive-site.xml   --将刚复制的内容粘贴到该文件中,需添加</configuration>

第三步:启动Hive

  cd /opt/hive/bin
  ./hive

效果图:

Hive的安装

Hive的安装

启动过程中可能遇见的问题

Hive的安装

解决办法:

修改hadoop的配置文件hadoop-env.sh,修改内容如下:
export HADOOP_CLASSPATH=.:$CLASSPATH:$HADOOP_CLASSPATH:$HADOOP_HOME/bin