Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

(hive) Enable HTTP & Binary transport modes in HiveServer2?

avatar

What do you recommend for enabling both HTTP & Binary transport mode for HiveServer2?

This is needed to support Knox, which requires HTTP, and clients which only support Binary mode, such as the Hive Ambari View.

1 ACCEPTED SOLUTION

avatar

Glad to hear that HIVE-5312 will allow a single HS2 instance to run both modes simultaneously. In the meantime you have a couple options...

  1. Two HS2 instances on a single host, different modes on different ports
  2. Two HS2 instances on different hosts, different modes on different or same port

Two HS2 instances on a single host

Note: the second instance will not be managed by Ambari

Start HS2 manually, and override transport mode and port properties:

su - hive /usr/hdp/current/hive-server2/bin/hiveserver2 \
-hiveconf hive.metastore.uris=' ' \
-hiveconf hive.server2.transport.mode=http \
-hiveconf hive.server2.thrift.http.port=10001 \
>/var/log/hive/hiveserver2.out 2> /var/log/hive/hiveserver2.log &

Alternatively, you may duplicate the config directory[1] and set environment variable HIVE_CONF_DIR instead of overriding the hive.server2 properties with -hiveconf.

[1] HDP 2.3+: /etc/hive/conf/conf.server | HDP < 2.3: /etc/hive/conf.server

Two HS2 instances on different hosts

Note: using Ambari is preferable, however you can apply the manual steps from the previous section for clusters managed by Ambari 1.x or without Ambari

  1. Add a HS2 instance to the desired host using Ambari
  2. Add a new Hive config group for the host where the new HS2 instance was deployed
  3. Modify the config group properties: hive.server2.transport.mode & hive.server2.thrift.http.port
  4. Manage the new HS2 component using Ambari

Standard values:

  • hive.server2.transport.mode=binary & hive.server2.thrift.port=10000
  • hive.server2.transport.mode=http & hive.server2.thrift.http.port=10001

View solution in original post

10 REPLIES 10

avatar
Master Guru

Note that in the latest Ambari-2.1.2.1 Hive Ambari view supports the http transport mode in HS2.