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

DataGrip连接hive失败需要查看的事项

DataGrip连接hive失败需要查看的事项

这里写自定义目录标题

一 、查看是否下载了相应的hive 的 jdbc版本,我用的是hive-jdbc-3.1.1.jar
二、更改hive-site.xml文件和core-site.xml 文件。

hive-site.xml文件更改:


	 
    javax.jdo.option.ConnectionURL
    jdbc:mysql://test50:3306/metastore?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
    储存元数据的mysql用户名,一般是root
    username to use against metastore database
  

  
    javax.jdo.option.ConnectionPassword
    元数据mysql密码
    password to use against metastore database
  

        
                hive.metastore.schema.verification
                false
        
        
                 hive.cli.print.current.db
                 true
        
        
                 hive.cli.print.header
                 true
        


        
                 hive.server2.thrift.port
                 10000
        

        
                hive.server2.thrift.bind.host
                192.168.152.50
        


core-site.xml更改:
注意:如果是hadoop集群,需要将集群中其他节点的core-site.xml文件全部更改

```xml


        
                fs.defaultFS
                hdfs://test50:9000
        

        
        
                hadoop.tmp.dir
                /opt/module/hadoopdata
        

        
                hadoop.proxyuser.(用户名:dwl).hosts
                *
        

        
                hadoop.proxyuser.(用户名:dwl).groups
                *
        

重启hadoop集群,然后用以下命令启动hive,

```bash
[root@master ~]# hiveserver2
#或者
[root@master ~]# hive --service hiveserver2


当服务启动到这一步时,底下会卡着刷

Hive Session ID = ********

(有时候会刷个几分钟)再另开一个linux窗口,切换到当前用户下,执行
beeline命令

#进入beeline
[root@master ~]# beeline
#进入beeline后,连接10000端口
beeline> !connect jdbc:hive2://192.168.152.50:10000
Connecting to jdbc:hive2://192.168.152.50:10000
Enter username for jdbc:hive2://192.168.152.50:10000: dwl #用户名dwl
Enter password for jdbc:hive2://192.168.152.50:10000: **** #密码为该用户在主节点的登陆密码如:3729********

至此,打开datagrip,连接hive就可以了。
datagrip连接hive的步骤文章如下:

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/746449.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

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

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