一:启动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. cocos2d-x场景间参数传递

    1>使用全局变量     这个就不详细说明了.   2>切换时传递     2.1>在secondScene.h 中加入成员变量,如 int sceneNum;         并在 ...

  2. 即时通讯系统为什么选择GaussDB(for Redis)?

    摘要:如果你需要一款稳定可靠的高性能企业级KV数据库,不妨试试GaussDB(for Redis). 每当网络上爆出热点新闻,混迹于各个社交媒体的小伙伴们全都开启了讨论模式.一条消息的产生是如何在群聊 ...

  3. Kubesphere中DevOps流水线无法部署/部署失败

    摘要 总算能让devops运行以后,流水线却卡在了deploy这一步.碰到了两个比较大的问题,一个是无法使用k8sp自带的kubeconfig认证去部署:一个是部署好了以后但是没有办法解析镜像名. 版 ...

  4. Marior去除边距和迭代内容矫正用于自然文档矫正

    一.简要介绍 本文简要介绍了论文" Marior: Margin Removal and Iterative Content Rectification for Document Dewar ...

  5. Locust 运行方式

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

  6. 解密Prompt系列6. lora指令微调扣细节-请冷静,1个小时真不够~

    上一章介绍了如何基于APE+SELF自动化构建指令微调样本.这一章咱就把微调跑起来,主要介绍以Lora为首的低参数微调原理,环境配置,微调代码,以及大模型训练中显存和耗时优化的相关技术细节 标题这样写 ...

  7. 2021-01-11:linux中,如何看内存的使用情况呢?

    福哥答案2021-01-11: 1.free:查看内存占用情况,会直接返回,常用参数 -M.-G 是以MB或GB为单位返回结果.2.sar:定时检测系统资源占用情况,-r 参数是内存资源,一般用法 s ...

  8. 2022-01-16:小明手中有n块积木,并且小明知道每块积木的重量。现在小明希望将这些积木堆起来, 要求是任意一块积木如果想堆在另一块积木上面,那么要求: 1.上面的积木重量不能小于下面的积木重量;

    2022-01-16:小明手中有n块积木,并且小明知道每块积木的重量.现在小明希望将这些积木堆起来, 要求是任意一块积木如果想堆在另一块积木上面,那么要求: 1.上面的积木重量不能小于下面的积木重量: ...

  9. 2021-07-02:正则表达式匹配。给定一个字符串s和一个匹配串p。“.“匹配单个字符。“*“匹配左边元素的多个字符。判断p是否匹配s。比如s=“ab“,p=“a.“,返回true。比如s=“ab“

    2021-07-02:正则表达式匹配.给定一个字符串s和一个匹配串p."."匹配单个字符.""匹配左边元素的多个字符.判断p是否匹配s.比如s="ab ...

  10. Spring原理(1)——容器

    容器接口 BeanFactory 是ApplicationContext的父接口,所有ApplicationContext的实现都组合了BeanFactory. BeanFactory才是Spring ...