[
https://issues.apache.org/jira/browse/KNOX-570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14744144#comment-14744144
]
Sumit Gupta commented on KNOX-570:
----------------------------------
HiveServer2 HA can be enabled with the following provider settings:
{code:xml}
<provider>
<role>ha</role>
<name>HaProvider</name>
<enabled>true</enabled>
<param>
<name>HIVE</name>
<value>maxFailoverAttempts=3;failoverSleep=1000;enabled=true;zookeeperEnsemble=machine1:2181,machine2:2181,machine3:2181;zookeeperNamespace=hiveserver2</value>
</param>
</provider>
{code}
and the service config in the topology file for this is simply:
{code:xml}
<service>
<role>HIVE</role>
</service>
{code}
Please note there are no URLs specified under the service tag. This is because
the HiveServer2 HA functionality looks up the server URLs from Zookeeper. Just
as in WebHDFS HA functionality, the failover code is a simple round-robin. All
URLs are tried once on failover. When the list is exhausted the entire list of
URLs is re-fetched from Zookeeper and the new list is tried again the same way
(if the configured number of failover attempts has not been reached).
The other difference to note in this HA implementation is that unlike WebHDFS
HA there is no 'retry' configuration or functionality.
> Knox support for HiveServer2 HA
> --------------------------------
>
> Key: KNOX-570
> URL: https://issues.apache.org/jira/browse/KNOX-570
> Project: Apache Knox
> Issue Type: New Feature
> Components: Server
> Affects Versions: 0.7.0
> Reporter: Sumit Gupta
> Assignee: Sumit Gupta
> Fix For: 0.7.0
>
>
> As of Knox 0.5.0, support for WebHDFS HA is available through configuration
> of a HA provider and multiple URLs specified for the WEBHDFS service. There
> is a desire to provide similar support in Knox for HiveServer2 HA.
> HiveServer2 HA has a different implementation than WebHDFS HA in that the
> server information is meant to be looked up via Zookeeper. The configuration
> information involved is typically a Zookeeper ensemble and a Zookeeper
> namespace to lookup the registered HiveServer2 information. The JDBC client
> (Hive) today uses this looked up information to randomly pick a server to
> then send the actual request to. In a failover scenario, the client also
> keeps track of the server that has failed and picks another server at random
> from the list of servers retrieved from Zookeeper. Logic similar to this can
> be implemented in Knox in a specialized Dispatch class so that the client
> connecting to Knox does not have to deal with HA gymnastics.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)