Hiveserver2配置及优化

先简单介绍下HS1和HS2的主要区别:

           HiveServer1:

                      可以看到HS的进程和MetaStore的进程是在一个虚拟机里面的,而且从图中可以看出,一个HS服务同时只能提供一个访问连接。

 

         HiveServer2:

                             HS2的主要改进是把MetaStoreServer从Hiveserver中剥离出来了,形成一个单独的进程运行,而且hiveserver和metastore server可以同时服务         于多个客户端(Beeline CLI,Hive CLI,HCatalog等)。

 
 
配置Hiveserver2的访问协议,http或者tcp
<property>
   <name>hive.server2.transport.mode</name>
   <value>binary</value>
   <description>Server transport mode.  "binary"  or  "http" .</description>
</property>
 
对应http协议的访问端口
<property>
   <name>hive.server2.thrift.http.port</name>
   <value> 10001 </value>
   <description>Port number when in HTTP mode.</description>
</property>
 
对应tcp协议的访问端口
<property>
   <name>hive.server2.thrift.port</name>
   <value> 10001 </value>
   <description>Port number when in TCP mode.</description>
</property>
 
对应在http协议下线程池的线程数
<property>
   <name>hive.server2.thrift.http.min.worker.threads</name>
   <value> 5 </value>
   <description>Minimum number of worker threads when in HTTP mode.</description>
</property>
<property>
   <name>hive.server2.thrift.http.max.worker.threads</name>
   <value> 500 </value>
   <description>Maximum number of worker threads when in HTTP mode.</description>
</property>
 
对应在tcp协议下的线程池的线程数:
<property>
   <name>hive.server2.thrift.min.worker.threads</name>
   <value> 5 </value>
   <description>Minimum number of worker threads when in TCP mode.</description>
</property>
<property>
   <name>hive.server2.thrift.max.worker.threads</name>
   <value> 500 </value>
   <description>Maximum number of worker threads when in TCP mode.</description>
</property>
 
配置metastore server的地址
<property>
   <name>hive.metastore.uris</name>
   <value></value>
   <description>Thrift URI  for  the remote metastore. Used by metastore client to connect to remote metastore.</description>
</property>
 
配置异步线程池的线程数
<property>
     <name>hive.server2.async.exec.threads</name>
     <value> 100 </value>
     <description>Number of threads in the async thread pool  for  HiveServer2</description>
</property>
 
配置异步线程结束的超时时间(超过这个时间HS会退出):
<property>
   <name>hive.server2.async.exec.shutdown.timeout</name>
   <value> 10 </value>
   <description>Time (in seconds)  for  which HiveServer2 shutdown will wait  for  async
   threads to terminate</description>
</property>
 
配置异步线程的等待超时时间(超过这个值线程会被回收)
<property>
   <name>hive.server2.async.exec.keepalive.time</name>
   <value> 10 </value>
   <description>Time (in seconds) that an idle HiveServer2 async thread (from the thread pool) will wait
   for  new  task to arrive before terminating</description>
</property>
 
<property>
   <name>hive.server2. long .polling.timeout</name>
   <value>5000L</value>
   <description>Time in milliseconds that HiveServer2 will wait, before responding to asynchronous calls that use  long  polling</description>
</property>
 
配置请求缓冲队列的长度
<property>
   <name>hive.server2.async.exec.wait.queue.size</name>
   <value> 100 </value>
   <description>Size of the wait queue  for  async thread pool in HiveServer2.
   After hitting  this  limit, the async thread pool will reject  new  requests.</description>
</property>
 
 
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值