【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 附件 ...
随机推荐
- [原创]java WEB学习笔记36:Java Bean 概述,及在JSP 中的使用,原理
本博客为原创:综合 尚硅谷(http://www.atguigu.com)的系统教程(深表感谢)和 网络上的现有资源(博客,文档,图书等),资源的出处我会标明 本博客的目的:①总结自己的学习过程,相当 ...
- javascript数字时钟
<html> <head> <script type="text/javascript"> function startTime() { var ...
- Vue 5小时学习小教程
Vue Vue Vue 起步 指令 v-bind v-if v-for v-on v-model v-bind和v-on缩写 搭建Vue开发环境 vue项目结构 Vue开始 数据绑定, 绑定属性 循环 ...
- 对unidbgrid的单元格操作
一.使某行某列单元格disabled: 1. UniStringGrid -> Options -> goEditing = true 2. UniStringGrid -> Ext ...
- ffmpeg 获取视频宽高
int main(int argc, char *argv[]) { const char* file_name = "video.mp4"; int ret; unsigned ...
- Mac 上Sublime Text 2配置lua环境
1,首先下载最新版lua 然后解压到你想解压到的位置 http://www.lua.org/ftp/ 2,运行终端,cd 进入该文件夹src目录下. 3,在终端输入 make macosx ...
- 分享知识-快乐自己:Liunx 安装 Zookeeper
Zookeeper可以安装在windows中也可以安装在linux中! 但是我们的服务器基本都是在linux之上 安装我们的 zookeeper 注册中心! 安装成功之后 修改 nat 模式对应的端 ...
- hibernate复习第(二)天
今日要点: 关联映射 多对一(Employee - Department) 一对多(Department - Employee) 一对一(Person - IdCard) 多对多(teachet - ...
- codeforces 612D The Union of k-Segments (线段排序)
D. The Union of k-Segments time limit per test 4 seconds memory limit per test 256 megabytes input s ...
- 2013VS快捷键
VS2013常用快捷键: 1.回到上一个光标位置/前进到下一个光标位置 1)回到上一个光标位置:使用组合键“Ctrl + -”: 2)前进到下一个光标位置:“Ctrl + Shift + - ”. ...