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...
- Two HS2 instances on a single host, different modes on different ports
- 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
- Add a HS2 instance to the desired host using Ambari
- Add a new Hive config group for the host where the new HS2 instance was deployed
- Modify the config group properties: hive.server2.transport.mode & hive.server2.thrift.http.port
- 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