一:启动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>

  

可能出现的错误:

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

解决方案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>

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

  1. MetaException(message:Could not connect to meta store using any of the URIs provided. Most recent failure: org.apache.thrift.transport.TTransportException: java.net.ConnectException: 拒绝连接 (Connection

    hive在hive-site.xml中配置hive.metastore.uris属性,后启动异常 hive异常 [fan@master hive-0.13.1-cdh5.3.6]$ bin/hive ...

  2. cas 单点登录出现org.jasig.cas.client.util.CommonUtils.getResponseFromServer - 拒绝连接 Connection refused

    cas 单点登录出现org.jasig.cas.client.util.CommonUtils.getResponseFromServer - 拒绝连接 Connection refused 环境: ...

  3. 运行SparkStreaming的NetworkWordCount实例出错:Error connecting to localhost:9999 java.net.ConnectException: Connection refused 解决办法

    一.背景 首先按照Spark的官方文档来运行此实例,具体方法参见这里,当运行命令$ nc -lk 9999开启端口后,再运行命令$ ./bin/run-example streaming.Networ ...

  4. mariadb报:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "Connection refused")

    我这边移除了mysql.sock文件后,重启服务就成功了. 还有一种情况,就是加入galera后,可能是server.cnf配置信息出了问题导致的,修改后,重新运行galera即可,数据库就可以启动成 ...

  5. (错误)启动ActiveMQ报错:Transport Connector could not be registered in JMX: java.io.IOException: Failed to bind to server socket: stomp://0.0.0.0:61613?

    一.错误报告 很明显,端口被占用 二.解决方法 1. 在cmd中输入 netstat -ano 查看61613端口被占用情况,如果有其他进程使用,则使用 taskkill /f /pid 进程PID  ...

  6. 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 ja ...

  7. org.elasticsearch.client.transport.NoNodeAvailableException

    SpringBoot连接elasticsearch异常 2018-09-11 16:03:43.692 ERROR 8684 --- [ main] o.s.boot.SpringApplicatio ...

  8. Failed to instantiate [org.elasticsearch.client.transport.TransportClient]

    Springboot 集成 ElasticSearch,springboot报错如下: Error starting ApplicationContext. To display the auto-c ...

  9. db2的select语句在db2 client上执行正确,JDBC连接数据库时报错

    db2的select语句在db2 client上执行正确,JDBC连接数据库时报错. sql语句是:select ...from QUALIFIER.tableName fetch first 21 ...

  10. docker报Error response from daemon: client is newer than server (client API version: 1.24, server API version: 1.19)

    docker version Client: Version: 17.05.0-ce API version: 1.24 (downgraded from 1.29) Go version: go1. ...

随机推荐

  1. 为HttpClient开启HTTP/2

    .Net Core在调用其他服务时,调用通常使用HttpClient,而HttpClient默认使用HTTP/1.1 . 配置 HttpClient 以使用 HTTP/2 h2 连接 自 .NET C ...

  2. C# 获取指定窗口的上层窗口

    如何获取当前窗口层级上方的所有窗口信息 User32有函数GetWindow function (winuser.h) - Win32 apps | Microsoft Docs,可以根据已知窗口句柄 ...

  3. Centos7.x 安装 nmon性能监控工具

    一.简介 nmon 工具可以帮助在一个屏幕上显示所有重要的性能优化信息,并动态地对其进行更新.这个高效的工具可以工作于任何哑屏幕.telnet 会话.甚至拨号线路.另外,它并不会消耗大量的 CPU 周 ...

  4. python的format方法中文字符输出问题

    format方法的介绍 前言 提示:本文仅介绍format方法的使用和中文的输出向左右和居中输出问题 一.format方法的使用 format方法一般可以解决中文居中输出问题,假如我们设定宽度,当中文 ...

  5. Linux中重定向应注意的事情

    引言 你是否见过bash ... 2>&1 1>file.txt的写法? 还没发现这样的写法有什么问题? 那么恭喜你, 看完本文你又将学会一个新知识! 重定向的错误用法 以引言中命 ...

  6. 2020-12-03:mysql中,Heap 表是什么?

    福哥答案2020-12-04:[答案来自此链接:](http://bbs.xiangxueketang.cn/question/605) Heap表,即使用MEMORY存储引擎的表,这种表的数据存储在 ...

  7. 2022-06-28:以下golang代码输出什么?A:true;B:false;C:panic;D:编译失败。 package main import “fmt“ func main() {

    2022-06-28:以下golang代码输出什么?A:true:B:false:C:panic:D:编译失败. package main import "fmt" func ma ...

  8. 2022-02-24:k8s安装rabbitmq,yaml如何写?

    2022-02-24:k8s安装rabbitmq,yaml如何写? 答案2022-02-24: yaml如下: apiVersion: apps/v1 kind: Deployment metadat ...

  9. 2022-01-23:力扣425,单词方块。 给定一个单词集合 (没有重复),找出其中所有的 单词方块 。 一个单词序列形成了一个有效的单词方块的意思是指从第 k 行和第 k 列 (0 ≤ k < m

    2022-01-23:力扣425,单词方块. 给定一个单词集合 (没有重复),找出其中所有的 单词方块 . 一个单词序列形成了一个有效的单词方块的意思是指从第 k 行和第 k 列 (0 ≤ k < ...

  10. 2021-06-29:在两个都有序的数组中找整体第K小的数。

    2021-06-29:在两个都有序的数组中找整体第K小的数. 福大大 答案2021-06-29: 1.A和B长度不等的时候,需要把A和B的长度变成相等. A是短数组,B是长数组. 第k小的数,k从1开 ...