一:启动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. Java方法的返回值及注意事项

    方法的返回值 为什么要有带返回值的方法呢? 调用处拿到方法的结果之后,才能根据结果进行下一步操作 带返回值方法的定义和调用: 如果在调用处,要根据方法的结果去编写另一段代码逻辑 为了在调用处拿到方法产 ...

  2. vue项目中使用lottie动画

    一,安装vue-lottie 1 npm install --save vue-lottie 二,引用vue-lottie 在main.js引入并全局注册组件也可在页面单独引用 1 import lo ...

  3. 机器学习06-(支持向量机SVM、网格搜索、文本分词、词袋模型、词频、文本分类-主题识别)

    机器学习-06 机器学习-06 支持向量机(SVM) 支持向量机原理 网格搜索 情感分析 文本分词 词袋模型 词频(TF) 文档频率(DF) 逆文档频率(IDF) 词频-逆文档频率(TF-IDF) 文 ...

  4. 深度学习-05(tensorflow模型保存与加载、文件读取、图像分类:手写体识别、服饰识别)

    文章目录 深度学习-05 模型保存于加载 什么是模型保存与加载 模型保存于加载API 案例1:模型保存/加载 读取数据 文件读取机制 文件读取API 案例2:CSV文件读取 图片文件读取API 案例3 ...

  5. Locust 运行方式

      命令参数方式运行 # -*- coding: utf-8 -*- from locust import TaskSet, task, User ''' 命令行参数运行示例代码 ''' class ...

  6. TED--10 ways to have a better conversation

    10 ways to have a better conversation All right, I want to see a show of hands: how many of you have ...

  7. 再解 [NOI2017] 整数

    提供一个来自 CF 大佬 adament 的有趣思路. 首先我们知道的是一个只增加的 \(b\) 进制整数计数器,如果 \(b\) 是常数那么复杂度是均摊 \(O(1)\) 的.证明只需要考虑将 \( ...

  8. PaddlePaddle 飞桨复现 VGG16

    import paddle.nn as nn class VGG16(nn.Layer): def __init__(self, num_classes=1000): super(VGG16, sel ...

  9. Pillow模块——生成随机验证码

    urls.py path('get_code/',views.get_code), views.py中 from PIL import Image,ImageFont,ImageDraw " ...

  10. pgadmin数据输出不存在了?

    菜单栏→文件→重置布局.这样数据输出就显示了.