【Hadoop】hiveserver2 不能启动端口 10000 开启服务的相关经验总结
转载来自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 开启服务的相关经验总结的更多相关文章
- Linux对外提供服务 网络操作 端口操作 1.开启服务监听端口 2.设置防火墙,放行访问端口的包 iptables&netfilter 四表五链和通堵策略
主题: Linux服务器上软件提供服务 1.网络操作 2.端口操作 1.网络操作 本机必须能够ping通目标主机(本地虚拟机或者远程主机) 2.端口操作 1.开启服务监听端口 2.设置防火墙,放行访问 ...
- compute节点上开启服务openstack-nova-compute.service时,无法启动的解决方法
本文前一部分为本人解决问题的过程,但最终没有解决:无奈在网上找方法时,看到有网友评论说:修改controller上的guest账号密码,再重启openstack-nova-compute. ...
- hive的hiveserver2模式启动不起来,发现Hadoop一直处于安全模式
hive的hiveserver2模式启动不起来,发现Hadoop一直处于安全模式 命令介绍 命令hadoop fs –safemode get 查看安全模式状态 命令hadoop fs –safemo ...
- 【Azure微服务 Service Fabric 】Service Fabric中应用开启外部访问端口及微服务之间通过反向代理端口访问问题
问题描述 1) 当成功的在Service Fabric集群中部署了应用后,如何来访问呢?如果是一个Web服务,它的URL又是什么呢? 2) 当Service Fabric集群中,服务之间如需要相互访问 ...
- Memcached监听多个端口_同一台Windows机器中启动多个Memcached服务
下载Memcached服务器 假设你解压在"C:\Program Files\memcached\memcached.exe" 那么可以如下创建多个服务监听不同的端口啦 监听第一个 ...
- node服务开发环境判断和启动端口指定---process.env.NODE_ENV
在node启动的时候我们需要在代码里面判断服务器运行环境 可以根据process.env.NODE_ENV来判断 一.开发环境的判断 1.安装 npm i -g cross-env 2.启动 cros ...
- Intellij IDEA中启动多个微服务--开启Run Dashboard管理
1.找到workspace.xml 2.添加配置 <option name="configurationTypes"> <set> <option v ...
- Django 配置(一)开启服务
注:这里使用的是命令行创建,当然也可以用 pycharm 自带的 django 项目创建更加简便. 安装django pip install django 创建项目 django-admin star ...
- 【转】启动、停止Windows服务的DOS命令
需要用管理员身份运行 在图形界面中启动.停止服务很方便,但是操作系统有时候会出故障,此时不妨使用原始的DOS命令启动.停止服务,也许会收到意想不到的效果的! 方法/步骤 1 开始→所有程序. 2 附件 ...
随机推荐
- 【leetnode刷题笔记】Maximum Depth of binary tree
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the long ...
- Ubuntu忘记用户密码解决方法--Authentication token manipulation error
1.重启系统,按住shift键进入grub菜单: 2.选择recovery mode恢复模式: 3.在recovery menu中选择root drop to root shell prompt: 4 ...
- XP最高支持IE8
1.https://www.microsoft.com/zh-CN/download/details.aspx?id=24488 适用于 Windows XP 的 Internet Explorer ...
- linux shell编程(三) if 和 for
if 条件判断: 单分支的if语句if 判断条件: then statement1fi双分支的if语句if 判断条件;then statement1 statementelse statement3f ...
- 基于js的网页换肤(不需要刷新整个页面,只需替换css文件)
1. [代码][JS]代码 <HTML><HEAD><link ID="skin" rel="stylesheet" typ ...
- 纯CSS3实现的动感菜单效果
1. [代码] 纯CSS3实现的动感菜单效果 <!DOCTYPE html><head><meta http-equiv="Content-Type" ...
- jQuery绑定事件的四种方式区别
jQuery中提供了四种事件监听方式,分别是bind.live.delegate.on,对应的解除监听的函数分别是unbind.die.undelegate.off.在开始看他们之前 一:bind(t ...
- 京东自营,你TM太坑了。
双12来了,京东自营好坑.昨天(12月6日)看的一条秋裤,89元,今天准备买,居然涨到了119,他大爷的. 京东你大爷的.
- php: +1天, +3个月, strtotime(): +1 day, +3 month
php: +1天, +3个月, strtotime(): +1 day, +3 month 比如,我现在当前时间基础上+1天: strtotime("+1 day"); 比如我现 ...
- C++中类型转换
static_cast 静态类型转换. 在编译的时候C++编译器会做类型检查,基本类型能转换,指针类型不进行转换. C语言中隐式类型转换的地方均可以使用static_cast. ...