栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

Unbutu18.04 搭建hive,使用mysql作为元数据仓库

Unbutu18.04 搭建hive,使用mysql作为元数据仓库

Unbutu18.04 搭建hive,使用mysql作为元数据仓库 1. 前言

在已经搭建的Hadoop Ha集群上搭建hive
主要记录了配置文件信息

hive版本 3.1.2

mysql版本 5.7.36

2. mysql安装
  • 安装
sudo apt install mysql-server
  • 使用debian-sys-maint账号登录
mysql -udebian-sys-maint -p
# 密码在etc/mysql/debian.cnf
  • 修改root密码
use mysql;
update user set authentication_string=PASSWORD('123456') where user='root' and host= 'localhost';
# 这一步很重要
update user set plugin="mysql_native_password";
flush privileges;
  • 重启
sudo service mysql restart
3. hive安装
  • 环境变量
export HIVE_HOME=/usr/local/hive
export PATH=$PATH:$HIVE_HOME/bin
  • 配置hive-env.sh
# Set HADOOP_HOME to point to a specific hadoop install directory
# Hadoop目录
HADOOP_HOME=/usr/local/hadoop
# Hive Configuration Directory can be controlled by:
# Hive 配置文件路径
export HIVE_CONF_DIR=/usr/local/hive/conf
  • 配置hive-site.xml
  
  
    javax.jdo.option.ConnectionURL
    jdbc:mysql://ip:3306/hive?createDatabaseIfNotExist=true&useSSL=false
    JDBC connect string for a JDBC metastore
  
  
    javax.jdo.option.ConnectionDriverName
    com.mysql.jdbc.Driver
    Driver class name for a JDBC metastore
  
  
    javax.jdo.option.ConnectionUserName
    root
    username to use against metastore database
  
 
  
    javax.jdo.option.ConnectionPassword
    123456
    password to use against metastore database
  
  
  
    hive.metastore.warehouse.dir
    /hive
    location of default database for the warehouse
  
  
    
    hive.server2.thrift.bind.host
    ip
   
  
   
     hive.server2.thrift.port
     10000
   
  • 配置log4j.properties
property.hive.log.dir = /usr/local/hive/log
  • hadoop core-site.xml增加配置
        
                hadoop.proxyuser.root.hosts
                *
        
        
                hadoop.proxyuser.root.groups
                *
        
        
        
                hadoop.proxyuser.用户名.hosts
                *
        
        
                hadoop.proxyuser.用户名.groups
                *
        
  • 启动
#beeline启动
beeline
!connect jdbc:hive2://ip:10000
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/583331.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号