转载来自http://blog.csdn.net/lsttoy/article/details/53490144

这个问题困扰了我三天,各种查资料踩坑填坑的尝试,终于搞定了这个问题。

首先来品尝下喜悦!

[root@master bin]# beeline
ls: cannot access /home/hive/lib/hive-jdbc-*-standalone.jar: No such file or directory
Beeline version 2.1.0 by Apache Hive
beeline> !connect jdbc:hive2://114.215.xxx.xxx:10000/default
Connecting to jdbc:hive2://114.215.xxx.xxx:10000/default
Enter username for jdbc:hive2://114.215.xxx.xxx:10000/default: root
Enter password for jdbc:hive2://114.215.xxx.xxx:10000/default: ************
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hive/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop/hadoop-2.7.3/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Connected to: Apache Hive (version 2.1.0)
Driver: Hive JDBC (version 2.1.0)
16/12/06 17:08:41 [main]: WARN jdbc.HiveConnection: Request to set autoCommit to false; Hive does not support autoCommit=false.
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://114.215.xxx.xxx:10000/default>

OK,言归正传。从头梳理面临了多少问题。 
如果还没有安装hive的同学可以参见我之前的博文教程。

《【Hadoop】hadoop2.7.3安装hive 2.1.0》


第一个问题 
报错内容如下:

org.apache.hadoop.ipc.RemoteException: User: root is not allowed to impersonate root

这点就比较恶心了,一般来说,可能只是在hadoop中配置的代理用户不一样,如hadoop is not allowed to impersonate root 或者 root is not allowed to impersonate hive 啥的,但是根据网络上调整后尝试的方法,即对应value上面调整为hadoop 和localhost,没有作用。 
我本人的设置为: 
这里第三个字段我是root,因为试验环境,我全部用的root,避免权限问题。你可以根据自己的来设置。

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

第二个问题 
报错内容如下:

beeline> !connect jdbc:hive2://114.215.xxx.xxx:10000/default
Connecting to jdbc:hive2://114.215.xxx.xxx:10000/default
Enter username for jdbc:hive2://114.215.xxx.xxx:10000/default: root
Enter password for jdbc:hive2://114.215.xxx.xxx:10000/default: ************
16/12/05 14:25:23 [main]: WARN jdbc.HiveConnection: Failed to connect to 114.215.xxx.xxx:10000
Error: Could not open client transport with JDBC Uri: jdbc:hive2://114.215.xxx.xxx:10000/default: java.net.ConnectException: Connection refused (state=08S01,code=0)

这里链接拒绝,说明以下几个问题 
第一个,至少你连接是成功的,不然不会出现让你验证username和password的问题。 
第二个,你的链接有问题。有可能是你现在连接的并不是hive2,而是启动的服务hiveserver。这个和hiveserver2有很大的版本区别,具体可以百度。 
第三个,当链接的是hive2,但是还是拒绝的时候,可能问题出在你配置上面,如下:

  <property>
<name>hive.server2.transport.mode</name>
<value>binary</value>
<description>
Expects one of [binary, http].
Transport mode of HiveServer2.
</description>
</property>

切记,当你这里设置为http的时候,此时服务器只提供端口10001的服务,即HTTP方式访问。 
这时候10000端口是不开启的! 
本人就是在这个地方卡了好几天。因此你要用java通过jdbc访问,一定要选择binary。

第三个问题 
报错内容如下:

[root@master ~]# Starting Hive Metastore Server
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hive/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop/hadoop-2.7.3/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
org.apache.thrift.transport.TTransportException: Could not create ServerSocket on address 0.0.0.0/0.0.0.0:9083.

这里表示你可能存在两个问题: 
其一,9083端口的metastore服务已经在使用中,你要停止,可以通过查询PID然后kill来进行重新启动。(如果你选择的是后台启动的话hive –service metastore &) 
其二,你的设置文件中hive-site.xml中,注意metastore的设置。 
我这里给出我一部分的设置,其他的你可以百度自己查询。

 <property>
<name>hive.metastore.local</name>
<value>false</value>
<description>controls whether to connect to remote metastore server or open a new metastore server in Hive Client JVM</description>
</property>
<property>
<name>hive.metastore.uris</name>
<value>thrift://114.215.xxx.xxx:9083</value>
<description>Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.</description>
</property>

另外,几个默认配置为0.0.0.0的地方不要轻易改动。除非你明确的知道修改的目的,否则请默认设置。

  <property>
<name>hive.hwi.listen.host</name>
<value>0.0.0.0</value>
<description>This is the host address the Hive Web Interface will listen on</description>
</property> <property>
<name>hive.server2.webui.host</name>
<value>0.0.0.0</value>
<description>The host address the HiveServer2 WebUI will listen on</description>
</property>

尤其是hive.server2.webui.host 不要随意改动。


如果遇到上述三个问题之外,还是无法链接上10000端口的话,记得用以下步骤。

一,先开启 metastore

hive --service metastore &

二,先开启 hiveserver2

 hive --service hiveserver2 &

三,可以通过命令netstat -ntulp |grep 10000 
可以看到结果 
tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN 27799/java

【Hadoop】hiveserver2 不能启动端口 10000 开启服务的相关经验总结的更多相关文章

  1. Linux对外提供服务 网络操作 端口操作 1.开启服务监听端口 2.设置防火墙,放行访问端口的包 iptables&netfilter 四表五链和通堵策略

    主题: Linux服务器上软件提供服务 1.网络操作 2.端口操作 1.网络操作 本机必须能够ping通目标主机(本地虚拟机或者远程主机) 2.端口操作 1.开启服务监听端口 2.设置防火墙,放行访问 ...

  2. compute节点上开启服务openstack-nova-compute.service时,无法启动的解决方法

          本文前一部分为本人解决问题的过程,但最终没有解决:无奈在网上找方法时,看到有网友评论说:修改controller上的guest账号密码,再重启openstack-nova-compute. ...

  3. hive的hiveserver2模式启动不起来,发现Hadoop一直处于安全模式

    hive的hiveserver2模式启动不起来,发现Hadoop一直处于安全模式 命令介绍 命令hadoop fs –safemode get 查看安全模式状态 命令hadoop fs –safemo ...

  4. 【Azure微服务 Service Fabric 】Service Fabric中应用开启外部访问端口及微服务之间通过反向代理端口访问问题

    问题描述 1) 当成功的在Service Fabric集群中部署了应用后,如何来访问呢?如果是一个Web服务,它的URL又是什么呢? 2) 当Service Fabric集群中,服务之间如需要相互访问 ...

  5. Memcached监听多个端口_同一台Windows机器中启动多个Memcached服务

    下载Memcached服务器 假设你解压在"C:\Program Files\memcached\memcached.exe" 那么可以如下创建多个服务监听不同的端口啦 监听第一个 ...

  6. node服务开发环境判断和启动端口指定---process.env.NODE_ENV

    在node启动的时候我们需要在代码里面判断服务器运行环境 可以根据process.env.NODE_ENV来判断 一.开发环境的判断 1.安装 npm i -g cross-env 2.启动 cros ...

  7. Intellij IDEA中启动多个微服务--开启Run Dashboard管理

    1.找到workspace.xml 2.添加配置 <option name="configurationTypes"> <set> <option v ...

  8. Django 配置(一)开启服务

    注:这里使用的是命令行创建,当然也可以用 pycharm 自带的 django 项目创建更加简便. 安装django pip install django 创建项目 django-admin star ...

  9. 【转】启动、停止Windows服务的DOS命令

    需要用管理员身份运行 在图形界面中启动.停止服务很方便,但是操作系统有时候会出故障,此时不妨使用原始的DOS命令启动.停止服务,也许会收到意想不到的效果的! 方法/步骤 1 开始→所有程序. 2 附件 ...

随机推荐

  1. [原创]Scala学习:编写Scala脚本

    scala支持脚本 1)在/opt/scala-script下创建一个文件hello.scala 编辑内容如下: $ hello ,this is the first scala script 2)运 ...

  2. jquery 初篇

    一.什么是jQuery对象? jQuery 对象就是通过jQuery包装DOM对象后产生的对象. jQuery 对象是 jQuery 独有的. 如果一个对象是 jQuery 对象, 那么它就可以使用  ...

  3. 【反思】一个价值两天的BUG,无论工作还是学习C语言的朋友都看看吧!

    博文原创,转载请联系博主! 使用C语言也有两个年头了,BUG写出来过不少,也改过不少BUG.但是偏偏就是有这么一个BUG让我手头的项目停工了两天,原因从百度找到谷歌,资料从MAN手册找到RFC也没有找 ...

  4. HIVE- 数据倾斜

    数据倾斜就是由于数据分布不均匀,数据大量集中到一点上,造成数据热点.大多数情况下,分为一下三种情况: 1.map端执行比较快,reduce执行很慢,因为partition造成的数据倾斜. 2.某些re ...

  5. Linux课程---1、VMWare安装CentOS虚拟机(安装重要注意)

    Linux课程---1.VMWare安装CentOS虚拟机(安装重要注意) 一.总结 一句话总结: 可以先去百度搜一篇对应系统的安装教程:比如 CentOS 7 安装 1.安装VMWare之后,打开w ...

  6. php 数组分页

    $p = max(1, I('param.p',1,'intval')); $count = count($date); $Page = new Page($count,15); $Page-> ...

  7. 利用simhash计算文本相似度

    摘自:http://www.programcreek.com/java-api-examples/index.php?source_dir=textmining-master/src/com/gta/ ...

  8. 分布式系统的Raft算法——在失联阶段这个老Leader的任何更新都不能算commit,都回滚,接受新的Leader的新的更新 意味着还是可能丢数据!!!

    过去, Paxos一直是分布式协议的标准,但是Paxos难于理解,更难以实现,Google的分布式锁系统Chubby作为Paxos实现曾经遭遇到很多坑. 来自Stanford的新的分布式协议研究称为R ...

  9. Django 文件下载功能

    def file_download(request): con= MySQLdb.connect(host='192.168.xxx.xxx',user='root',passwd='xxxx',db ...

  10. jmeter 多压力机并发测试过程

    要实现多台压力机并发,就必须有多台服务器上安装了jmeter程序包,首先把一台服务器作为主压力机,测试脚本放到这台机器上,主压力机与从压力机在同一局域网中,服务器之间可以ping通 第一步:在linu ...