大数据学习

Hive开发环境搭建

2018-06-05  本文已影响36人  袭明

1. 安装Hive

1.1准备工作
1.2 开始安装步骤

【vim /etc/profile】

编辑

# Hive
export HIVE_HOME=/usr/local/Hive/apache-hive-2.3.3-bin
export PATH=$PATH:$HIVE_HOME/bin

保存后使其生效:【source /etc/profile】

2. 安装mysql作为hive的Metastore

在linux安装mysql的文章日后单独补充

3. 配置Hive

3.1 准备工作

linux开启hdfs,yarn

start-dfs.sh
start-yarn.sh

jps指令确保相关服务全都开启


QQ截图20180604224831.png
3.2 开始配置
hdfs dfs -mkdir -p /user/hive/warehouse
hadoop fs -chmod g+w /tmp
hadoop fs -chmod g+w /user/hive/warehouse

进入hive的conf目录下复制hive-default.xml.template,名字命名为 hive-site.xml

cp hive-default.xml.template hive-site.xml

具体配置如下

<property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:mysql://127.0.0.1:3306/hive?createDatabaseIfNotExist=true&amp;useSSL=false</value>
    <description>JDBC connect string for a JDBC metastore</description>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionDriverName</name>
    <value>com.mysql.jdbc.Driver</value>
    <description>Driver class name for a JDBC metastore</description>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionUserName</name>
    <value>root</value>
    <description>Username to use against metastore database</description>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionPassword</name>
    <value>123456</value>
    <description>password to use against metastore database</description>
  </property>
  
  <property>
    <name>hive.exec.local.scratchdir</name>
    <value>/usr/local/Hive/apache-hive-2.3.3-bin/tmp</value>
    <description>Local scratch space for Hive jobs</description>
  </property>
  <property>
    <name>hive.downloaded.resources.dir</name>
    <value>/usr/local/Hive/apache-hive-2.3.3-bin/tmp/resources</value>
    <description>Temporary local directory for added resources in the remote file system.</description>
  </property>
  <property>
    <name>hive.querylog.location</name>
    <value>/usr/local/Hive/apache-hive-2.3.3-bin/tmp</value>
    <description>Location of Hive run time structured log file</description>
  </property>
  <property>
    <name>hive.server2.logging.operation.log.location</name>
    <value>/usr/local/Hive/apache-hive-2.3.3-bin/tmp/operation_logs</value>
    <description>Top level directory where operation logs are stored if logging functionality is enabled</description>
  </property>
schematool -initSchema -dbType mysql 

若格式化失败,删掉默认的hive数据库,重新执行初始化命令

5. 安装Beeline CLI

推荐:SQuirrel SQL Client

若网站无法打开,可以在在百度网盘下载:
链接:https://pan.baidu.com/s/1V2Kt9WmPFi8G13VTdXnCXQ 密码:jygl

连接比较简单就这几步:

QQ截图20180605184634.png QQ截图20180605184752.png

完!


深圳湾公园
上一篇下一篇

猜你喜欢

热点阅读