Configure load balancing for Apache Hive through Knox

Learn how to configure load balancing for Apache Hive when accessing it through Knox Gateway using the Cloudera ODBC driver for Hive to prevent connectivity errors and distribute workload across Hive instances.

Load balancing is disabled by default when accessing Apache Hive using the Cloudera ODBC driver for Hive. To enable load balancing, you must configure the disableLoadBalancingForUserAgents parameter in Cloudera Manager.
  1. In Cloudera Manager, select the Knox service.
  2. Go to the Configuration tab.
  3. Search for Knox Gateway Advanced Configuration Snippet (Safety Valve) for conf/cdp-resources.xml.
  4. Click the + icon and add the following parameter:
    • Name: HIVE
    • Value:
      enableStickySession=true;noFallback=true;enableLoadBalancing=true;maxFailoverAttempts=0;disableLoadBalancingForUserAgents=NONE


  5. Click Save Changes(CTRL+S).
  6. Refresh the Knox instances configuration by clicking the Stale Configuration: Refresh needed indicator and wait until the refresh process completes.

This configuration enables load balancing for Hive, ensuring proper workload distribution across Hive instances, and preventing connectivity errors when using the Cloudera ODBC driver for Hive.