bin/beeline连接数据库报 Could not open client transport with JDBC Uri: jdbc:hive2

本文详细介绍了Hive2在启动过程中遇到的问题及解决方案,包括检查MySQL是否启动、确认lib目录下是否有MySQL驱动的jar包,以及如何正确复制mysql-connector-java到hive/lib目录的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

这里其实是hive2没有启动起来。如果你在hive里整合了mysql的话,那么还有一种可能就是mysql没有启动或者你的hive下的lib里没有MySQL驱动的jar包。不要以为你之前里面有就不去看一下,我的就是莫名奇妙的消失了。
然后从hive中把mysql驱动复制过去
cp mysql-connector-java-5.1.27-bin.jar /opt/module/hive/lib/
然后再启动hiveserver2 & 试试

[root@hadoop3 conf]# /export/servers/hive-3.1.3/bin/beeline -u jdbc:hive2://hadoop1:10000 -n root -p SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/export/servers/hive-3.1.3/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/export/servers/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/export/servers/hive-3.1.3/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/export/servers/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] Connecting to jdbc:hive2://hadoop1:10000/;user=root Enter password for jdbc:hive2://hadoop1:10000/: ********* 25/03/08 21:18:03 [main]: WARN jdbc.HiveConnection: Failed to connect to hadoop1:10000 Could not open connection to the HS2 server. Please check the server URI and if the URI is correct, then ask the administrator to check the server status. Error: Could not open client transport with JDBC Uri: jdbc:hive2://hadoop1:10000/;user=root: java.net.ConnectException: 拒绝连接 (Connection refused) (state=08S01,code=0) Beeline version 3.1.3 by Apache H怎么回事
03-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值