欢迎投稿

今日深度:

hive安装配置,

hive安装配置,


我们这里用的是本地模式—–metstore存在mysql数据库中
首相:sudo apt-get update 更新一下
sudo apt-get install mysql-server 下载mysql
安装 hive

让我们看看hive的结构图吧:

1.首相解压:tar -zxvf ...
cd conf
cp hive-env.sh.template hive-env.sh
修改一下内容:
export HADOOP_HEAPSIZE=1024

HADOOP_HOME=/home/spark/app/hadoop-2.4.1

export HIVE_CONF_DIR=/home/spark/app/apache-hive-0.13.1-bin/conf

export HIVE_AUX_JARS_PATH=/home/spark/app/apache-hive-0.13.1-bin/lib


2.然后再本目录中vim hive-site.xml填写如下内容:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
</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.metastore.warehouse.dir</name>
<value>/home/spark/app/apache-hive-0.13.1-bin/warehouse</value>
</property>

<property>
<name>hive.querylog.location</name>
<value>/home/spark/app/apache-hive-0.13.1-bin/querylog</value>
</property>

</configuration>

3.将java数据库驱动包mysql-connector-java-5.1.28.jar放到$HIVE_HOME/lib下

4.vim /etc/profile 填写如下内容
export HIVE_HOME=你的目录

export PATH=$PATH:$HIVE_HOME/bin:$HIVE_HOME/conf

source /etc/profile 生效

5.hive或者hive --service cli 启动客户端commod line 
    清屏:
    ctrl+L或者!clear
    内置函数
    show functions;

    查看dfs中的目录
    dfs -ls 目录
    执行操作系统命令:
    !命令

    执行sql脚本
    source sql文件

    禁默:就是开启mr任务时,不用出现信息,方便阅读
    hive -S   (silence)

    在linux中执行
    hive -e

6.web服务:hive --service hwi    http://ip:9999/hwi
    hive-site.xml中添加hwi的配置
    <property>  
          <name>hive.hwi.war.file</name>  
          <value>lib/hive-hwi-0.13.1.war</value>  
      <description>This sets the path to the HWI war file, relative to ${HIVE_HOME}. </description>  
    </property>  

    <property>  
      <name>hive.hwi.listen.host</name>  
      <value>192.168.2.133</value>  
      <description>This is the host address the Hive Web Interface will listen on</description>  
    </property>  

    <property>  
      <name>hive.hwi.listen.port</name>  
        <value>9999</value>  
        <description>This is the port the Hive Web Interface will listen on</description>  
    </property>  


可能会出现问题:HTTP ERROR 500
解决:http://blog.csdn.net/w3045872817/article/details/76851286
还有就是将jdk的lib中tools.jar复制到jre/lib/ext/下

使用hwi界面:http://lxw1234.com/archives/2015/07/419.htm



7.启动用java客户端连接 hive --service hiveserver &
    出现Starting Hive Thrift Server 则成功



www.htsjk.Com true http://www.htsjk.com/hive/37158.html NewsArticle hive安装配置, 我们这里用的是本地模式—–metstore存在mysql数据库中 首相:sudo apt-get update 更新一下 sudo apt-get install mysql-server 下载mysql 安装 hive 让我们看看hive的结构图吧: 1.首相解压:...
相关文章
    暂无相关文章
评论暂时关闭