环境:

  • hadoop 2.7.6
  • hive 2.3.4

Hive 的 thirft 启动:

  • hadoop 单机或者集群需要:

    • 启动 webhdfs
    • 修改 hadoop 的代理用户 
<property>
<name>hadoop.proxyuser.hadoop.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hadoop.groups</name>
<value>*</value>
</property>

注:

hadoop.proxyuser.hadoop.hosts 中的 hadoop 代表任意节点的代理用户(hadoop, 可以更换) 都能访问 hdfs 集群。groups 表示代理用户的所属组

  • hive 配置

    • 注意 hive.server2.authentication 的方式 NOSASL(如下),与开发使用 pyhive (auth) 或者 impyla (auth_mechanism) 一致,防止出现: Error in sasl_client_start (-4) SASL(-4): no mechanism available:no mechanism available: Unable to find a callback: 2'") 之类的
<property>
<name>hive.server2.authentication</name>
<value>NOSASL</value>
<description>
Expects one of [nosasl, none, ldap, kerberos, pam, custom].
Client authentication types.
NONE: no authentication check
LDAP: LDAP/AD based authentication
KERBEROS: Kerberos/GSSAPI authentication
CUSTOM: Custom authentication provider
(Use with property hive.server2.custom.authentication.class)
PAM: Pluggable authentication module
NOSASL: Raw transport
</description>
</property>
    • hive.server2.enable.doAs
<property>
<name>hive.server2.enable.doAs</name>
<value>true</value>
</property>

注意:默认情况下,HiveServer2以提交查询的用户执行查询访问(true),如果hive.server2.enable.doAs设置为false,查询将以运行hiveserver2进程的用户访问。

      • 与HTTP传送相关的参数如下:
hive.server2.transport.mode – 默认值为binary(TCP),可选值HTTP。
hive.server2.thrift.http.port– HTTP的监听端口,默认值为10001。
hive.server2.thrift.http.path – 服务的端点名称,默认为 cliservice。
hive.server2.thrift.http.min.worker.threads– 服务池中的最小工作线程,默认为5。
hive.server2.thrift.http.max.worker.threads– 服务池中的最大工作线程,默认为500。
      • 为了防止非加密模式下的内存泄露,可以通过设置下面的参数为true禁用文件系统的缓存:
fs.hdfs.impl.disable.cache – 禁用HDFS文件系统缓存,默认值为false。
fs.file.impl.disable.cache – 禁用本地文件系统缓存,默认值为false。

python 连接 hive 的 HiveServer2 的配置坑的更多相关文章

  1. python 连接 hive

    1.python连接hive,其实是连接hiveserver,连接的包的impyla impyla安装: error: cc1plus 没有文件或目录 需要安装gcc 和g++,并且版本保持一致 er ...

  2. Dbeaver连接Hive和Mysql的配置

    1.连接Hive 首选需要配置Hive 这里我们采用的是JDBC的连接方式 (1) 在Hive中后台启动hiveserver2 [root@hadoop-101 hive]# bin/hiveserv ...

  3. hive metastore && hiveserver2 . jvm 配置调整优化

    hive-env.sh 添加如下,其中踩坑踩了不少. if [ "$SERVICE" = "metastore" ]; then if [ -z "$ ...

  4. hive metastore && hiveserver2 . 基本配置

    <?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-s ...

  5. python 连接 hive数据库环境搭建

    首先需要安装以下Python 包:(我用的是Python 2) 在安装Python包之前需要安装一些依赖工具: Debian/Ubuntu: apt-get install python-dev li ...

  6. 通过数据库客户端界面工具DBeaver连接Hive

    前言 本文讲解如何通过数据库客户端界面工具DBeaver连接hive,并解决驱动下载不下来的问题. 1.为什么使用客户端界面工具 为什么使用客户端界面工具而不用命令行使用hive 通过界面工具查看分析 ...

  7. Hive 教程(九)-python with hive

    本文介绍用 python 远程连接 hive,此时需要 hive 启动 hiveserver2 服务 windows 下报如下错误 thrift.transport.TTransport.TTrans ...

  8. java使用JDBC连接hive(使用beeline与hiveserver2)

    首先虚拟机上已经安装好hive. 下面是连接hive需要的操作. 一.配置. 1.查找虚拟机的ip 输入 ifconfig 2.配置文件 (1)配置hadoop目录下的core-site.xml和hd ...

  9. Python连接Redis连接配置

    1. 测试连接: Python 2.7.8 (default, Oct 20 2014, 15:05:19) [GCC 4.9.1] on linux2 Type "help", ...

随机推荐

  1. 将目录结构输出为json格式(zTree)

    # -*- coding: UTF-8 -*- import json,os path = 'E:\\BACKUP' #返回空目录 def path_to_dict(path): d = {'name ...

  2. 微信小程序里使用阿里巴巴矢量图标

    登录 阿里巴巴矢量图标 (https://www.iconfont.cn) 选中图标,加入购物车图标 下载源代码 解析出来如下文件结构 有两种使用方式: 1)不转换成base64的文件 找到 icon ...

  3. Resource View Window of Visual Studio

    https://msdn.microsoft.com/en-us/library/d4cfawwc.aspx For the latest documentation on Visual Studio ...

  4. 巧用foxmail同步qq邮箱的通讯录

    如果您企业使用的qq企业邮箱,那么你在web端登陆邮箱并填写收件人时,发现QQ邮箱是可以自动完成,并且中文名称自动完成. 如何在使用foxmail邮件客户端的情况下也同步这些邮箱信息呢?需要七步,看截 ...

  5. 关于使用python的open函数时报No Such File or DIr的错误

    我写的代码如下: def createFileWithFileName(localPathParam,fileName): totalPath=local_url+'\\'+fileName if n ...

  6. 用JS制作《飞机大作战》游戏_第2讲(四大界面之间的跳转与玩家飞机的移动)-陈远波

    一.通过点击按钮事件,实现四大界面之间的跳转: (一)跳转的思路: 1.打开软件,只显示登录界面(隐藏游戏界面.暂停界面.玩家死亡界面) 2.点击微信登录(QQ登录)跳转到游戏界面,隐藏登录界面 3. ...

  7. swift static与class修饰符:static不参与动态派发

    static与class 都有类型成员的含义:相对于实例成员: static的另一个意思是静态派发:所以不能被继承. 要使用动态派发和继承的机制必须使用class继承. static的其它常见含义: ...

  8. centos 7 安装jira 破解

    http://blog.csdn.net/itjinglun/article/details/52240479

  9. VC基于单文档OpenGL框架

    本文是在VC6.0的环境下,运用MFC实现的OpenGL最基本框架,需要简单了解MFC编程(会在VC6.0里创建MFC单文档应用程序就行),甚至不必了解OpenGL的知识.以下是具体的步骤. 1.创建 ...

  10. 【转】mysql交互式连接&非交互式连接

    交互式操作:通俗的说,就是你在你的本机上打开mysql的客户端,就是那个黑窗口,在黑窗口下进行各种sql操作,当然走的肯定是tcp协议. 非交互式操作:就是你在你的项目中进行程序调用.比如一边是tom ...