Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000: java.net.ConnectException: 拒绝连接 (Connection refused) (state=08S01,code=0)

一:启动hiveserver2服务

二:启动beeline

三:连接hiveserver2(下面的1000000端口号适当改小写因为其超出最大端口号的范围建议改为10000)

如果启动不成功实现我们先检查以下两个文件配置是否正确

1)hadoop文件夹下面的core-site.xml中的内容

<property>
        <name>hadoop.proxyuser.zhang.hosts</name>
        <value>*</value>
    </property>
    <property>
        <name>hadoop.proxyuser.zhang.groups</name>
            <value>*</value>
    </property>

2)hive文件夹下hive-site.xml中的内容

<property>
		<name>hive.server2.thrift.port</name>
		<value>1000000</value>
	</property>
	<property>
	 	<name>hive.server2.thrift.bind.host</name>
	    	<value>localhost</value>
	</property>

  

可能出现的错误:

解决方案1:杀死占用端口进程(https://blog.csdn.net/xiaoqiu_cr/article/details/81634434)

解决方案2:直接修改配置文件的端口号(我是采用的此种解决方法)

完整的hive-site-xml的内容

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
  <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
    <description>JDBC connect string for a JDBC metastore</description>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionDriverName</name>
    <value>com.mysql.jdbc.Driver</value>
    <description>Driver class name for a JDBC metastore</description>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionUserName</name>
    <value>hive</value>
    <description>username to use against metastore database</description>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionPassword</name>
    <value>hive</value>
    <description>password to use against metastore database</description>
  </property>
    <property>
    <name>hive.cli.print.current.db</name>
    <value>true</value>
</property>
<property>
    <name>hive.server2.thrift.port</name>
    <value>1000000</value>
</property>
<property>
     <name>hive.server2.thrift.bind.host</name>
    <value>localhost</value>
</property>

</configuration>

Hadoop的core-site.xml的内容

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->

<configuration>
    <property>
        <name>hadoop.tmp.dir</name>
        <value>file:/usr/local/hadoop/tmp</value>
    </property>
    <property>
        <name>fs.defaultFS</name>
        <value>hdfs://localhost:9000</value>
    </property>
    <property>
    <name>hadoop.proxyuser.zhang.hosts</name>
    <value>*</value>
</property>
<property>
    <name>hadoop.proxyuser.zhang.groups</name>
    <value>*</value>
</property>

</configuration>

原文地址:https://www.cnblogs.com/zyt-bg/p/11470168.html

时间: 2024-07-30 10:38:25

Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000: java.net.ConnectException: 拒绝连接 (Connection refused) (state=08S01,code=0)的相关文章

mariadb报:ERROR 2002 (HY000): Can&#39;t connect to local MySQL server through socket &#39;/var/lib/mysql/mysql.sock&#39; (111 &quot;Connection refused&quot;)

我这边移除了mysql.sock文件后,重启服务就成功了. 还有一种情况,就是加入galera后,可能是server.cnf配置信息出了问题导致的,修改后,重新运行galera即可,数据库就可以启动成功了. mariadb报:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "Connection refused") 原文地址:h

ERROR security.UserGroupInformation: PriviledgedActionException + java.net.ConnectException解决办法

HADOOP运行mr程序时报错: 15/05/18 19:25:33 INFO mapred.ClientServiceDelegate: Application state is completed. FinalApplicationStatus=SUCCEEDED. Redirecting to job history server 15/05/18 19:25:34 INFO ipc.Client: Retrying connect to server: nwj5/192.168.11.1

hive jdbc connection refused

hive jdbc 连接时抛异常: Exception in thread "main" java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://192.168.206.128:10000/default: java.net.ConnectException: Connection refused: connect     at org.apache.hive.jdbc.Hiv

java.sql.SQLException: No suitable driver found for jdbc:hive://localhost:10000/default

error: java.sql.SQLException: No suitable driver found for jdbc:hive://localhost:10000/default at java.sql.DriverManager.getConnection(DriverManager.java:596) at java.sql.DriverManager.getConnection(DriverManager.java:233) at demo.utils.JDBCUtils.get

Error executing DDL &quot;drop sequence if exists hibernate_sequence&quot; via JDBC Statement

Error executing DDL "drop sequence if exists hibernate_sequence" via JDBC Statement 在使用springboot+jpa进行部署项目时候, 因为application.yml文件配置错误,所以出现上面的异常情况.然后修改.yml配置文件为: spring: jpa: show-sql: true hibernate: ddl-auto: update database-platform: org.hibe

“psql: could not connect to server: Connection refused” Error when connecting to remote database

问题: I am trying to connect to a postgres database installed in a remote server using the following command: psql -h host_ip -U db_username -d db_name This the error that occurs: psql: could not connect to server: Connection refused Is the server runn

synergy提示ERROR: ipc connection error, connection refused

我最近也遇到client端无法建立连接的问题.server端能够建立连接,但client无法建立连接(提示ipc connection error,connection refused).我刚开始的方法是将客户端的这个软件卸载重装,发现果然好了,连接上了.但我把client端电脑重启后又出现无法建立连接的问题,还是上面那个提示,于是我想起来应该是synergy的服务没有开启,开始(或控制面板)-管理工具-服务,启动该服务并将其设置为自动启动.然后果然就好了. 出现这样的情况,应该是我用360安全

启动storm之后浏览器访问报错,org.apache.thrift7.transport.TTransportException: java.net.ConnectException: Connection refused (Connection refused)

原因是zookeeper没有启动 Internal Server Error org.apache.thrift7.transport.TTransportException: java.net.ConnectException: Connection refused (Connection refused) at org.apache.thrift7.transport.TSocket.open(TSocket.java:183) at org.apache.thrift7.transport

android 中Network error IOException: failed to connect to /127.0.0.1 (port 1433): connect failed: ECONNREFUSED (Connection refused)

下面对android中出现的Network error IOException: failed to connect to /127.0.0.1 (port 1433): 做一下总结: 当用android程序调用本地的sqlserver的时候,当连接ip写成127.0.0.1的时候,怎么都连不通,出现以下的错误信息: 感觉好像是代码有问题或者是清单文件中某个权限忘加了,其实不是这样的.原来模拟器默认把127.0.0.1和localhost当做本身了,在模拟器上可以用10.0.2.2代替127.0