gpt4 book ai didi

java - 无法连接到直线 hive2

转载 作者:可可西里 更新时间:2023-11-01 15:11:03 27 4
gpt4 key购买 nike

Hadoop 2.7.3 和 Hive 2.1.0

我可以像这样连接到直线

!connect jdbc:hive2://

但是当我打字的时候

!connect jdbc:hive2://hostname:10000/default org.apache.hive.jdbc.HiveDriver或者 !connect jdbc:hive2://hostname:10000/default

输入用户名和密码后它给我一个错误

错误:无法打开与 jdbc:hive2://:10000 的连接:java.net.ConnectException:连接被拒绝 (state=08S01,code=0)

在 CLI 中:

which: no hbase in (/user/local/maven/bin:/user/local/maven/bin:/user/local/maven/bin:/user/local/maven/bin:/user/local/maven/bin:/usr/local/rvm/gems/ruby-2.1.2/bin:/usr/local/rvm/gems/ruby-2.1.2@global/bin:/usr/local/rvm/rubies/ruby-2.1.2/bin:/usr/lib64/qt-3.3/bin:/user/local/maven/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/rvm/bin:/usr/local/hive/bin:/usr/bin:/usr/local/bin:/bin:/root/bin:/usr/java/jdk1.7.0_60/bin:/usr/local/hadoop/bin/:/usr/local/hadoop/bin:/usr/local/hadoop/sbin:/usr/bin:/usr/local/bin:/usr/java/jdk1.7.0_60/bin:/usr/java/jdk1.7.0_60/bin:/usr/local/hadoop/bin/:/usr/local/hadoop/bin:/usr/local/hadoop/sbin:/usr/bin:/usr/local/bin:/usr/java/jdk1.7.0_60/bin:/usr/java/jdk1.7.0_60/bin:/usr/local/hadoop/bin/:/usr/local/hadoop/bin:/usr/local/hadoop/sbin)
ls: cannot access /usr/local/hive/lib/hive-jdbc-*-standalone.jar: No such file or directory
Beeline version 2.1.0 by Apache Hive
beeline> !connect jdbc:hive2://10.1.1.60:10000/;transportMode=binary
Connecting to jdbc:hive2://10.1.1.60:1000/;transportMode=binary
Enter username for jdbc:hive2://10.1.1.60:10000/;transportMode=binary: APP
Enter password for jdbc:hive2://10.1.1.60:10000/;transportMode=binary: ****
16/10/25 18:07:11 [main]: WARN jdbc.HiveConnection: Failed to connect to 10.1.1.60:10000
Error: Could not open client transport with JDBC Uri: jdbc:hive2://10.1.1.60:1000/;transportMode=binary: java.net.ConnectException: Connection refused (state=08S01,code=0)
beeline>

有什么建议吗??

我为配置单元 2 设置的 hive-site.xml 中的属性是:-

    <?xml version="1.0"?>
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:derby:;databaseName=/usr/local/hive/metastore_db;create=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>

<property>
<name>org.apache.derby.jdbc.EmbeddedDriver</name>
<value>org.apache.derby.jdbc.ClientDriver</value>
<description>Driver class name for a JDBC metastore</description>
</property>

<property>
<name>hive.server2.thrift.min.worker.threads</name>
<value>5</value>
<description>Minimum number of worker threads</description>
</property>

<property>
<name>hive.server2.thrift.max.worker.threads</name>
<value>500</value>
<description>Maximum number of worker threads</description>
</property>

<property>
<name>hive.server2.thrift.port</name>
<value>10000</value>
<description>TCP port number to listen on</description>
</property>

<property>
<name>hive.server2.thrift.bind.host</name>
<value>hadoop-master</value>
<description>TCP interface to bind to</description>
</property>


<property>
<name>hive.server2.transport.mode</name>
<value>binary</value>
<description>Set to http to enable HTTP transport mode</description>
</property>


<property>
<name>hive.server2.thrift.http.port</name>
<value>10001</value>
<description>HTTP port number to listen on</description>
</property>

<property>
<name>hive.server2.thrift.http.max.worker.threads</name>
<value>500</value>
<description>TCP interface to bind to</description>
</property>

<property>
<name>hive.server2.thrift.http.min.worker.threads</name>
<value>5</value>
<description>Minimum worker threads in the server pool</description>
</property>

<property>
<name>hive.server2.authentication</name>
<value>NOSASL</value>
</property>

<property>
<name>hive.server2.thrift.http.path</name>
<value>cliservice</value>
<description>The service endpoint</description>
</property>


</configuration>

有什么建议吗?

最佳答案

  1. 首先检查您的 Hive 服务器是否正在监听端口 10000?

    网络统计-an | grep 10000

    如果没有!转到 /tmp/{username}/hive.log 看看有什么问题!

  2. 如果配置单元服务器已启动并正在运行,请检查您创建的架构!

    schematool -validate -dbType -verbose

    如果架构有问题,那么您应该重新初始化架构。

  3. 如果一切正常,那么您应该使用以下方式连接:

    beeline -u jdbc:hive2://{IP 或服务器名}:10000

关于java - 无法连接到直线 hive2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40240948/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com