Configuring HiveServer2 for CDH

使用hiveserver2之间你必须做如下的配置变动,配置如果失败将产生不可预料的行为 。

Warning: HiveServer1 is deprecated in CDH 5.3, and will be removed in a future release of CDH. Users of HiveServer1 should upgrade to HiveServer2 as soon as possible.

HiveServer2 Memory Requirements


Number of Concurrent Connections HiveServer2 Heap Size Recommended Range Hive Metastore Heap Size Recommended Range

Up to 40 concurrent connections

Cloudera recommends splitting HiveServer2 into multiple instances and load-balancing once you start allocating over 16 GB to HiveServer2. This reduces the impact of Java garbage collection on active processing by the service.

12 - 16 GB 12 - 16 GB
Up to 20 concurrent connections 6 - 12 GB 10 - 12 GB
Up to 10 concurrent connections 4 - 6 GB 4 - 10 GB
One connection 4 GB 4 GB

Table Lock Manager (必须)

You must properly configure and enable Hive's 表锁管理者. This requires 安装ZooKeeper and setting up a ZooKeeper ensemble; see ZooKeeper Installation.

Failure to do this will prevent HiveServer2 from处理并发查询请求 and 可能导致数据崩塌.

Enable the lock manager by setting properties in /etc/hive/conf/hive-site.xml as follows (substitute your actual ZooKeeper node names for those in the example):

<property>
  <name>hive.support.concurrency</name>
  <description>Enable Hive's Table Lock Manager Service</description>
  <value>true</value>
</property>

<property>
  <name>hive.zookeeper.quorum</name>
  <description>Zookeeper quorum used by Hive's Table Lock Manager</description>
  <value>zk1.myco.com,zk2.myco.com,zk3.myco.com</value>
</property>

hive.zookeeper.client.port

If ZooKeeper is not using the 默认值for  ClientPort , you need to set  hive.zookeeper.client.port  in  /etc/hive/conf/hive-site.xml  to the same value that ZooKeeper is using. Check  /etc/zookeeper/conf/zoo.cfg 找到值  ---- ClientPort . 如果 ClientPort  不是2181 (默认值), set hive.zookeeper.client.port  to the same value. For example, if  ClientPort  is set to 2222, set  hive.zookeeper.client.port  to 2222 as well:

<property>
  <name>hive.zookeeper.client.port</name>
  <value>2222</value>
  <description>
  The port at which the clients will connect.
  </description>
</property>

JDBC driver


The connection URL 格式and the driver 类名称不同for HiveServer2 and HiveServer1:

HiveServer version Connection URL Driver Class
HiveServer2
jdbc:hive2://<host>:<port>
org.apache.hive.jdbc.HiveDriver
HiveServer1
jdbc:hive://<host>:<port>
org.apache.hadoop.hive.jdbc.HiveDriver

Authentication授权

HiveServer2 can be configured to 授权所有的连接 ; 默认情况, 它允许任何客户端连接. HiveServer2 支持  Kerberos or LDAP 授权; configure this in the hive.server2.authentication property in the hive-site.xml 文件. You can also configure Pluggable Authentication, which allows you to use a custom authentication provider for HiveServer2; and HiveServer2 Impersonation, which allows users to execute queries and access HDFS files as the connected user rather than the super user who started the HiveServer2 daemon. For more information, see Hive Security Configuration.












评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值