hive 配置metastore hiveserver2服务开启

安装mysql

create database metastore;

配置hive

hive-site.xml:




    
    
        javax.jdo.option.ConnectionURL
        jdbc:mysql://hadoop102:3306/metastore?useSSL=false

    
    
        javax.jdo.option.ConnectionDriverName
        com.mysql.jdbc.Driver

    
    
        javax.jdo.option.ConnectionUserName
        root
    
    
    
        javax.jdo.option.ConnectionPassword
        123456

    
    
        hive.metastore.warehouse.dir
        /user/hive/warehouse
    
   
    
        hive.metastore.schema.verification
        false
    
    
    
        hive.metastore.event.db.notification.api.auth
        false
    

初始化Hive元数据库

bin/schematool -initSchema -dbType mysql -verbose

启动MetaStore服务

hive-site.xml:

   
    
        hive.metastore.uris
        thrift://hadoop102:9083
    
bin/hive --service metastore
2021-10-18 18:22:24: Starting Hive Metastore Server

启动Hiveserver2服务

hive-site.xml:

    
    
        hive.server2.thrift.bind.host
        hadoop102
    
    
    
        hive.server2.thrift.port
        10000
    

重启MetaStore服务:

bin/hive --service metastore

启动hive服务:

bin/hive --service hiveserver2

启动后需要等待一段时间,jdbc才能连接上hive服务

使用beeline客户端验证是否可以连接:

bin/beeline -u jdbc:hive2://hadoop102:10000 -n atguigu

你可能感兴趣的:(hive,hadoop,数据仓库)